Skip to main content

TypeForm helpers

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 of typing-extensions

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typeformtools-0.1.12-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file typeformtools-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for typeformtools-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cffbc3aba9cbf18bee99e51521c32b702c16ecc297595482511f8a859e1a2bb6
MD5 deb08e76f4b561bbf243fb92ace930db
BLAKE2b-256 ac5759d6140702dea5cd9430e7bb84644787ab515e599021b5811526f388e74f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page