--- id: dydantic version: "0.0.8" license: MIT license_treatment: permissive maintenance: dormant --- # dydantic — Dynamically generate pydantic models from JSON schema. License: permissive · Maintenance: dormant · Downloads: 1.0M/mo ## 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 above — 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 pip install dydantic uv add dydantic 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_current - Install friction: low - Maintenance: dormant - Downloads: 1.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags generate pydantic models from json schema, dynamic model creation from schema, json schema to pydantic, runtime pydantic model generation, schema-driven model builder, schema-driven, code-generation, validation [View on SkillFed](https://skillfed.io/packages/dydantic) · [View on PyPI](https://pypi.org/project/dydantic/)