awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
koxudaxi avatar

koxudaxi/datamodel-code-generator

0
View on GitHub↗
3,943 stars·449 forks·Python·MIT·4 vuesdatamodel-code-generator.koxudaxi.dev↗

Datamodel Code Generator

This project is a command-line schema-to-code converter designed to transform diverse data specifications into type-safe Python data structures. It functions as a generator for Pydantic models, dataclasses, and typed dictionaries, enabling developers to maintain synchronization between evolving data contracts and application code. By parsing formats such as JSON Schema, OpenAPI, AsyncAPI, Protobuf, and Avro, the tool automates the creation of native classes that reflect the constraints and metadata defined in the source specifications.

The generator distinguishes itself through a highly configurable pipeline that manages complex schema relationships, including circular dependency resolution and reference-based model linking. It provides extensive control over the generated output, allowing for custom base class definitions, field aliasing, and strict type enforcement. Users can tailor the rendering logic to match specific project style standards, ensuring that generated code is modular, formatted, and ready for integration into existing codebases.

Beyond basic generation, the tool supports automated workflows by integrating directly into continuous integration and deployment pipelines. It includes features for schema change monitoring, model validation, and configuration management, which ensure that generated models remain consistent with source definitions across different environments. The project is distributed as a command-line utility, with support for project-level configuration files to facilitate repeatable and auditable generation tasks.

Features

  • Schema-Driven Code Generators - Transforms structured data specifications into native, type-safe Python classes and data structures.
  • JSON Schema to Python Generators - Generates validated Python data structures from schema definitions to keep code synchronized with data contracts.
  • Avro Model Generation - Creates type-safe data models from diverse schema specifications including JSON Schema, XML, and Avro.
  • Constraint-to-Code Mappers - Translates schema constraints like minimum, maximum, or pattern requirements into field validation definitions.
  • Schema Normalizers - Normalizes diverse schema formats like JSON Schema, OpenAPI, and Avro into a consistent internal model for translation.
  • Schema-to-Code CLI Generators - Provides a command-line interface to parse data formats and generate type-hinted Python code.
  • API Client Generators - Generates type-safe client models from API specifications to ensure consistent data handling.
  • Data Model Engineering - Transforms complex data formats into native Python data structures for robust application development.
  • Data Model Generators - Transforms various API specifications into type-safe Pydantic models, dataclasses, and TypedDicts.
  • API Schema Retrieval - Retrieves schema definitions from network URLs with support for custom headers and timeouts.
  • Generated Field Exclusions - Adjusts field generation settings like optionality and default value stripping to meet specific data requirements.
  • Literal Types - Converts enumeration fields into literal type annotations to simplify generated model structures.
  • Dynamic Data Model Generation - Executes generated model code in temporary modules to provide live, usable classes at runtime.
  • Identifier-Based Model References - Resolves internal and external schema references to prevent redundant class generation and promote code reuse.
  • Schema Patching and Merging - Identifies and merges identical model or enum definitions across a schema to reduce redundancy and simplify the generated codebase.
  • Type Mapping Overrides - Allows overriding default type generation to map schema formats to custom types.
  • Strict Type Enforcement - Enforces strict type conversion rules during model generation to ensure data integrity.
  • Field-Level Metadata Annotations - Uses annotated syntax for field definitions to preserve schema constraints and metadata in generated code.
  • Automates de flux de travail déclenchés par le build - Triggers automatic data model updates or verification whenever underlying schema files change.
  • Custom Declarative Base Classes - Supports custom base class definitions and mixins to inject shared functionality into generated data models.
  • Generated Code Organizers - Organizes generated models into modular file structures to maintain clean and manageable project codebases.
  • Field Name Aliasing - Maps schema field and class names to safe Python identifiers using custom aliasing configurations.
  • Project Configuration - Defines generation settings within project configuration files to ensure repeatable model creation.
  • Template-Based Code Generators - Automates the creation of source code using dynamic templates and configurable rendering logic.
  • Schema-Driven Inheritance Generators - Translates schema composition rules into explicit class inheritance hierarchies in generated Python models.
  • Iterable Class Implementation - Implements sequence interfaces on root list-wrapping classes to allow direct indexing and iteration.
  • Schema Reference Resolution - Fetches external schema definitions over network or filesystem with configurable resolution settings.
  • Configuration-Driven Pipelines - Ensures reproducible generation workflows by defining parameters and execution sequences in static configuration files.
  • Pydantic Schema Validation - Automates the creation of validated Pydantic data structures from schema definitions.
  • Schema Default Values - Allows overriding schema-defined default values with custom mappings during the code generation process.
  • Circular Dependency Resolution - Orders class definitions and resolves circular imports through forward references and modular splitting.
  • Immutable Model Generation - Generates frozen, immutable models to enforce data integrity and prevent accidental modification.
  • CI/CD Integrations - Automates data model generation and validation within continuous integration pipelines to ensure schema synchronization.
  • Model Field Constraints - Configures model strictness to allow, ignore, or forbid extra fields not defined in the source schema.
  • Model Naming Overrides - Overrides auto-generated class names using custom mappings to avoid collisions and improve readability.
  • Package and Variable Name Collision Avoidances - Resolves naming conflicts between fields and types to maintain clarity in generated code.
  • Parameter Name Normalization - Normalizes non-safe property names to snake case to ensure generated code follows standard naming conventions.
  • Generated Container Types - Implements abstract container types in generated models to enhance type hinting flexibility and usability.
  • Source Change Monitors - Monitors input schema files for modifications to trigger automatic code regeneration.
  • Data Model Validation - Verifies that existing data models match current schema definitions to ensure consistency.
  • Path Filters - Restricts model generation to a subset of API paths while maintaining necessary parameter and versioning context for the selected endpoints.
  • OpenAPI to Python Converters - Maps OpenAPI schema definitions to native Python classes for type-safe API consumption.

Historique des stars

Graphique de l'historique des stars pour koxudaxi/datamodel-code-generatorGraphique de l'historique des stars pour koxudaxi/datamodel-code-generator

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Collections incluant Datamodel Code Generator

Sélections manuelles où Datamodel Code Generator apparaît.
  • Content scaffolding tools
  • Générateurs de code client OpenAPI

Alternatives open source à Datamodel Code Generator

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Datamodel Code Generator.
  • knq/xoAvatar de knq

    knq/xo

    3,890Voir sur GitHub↗

    xo is a tool for generating type-safe Go models and query execution code from SQL database schemas and queries. It functions as a multi-dialect SQL tool supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server to produce idiomatic source code. The project uses a template-based generation system, allowing the structure and logic of the generated database source code to be defined through customizable text templates. It also includes a database schema visualizer that analyzes table relationships and definitions to create visual diagrams and structured documentation. The tool's ca

    Go
    Voir sur GitHub↗3,890
  • joelittlejohn/jsonschema2pojoAvatar de joelittlejohn

    joelittlejohn/jsonschema2pojo

    6,379Voir sur GitHub↗

    Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc

    Java
    Voir sur GitHub↗6,379
  • hey-api/openapi-tsAvatar de hey-api

    hey-api/openapi-ts

    4,128Voir sur GitHub↗

    openapi-ts is a tool and orchestrator used to convert OpenAPI specifications into type-safe TypeScript SDKs and HTTP client implementations. It automatically generates typed interfaces and request functions from API definitions to ensure consistency between the server and the client. The project employs a transport-agnostic client interface, decoupling high-level API calls from the underlying network library. It uses a plugin-based generation pipeline and a custom plugin architecture to allow for the customization of output types and validation schemas. The system provides capabilities for n

    TypeScriptangularaxioscodegen
    Voir sur GitHub↗4,128
  • oapi-codegen/oapi-codegenAvatar de oapi-codegen

    oapi-codegen/oapi-codegen

    8,088Voir sur GitHub↗

    oapi-codegen is an OpenAPI specification compiler and code generator for Go. It transforms OpenAPI definitions into type-safe Go client libraries, server boilerplate, and data models to facilitate contract-first API development. The tool distinguishes itself through a flexible customization system that allows users to override generated types and imports via specification extensions. It supports the use of custom text templates to redefine the final source code structure and provides a specification overlay mechanism to modify or remove endpoints without altering the original source file. Th

    Gogogolangopenapi
    Voir sur GitHub↗8,088
Voir les 30 alternatives à Datamodel Code Generator→

Questions fréquentes

Que fait koxudaxi/datamodel-code-generator ?

This project is a command-line schema-to-code converter designed to transform diverse data specifications into type-safe Python data structures. It functions as a generator for Pydantic models, dataclasses, and typed dictionaries, enabling developers to maintain synchronization between evolving data contracts and application code. By parsing formats such as JSON Schema, OpenAPI, AsyncAPI, Protobuf, and Avro, the tool automates the creation of native classes that reflect the…

Quelles sont les fonctionnalités principales de koxudaxi/datamodel-code-generator ?

Les fonctionnalités principales de koxudaxi/datamodel-code-generator sont : Schema-Driven Code Generators, JSON Schema to Python Generators, Avro Model Generation, Constraint-to-Code Mappers, Schema Normalizers, Schema-to-Code CLI Generators, API Client Generators, Data Model Engineering.

Quelles sont les alternatives open-source à koxudaxi/datamodel-code-generator ?

Les alternatives open-source à koxudaxi/datamodel-code-generator incluent : knq/xo — xo is a tool for generating type-safe Go models and query execution code from SQL database schemas and queries. It… joelittlejohn/jsonschema2pojo — Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc. oapi-codegen/oapi-codegen — oapi-codegen is an OpenAPI specification compiler and code generator for Go. It transforms OpenAPI definitions into… orval-labs/orval — Orval is an OpenAPI-to-TypeScript code generator that produces fully typed API clients, data-fetching hooks, mock… hey-api/openapi-ts — openapi-ts is a tool and orchestrator used to convert OpenAPI specifications into type-safe TypeScript SDKs and HTTP… ricosuter/nswag — NSwag is an OpenAPI toolchain for .NET that provides a suite of generators for converting OpenAPI specifications and…