Runtime type validation for Python
Project description
TypeWall
Runtime type validation for Python with a small, schema-first API.
from typewall import w
User = w.object({
"name": w.str(),
"age": w.int().optional(),
"tags": w.list(w.str()).default([]),
})
user = User.parse({"name": "Ada"})
assert user == {"name": "Ada", "tags": []}
Use safe_parse() when validation failures should be returned instead of raised:
result = User.safe_parse({"name": 42})
if not result.ok:
print(result.to_dict())
The MVP supports strict string, integer, float, boolean, object, and list schemas; required, optional, and defaulted fields; and structured validation errors. It does not coerce values. Constraints, advanced composition, transforms, type-derived schemas, schema export, environment parsing, CLI tools, and framework integrations are intentionally deferred to later phases.
MVP Public API
- Builders:
w,tw, andSchemaBuilder - Schemas:
Schema,StringSchema,IntegerSchema,FloatSchema,BooleanSchema,ObjectSchema, andListSchema - Parsing:
Schema.parse()andSchema.safe_parse() - Field configuration:
Schema.optional()andSchema.default() - Results and errors:
ParseResult,ValidationIssue, andValidationError
MVP object schemas reject unknown keys, omit absent optional fields, defensively
copy defaults, and aggregate independently reachable issues in deterministic order.
The error dictionary uses $ for root failures and dot-delimited paths for nested
fields and list indexes.
Development
TypeWall uses uv and supports CPython 3.9 through 3.14.
UV_CACHE_DIR=.uv-cache uv sync --python 3.14
UV_CACHE_DIR=.uv-cache uv run pytest
UV_CACHE_DIR=.uv-cache uv run ruff check .
UV_CACHE_DIR=.uv-cache uv run mypy
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typewall-0.0.1.tar.gz.
File metadata
- Download URL: typewall-0.0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a870bcdd4c6a6741f6f3009aa7e01c7afa5037dbabcdca9321a804842e259afd
|
|
| MD5 |
434e3a45accbae1bc503dbb743e62dfe
|
|
| BLAKE2b-256 |
7a7bb7a48af0d67b2368b41fc23220c2da8062d65025a4d62292df2380be5d3f
|
Provenance
The following attestation bundles were made for typewall-0.0.1.tar.gz:
Publisher:
pypi-release.yml on MyGenX/TypeWall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typewall-0.0.1.tar.gz -
Subject digest:
a870bcdd4c6a6741f6f3009aa7e01c7afa5037dbabcdca9321a804842e259afd - Sigstore transparency entry: 1787600815
- Sigstore integration time:
-
Permalink:
MyGenX/TypeWall@d808b2619f51676141af1a0cf550a81a018ad04a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/MyGenX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@d808b2619f51676141af1a0cf550a81a018ad04a -
Trigger Event:
release
-
Statement type:
File details
Details for the file typewall-0.0.1-py3-none-any.whl.
File metadata
- Download URL: typewall-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c1a1d1744f8c4536184cff2226d65c9b4adf7e073c8e06e6862855e9922948b
|
|
| MD5 |
460ae726545989942222c43f406aecd5
|
|
| BLAKE2b-256 |
e59f2f8abb13caa1720a50dee126c1f67cb24778172590acea431a39c9c3b89f
|
Provenance
The following attestation bundles were made for typewall-0.0.1-py3-none-any.whl:
Publisher:
pypi-release.yml on MyGenX/TypeWall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
typewall-0.0.1-py3-none-any.whl -
Subject digest:
5c1a1d1744f8c4536184cff2226d65c9b4adf7e073c8e06e6862855e9922948b - Sigstore transparency entry: 1787600897
- Sigstore integration time:
-
Permalink:
MyGenX/TypeWall@d808b2619f51676141af1a0cf550a81a018ad04a -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/MyGenX
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@d808b2619f51676141af1a0cf550a81a018ad04a -
Trigger Event:
release
-
Statement type: