dydantic
Dynamically generate pydantic models from JSON schema.
What it is and what it does
dydantic is a Python library that takes JSON schema definitions and converts them into Pydantic model classes at runtime. Instead of manually writing Pydantic model classes, you pass a JSON schema to the library and it generates a working model with validation built in. The generated models support nested objects, referenced definitions, and customizable configurations.
The package sits on top of pydantic itself, which means you get all of pydantic's validation and serialization capabilities automatically. It's useful when your data structures are defined externally (in JSON schema format) or when you need to create models dynamically based on user input or configuration files rather than hardcoding them in your source code.
Use it for:
- Generate Pydantic models from OpenAPI or JSON Schema specifications without manual class definitions
- Build data validation layers for APIs that accept dynamic schema definitions from clients
- Create model factories in configuration-driven applications where schemas come from external sources
- Reduce boilerplate when working with many similar data structures defined in schema format
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Dynamically generates Pydantic models from JSON schemas at runtime, allowing you to create validated data models on-the-fly based on schema definitions.
Yes, if you need to generate Pydantic models from JSON schemas at runtime. The low install friction and permissive license make adoption straightforward. However, the dormant maintenance status (562 days since last release) means you should verify compatibility with your pydantic version and be prepared to maintain a fork if critical bugs emerge.
Install
dydantic on PyPI
pip
pip install dydanticuv
uv add dydanticpoetry
poetry add dydanticInstalling dydantic
Before you install
Low install friction with a single runtime dependency on pydantic. Package is dormant (562 days since last release), which may indicate limited ongoing maintenance or bug fixes.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it safe to adopt in most projects.
Quickstart
from dydantic import create_model_from_schema
json_schema = {
"title": "Person",
"type": "object",
"properties": {"name": {"type": "string"}, "age": {"type": "integer"}},
"required": ["name"]
}
Person = create_model_from_schema(json_schema)
person = Person(name="John", age=30)
Verify before relying
- Whether the package handles all JSON schema draft versions or only a subset
- Performance characteristics when generating models from large or deeply nested schemas
- Compatibility with recent pydantic versions beyond what classifiers declare
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pydantic |
| Maintenance | dormant — 562 days since the last release |
| First released | |
| Downloads | 1,020,793/month — #4,492 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dydantic-0.0.8-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
jsonschema-pydantic-converterConverts JSON Schema definitions to Pydantic v2…
permissive · top 15,000 on PyPI
pydantic_corepydantic-core provides the high-performance…
permissive · top 100 on PyPI
jamboConverts JSON Schema definitions into Pydantic…
permissive · top 15,000 on PyPI
jsonschema-pydanticConverts JSON Schema definitions into Pydantic…
unclear · top 15,000 on PyPI
gensonGenSON generates JSON Schema documents from…
permissive · top 5,000 on PyPI
sparkdanticConverts Pydantic models to PySpark schemas…
unclear · top 5,000 on PyPI
aiohomematic-configTransforms Homematic device paramset…
permissive · top 15,000 on PyPI
safety-schemasProvides Pydantic models and schemas for Safety…
permissive · top 5,000 on PyPI
pydantic-sparkConverts Pydantic class definitions to Apache…
permissive · top 15,000 on PyPI
pydantic-avroConverts between pydantic class definitions and…
permissive · top 5,000 on PyPI