Skip to main content

typeset for Python

Semantic field types: email, phone, URL, money, locale, cron, ISBN, GeoJSON and the rest of 97 types. Each one turns messy input into one canonical value, refuses everything else with a clear message, and describes itself so you can build forms, schemas and type pickers from it.

This is the Python twin of the npm package @chadc00per/typeset: both store the same input as the same value and refuse it with the same message, held to one shared conformance suite. Validate in the browser and again in a Python backend, and compare the results directly.

pip install "chadc00per-typeset[all]"   # or [phone], [code], or no extras: see below
import chadc00per_typeset as typeset

typeset.Email(' Ada@Example.COM ')         # → 'ada@example.com'
typeset.Phone.normalize('(212) 555-0123')  # → '+12125550123'
typeset.Money('12.5 usd')['amount']        # → '12.50'
typeset.Email.is_('nope')                  # → False
typeset.Email.check('nope', 'user.email')  # → {'ok': False, 'issues': [{'path': 'user.email', 'message': 'must be a valid email address', 'code': 'invalid'}]}
typeset.Email.normalize('nope')            # → raises ValidationError: email must be a valid email address
typeset.to_json_schema('uint8')['maximum'] # → 255
signup = typeset.struct({'email': typeset.Email, 'zip': 'postalcode'})
[i['message'] for i in signup.check({'email': 'x'})['issues']]  # → ['must be a valid email address', 'must be a valid postal code']

Values are the plain values themselves (str, int or float, tuple, or a read-only dict), immutable and hashable, and they serialize with json.dumps. Each type is also a Pydantic field type. The extras: [phone] adds phone numbers (phonenumbers) and [code] the javascript, python, html, css and svg types (an embedded V8 running the npm package's own parsers); without one, those types raise ModuleNotFoundError naming it.

The full guide, including the JavaScript-to-Python name table, is the main README.

Apache-2.0 (with third-party material under its own licenses; see NOTICE). Report vulnerabilities privately: see SECURITY.md.

Metadata

Release files for chadc00per-typeset 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chadc00per-typeset 1.0.1
File Size Uploaded Provenance Actions
chadc00per_typeset-1.0.1.tar.gz 415.5 kB With provenance Details for chadc00per_typeset-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chadc00per-typeset 1.0.1
File Interpreter ABI Platform Actions
chadc00per_typeset-1.0.1-py3-none-any.whl Python 3 none any Details for chadc00per_typeset-1.0.1-py3-none-any.whl

Total release size: 758.5 kB

Release files / chadc00per_typeset-1.0.1.tar.gz

Download URL chadc00per_typeset-1.0.1.tar.gz
Size 415.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a16bd3ace16e37909427bbb2c53200465bb2a827527faff0eb91d715b9853ffc
BLAKE2b-256 checksum
How to use checksums
e36d7639c7a202a2c0a2687c393da4b966558b5e96daeafd666ff26c2e984de2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / chadc00per_typeset-1.0.1-py3-none-any.whl

Download URL chadc00per_typeset-1.0.1-py3-none-any.whl
Size 343.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae62f8d8a8a3eea6b3a076aeabdd44d41fdde397f4c37825cb17878c52b92eff
BLAKE2b-256 checksum
How to use checksums
a17287c3d4d104b3d27d27b595e6b28d0073fd2b498015677c409815e19bb884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for chadc00per-typeset 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chadc00per_typeset-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page