Skip to main content

dydantic

Documentation GitHub Repo

dyno

Dydantic is a Python library for dynamically generating Pydantic models from JSON schemas. It provides a convenient way to create Pydantic models on-the-fly based on the structure defined in a JSON schema.

Features

  • Automatically generate Pydantic models from JSON schemas
  • Support for nested objects and referenced definitions
  • Customizable model configurations, base classes, and validators
  • Handle various JSON schema types and formats
  • Extensible and flexible API

Installation

You can install dydantic using pip:

pip install -U dydantic

Usage

Here's a simple example of how to use dydantic to create a Pydantic model from a JSON schema:

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)
print(person)  # Output: Person(name='John', age=30)

For more advanced usage and examples, please refer to the documentation.

Documentation

The complete documentation for dydantic can be found at: https://dydantic.readthedocs.io/

The documentation provides detailed information on installation, usage, API reference, and examples.

Contributing

Contributions to dydantic are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository: https://github.com/hinthornw/dydantic

Before contributing, please read our contributing guidelines for more information on how to get started.

License

dydantic is open-source software licensed under the MIT License.

Acknowledgments

We would like to express our gratitude to the following projects:

  • Pydantic - Dydantic builds upon the awesome Pydantic library, which provides the foundation for data validation and serialization.
  • JSON Schema - Dydantic leverages the JSON Schema specification to define the structure and constraints of the data models.
  • All the contributors who have helped improve dydantic with their valuable feedback, bug reports, and code contributions.

Thank you for using dydantic! If you have any questions or need assistance, please don't hesitate to reach out.

Metadata

Release files for dydantic 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dydantic 0.0.8
File Size Uploaded
dydantic-0.0.8.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dydantic 0.0.8
File Interpreter ABI Platform
dydantic-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / dydantic-0.0.8.tar.gz

Download URL dydantic-0.0.8.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
14a31d4cdfce314ce3e69e8f8c7c46cbc26ce3ce4485de0832260386c612942f
BLAKE2b-256 checksum
How to use checksums
08c52d097e5a4816b15186c1ae06c5cfe3c332e69a0f3556dc6cee2d370acf2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.29

Release files / dydantic-0.0.8-py3-none-any.whl

Download URL dydantic-0.0.8-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd0a991f523bd8632699872f1c0c4278415dd04783e36adec5428defa0afb721
BLAKE2b-256 checksum
How to use checksums
7a7ca1b120141a300853d82291faf0ba1a95133fa390e4b7d773647b69c8c0f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.29

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page