PLAIN PYTHON · ZERO RUNTIME DEPS
Small, predictable validation for plain Python data.
Validate ordinary Python dicts with zero required runtime dependencies and optional class declarations.
Two dicts. One useful boundary.
Describe the shape with ordinary Python types, then validate the data you receive. A model framework or builder API is not required. Zodify is Zod-inspired, with its own Python semantics and deliberately limited scope.
from zodify import validate
schema = {"name": str, "age": int}
assert validate(schema, {"name": "Ada", "age": 36}) == {"name": "Ada", "age": 36}
try:
validate(schema, {"name": "Ada", "age": "36"})
except ValueError:
pass # String input is rejected by default.
else:
raise AssertionError("Expected validation failure")
print("quickstart: passed")
Expected output: quickstart: passed
A small tool for small data boundaries
Use zodify for configuration dicts, automation scripts, and straightforward Python object validation. Required keys, exact types, nested shapes, and explicit coercion keep decisions visible.
Choose a broader tool when you need extensive typing support, framework integrations, serialization, recursive models, or a JSON Schema implementation. See the selection guide for the appropriate Pydantic TypeAdapter API.
Know the semantics before you rely on them
By default, unknown keys fail validation and bool is not accepted as int. Optional keys and nullable values mean different things. Released defaults are inserted without independent validation or copying.
Canonical error details, strict JSON object input, conservative exact JSON Schema export, and .env file loading are available in 0.8.0. Compilation and reports remain unavailable.