TypeWall is a lightweight, schema-first runtime validation library for Python 3.9 through 3.14. It provides strict parsing, deterministic structured errors, immutable schemas, composition, custom processing, type-derived schemas, boundary adapters, and optional FastAPI integration.
Installation
pip install typewall
pip install "typewall[fastapi]" # optional FastAPI integration
Quick Start
from typewall import w
User = w.object({
"name": w.str().min(2),
"age": w.int().min(0).optional(),
"tags": w.list(w.str()).default([]),
})
user = User.parse({"name": "Ada"})
assert user == {"name": "Ada", "tags": []}
TypeWall is strict: it does not coerce "42" into 42. Use explicit boundary adapters such as parse_env() when text conversion is required.
Error Inspection
result = User.safe_parse({"name": 42})
if not result.ok:
for issue in result.errors:
print(issue.path, issue.code, issue.message)
parse() raises one ValidationError containing every independently reachable issue. safe_parse() returns the same ordered issues without raising.
Integrations
- JSON Schema 2020-12:
to_json_schema(schema) - OpenAPI 3.1 schema objects:
to_openapi_schema(schema) - Environment mappings:
ObjectSchema.parse_env() - CLI:
typewall validate module:attribute [path|-] - FastAPI:
typewall.integrations.fastapi.request_body()
See the documentation, guides, and runnable examples. The documentation site is a self-contained Mintlify project under docs/; preview it locally with cd docs && npm install && npm run dev. Development and benchmark commands are documented in the contributing guide.
Development
uv sync --all-groups --all-extras --python 3.14
uv run pytest
uv run ruff format --check .
uv run ruff check .
uv run mypy
uv run pyright
uv run pytest benchmarks --benchmark-only
Contributing
Contributions go through a fork-based pull request workflow:
- Fork
MyGenX/TypeWallto your account. - Work on a feature branch in your fork, running the local checks above.
- Open a PR from your branch against
MyGenX/TypeWall:main. - Address review feedback and get it merged.
See CONTRIBUTING.md and the contributing guide for the full workflow and required checks.
TypeWall is distributed under the MIT license.
Metadata
Release files for typewall 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| typewall-0.2.1.tar.gz | 154.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typewall-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.6 kB
Release files / typewall-0.2.1.tar.gz
| Download URL | typewall-0.2.1.tar.gz |
|---|---|
| Size | 154.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e71ab37b52dde34f2efa989a612380cd2120d004d9671cfe8b6b225a4660ef5
|
|
BLAKE2b-256 checksum How to use checksums |
9bcffdf44a33ab32d880ab8273600cd97de61e7fd9066591bdb106ec14f6e58f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 11, 2026.
Transparency logRelease files / typewall-0.2.1-py3-none-any.whl
| Download URL | typewall-0.2.1-py3-none-any.whl |
|---|---|
| Size | 25.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
859898ce375a2161e4d35c4ee7fe789f1efbf9302d48cd9444e5d4568ed4e8af
|
|
BLAKE2b-256 checksum How to use checksums |
30340b1af56f0aea51e36db0357510dc9a99397cd55b0e2e63e2aff410d6cb21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 11, 2026.
Transparency logSecurity for typewall 0.2.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for typewall-0.2.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 Jun 11, 2026.
Transparency logA 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.