typeformtools - Helpers for PEP 747 TypeForms
Usage
Installation
> pip install typeformtools
Interactive usage
> python
>>> import typeformtools
>>> typeformtools.non_optional(int | None)
# <class 'int'>
Contents
Functions to reduce to more basic TypeForms
| function | effect if argument is intended TypeForm |
otherwise |
|---|---|---|
unaliased() |
type A = T → T | original |
unannotated() |
Annotated[T, ...] → T | original |
undisguised() |
type A = Annotated[T, ...] → T | original |
non_optional() |
T | None → T | Never | original |
Other functions
| function | effect if argument is intended TypeForm |
otherwise |
|---|---|---|
literal_values() |
Literal[value, value, ...] → (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
#TODOs
Metadata
Release files for typeformtools 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typeformtools-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Release files / typeformtools-0.1.14-py3-none-any.whl
| Download URL | typeformtools-0.1.14-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1afd4fedd54cad42b78ec955942eb2fa67461d3e9bd778bb6ac17589d0522890
|
|
BLAKE2b-256 checksum How to use checksums |
dbdcc86f6a4fd901c67bae858cb7df643319fadd15bee57bd275a20307266e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|