semvec/pypi-packages huggingface dataset:
typeformtools 0.1.14
TypeForm helpers
License: MIT License
Requires Python: >=3.12

# `typeformtools` - Helpers for [PEP 747](https://peps.python.org/pep-0747/) `TypeForm`s

## Usage

### Installation

    > pip install typeformtools

### Interactive usage

    > python
    >>> import typeformtools
    >>> typeformtools.non_optional(int | None)
    # <class 'int'>

## Contents

### Functions to reduce to more basic `TypeForm`s

| function          | effect if argument is intended `TypeForm` | otherwise |
|:------------------|:------------------------------------------|:----------|
| `unaliased()`     | type A = T &rarr; T                       | original  |
| `unannotated()`   | Annotated[T, ...] &rarr; T                | original  |
| `undisguised()`   | type A = Annotated[T, ...] &rarr; T       | original  |
| `non_optional()`  | T &vert; None &rarr; T &vert; Never       | original  |

### Other functions

| function            | effect if argument is intended `TypeForm`             | otherwise |
|:--------------------|:------------------------------------------------------|:----------|
| `literal_values()`  | Literal[value, value, ...] &rarr; (value, value, ...) | fail      |

## Status

This package is very much a *work in progress*:
* it may fail, even for its limited supported scope
* the scope of provided functions needs to be extended
* more functions need to be provided
* more documentation is required
* there are still many `#TODO`s