TypeForm helpers
Reason this release was yanked:
forgot to update README
Project description
typeformtools - Helpers for PEP 747 TypeForms
Usage
Installation
> pip install typeformtools[refresh]
Note this needs the GitHub version of typing-extensions to support TypeForm, which the PyPI version still lacks.
That dependency in typeformtools would have PyPI purposely raise a 400 error, Bad request, upon publishing.
Therefore, the first import of typeformtools dynamically downloads module typing-extensions fom GitHub,
which pip install typeformtools brings with the [refresh] option.
If this worries you, don't use typeformtools with the [refresh] option.
Instead, fix it manually until the PyPI version of typing-extensions will be updated to 4.13,
when this hack will no longer be required.
Interactive usage
> python
>>> import typeformtools
>>> typeformtools.non_optional(int | None)
# <class 'int'>
Contents
Functions to reduce to more basic TypeForms
| function | effect | 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 | 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 - the packaging needs hacks to handle the correct (
GitHub) version oftyping-extensions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typeformtools-0.1.13-py3-none-any.whl.
File metadata
- Download URL: typeformtools-0.1.13-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e753b056b51ec7f975254af9067ac9e2a339ead714a730ddde3b668f12575154
|
|
| MD5 |
86c29838c088d11ee8f212d3c28691e7
|
|
| BLAKE2b-256 |
248cc3978ea802204122f0d06cbccdaf7ec140a193c6818d7179e99cc3e67454
|