Skip to main content

pytypehint 1.1.0

PyPI

Validate data and build ordinary dataclasses from Python type hints. Supports nested models, lists, tuples, enums, unions and Annotated constraints. Inspect the compiled schema or export it as portable data. Types are exact: no implicit coercion. Python 3.11+, standard library only.

The schema and validation core of FuncToWeb.

pip install pytypehint
from dataclasses import dataclass
from typing import Annotated
from pytypehint import Min, struct_of

@dataclass
class Item:
    name: str
    quantity: Annotated[int, Min(1)] = 1

schema = struct_of(Item)
item = schema.build({"name": "Pen"})  # Item(name='Pen', quantity=1)

Compile once and reuse the schema. Invalid input raises SchemaTypeError or SchemaValueError, with the failing field or index in the error path.

Method Result
build(data) Dataclass instance; signature_of(fn) returns kwargs for fn(**kwargs)
resolve(data) Validated dictionary with missing defaults filled at this level
decode(data) Portable values restored to Python types
to_dict() Portable schema description

For portable input, use schema.build(schema.decode(data)).

Documentation

Metadata

Release files for pytypehint 1.1.0

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

Source distribution (sdist)

Source distribution for pytypehint 1.1.0
File Size Uploaded
pytypehint-1.1.0.tar.gz 275.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytypehint 1.1.0
File Interpreter ABI Platform
pytypehint-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 298.6 kB

Release files / pytypehint-1.1.0.tar.gz

Download URL pytypehint-1.1.0.tar.gz
Size 275.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0857e40e0e8fc0e3549d4681ff642d561e8e2a23077720848ffb6a997f137966
BLAKE2b-256 checksum
How to use checksums
2e2ffd6fd6cc666115f994cf93930b44a1b385e54086dc3ec7a6936458b8e441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release files / pytypehint-1.1.0-py3-none-any.whl

Download URL pytypehint-1.1.0-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bad8246f10a53e7d312bb6a23e05354b00c69c4bcd655bc63648d66b1db0dcd
BLAKE2b-256 checksum
How to use checksums
2c6beb7769f3f473eac466fbe710ce32f7f4fb0beb8845fcbe7cd8466505f228
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.3

2 release files

0.0.1

2 release files

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