Skip to main content

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 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.13-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for typeformtools-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 e753b056b51ec7f975254af9067ac9e2a339ead714a730ddde3b668f12575154
MD5 86c29838c088d11ee8f212d3c28691e7
BLAKE2b-256 248cc3978ea802204122f0d06cbccdaf7ec140a193c6818d7179e99cc3e67454

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