Discover and explore top open-source AI tools and projects—updated daily.
koxudaxiPython data model generation from schemas
Top 13.0% on SourcePulse
Generates Python data models from schema definitions and raw data, targeting developers who need to integrate external data sources or define complex data structures. It significantly reduces boilerplate code by automatically creating type-safe, validated Python classes from formats like OpenAPI, JSON Schema, GraphQL, and JSON/YAML/CSV, enhancing developer productivity and code reliability.
How It Works
The core approach involves parsing schema definitions (OpenAPI, JSON Schema, GraphQL) or raw data (JSON, YAML, CSV) and transforming them into Python type-hinted classes. It leverages robust parsing to handle complex schema constructs like $ref, allOf, oneOf, anyOf, and nested types, ensuring accurate and type-safe code generation. This approach streamlines data handling and validation in Python applications.
Quick Start & Requirements
Primary installation via uv tool install datamodel-code-generator or pip install datamodel-code-generator. Optional extras include [http] for remote $ref resolution and [graphql] for GraphQL schema support. Docker image koxudaxi/datamodel-code-generator is also available. Official documentation is hosted at datamodel-code-generator.koxudaxi.dev.
Highlighted Details
$ref, allOf, oneOf, anyOf, enums, and nested types.Maintenance & Community
The project is sponsored by Astral and has significant adoption, with notable dependents including PostHog, Airbyte, and Apache Iceberg. Related projects like fastapi-code-generator indicate ecosystem integration. Community contribution details are available in the "Development & Contributing" section.
Licensing & Compatibility
MIT License. This permissive license allows for commercial use and integration into closed-source projects without significant restrictions.
Limitations & Caveats
No specific limitations, alpha status, or known bugs are detailed in the provided README. The project appears stable and mature with extensive feature support.
1 day ago
Inactive
featureform
eyurtsev
minimaxir