skillfed

dydantic

Dynamically generate pydantic models from JSON schema.

dydantic v0.0.8 1.0M downloads/30d#4,492 on PyPI
Permissive license MIT DORMANT released

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 dydantic

uv

uv add dydantic

poetry

poetry add dydantic

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9

Tags

generate pydantic models from json schemadynamic model creation from schemajson schema to pydanticruntime pydantic model generationschema-driven model builder
schema-drivencode-generationvalidation

More Application Frameworks packages