$npx skillfedfor your agent

datamodel-code-generator

Datamodel Code Generator

Worth itPyPI Build ToolsReleased Aug 202617.6M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — datamodel_code_generator-0.72.4-py3-none-any.whl
v0.72.4 · released 2026-08-12 · Python >=3.10 · 9 runtime deps: argcomplete, black, genson, inflect, isort, jinja2, pydantic, pyyaml

Yes. Active maintenance, no known vulnerabilities, low install friction, and permissive MIT license make it a safe choice. The tool solves a real problem—keeping Python models in sync with external schemas—and supports a wide range of input formats. Install as a dev dependency or standalone CLI depending on your workflow.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later; optional extras (http, graphql, protobuf, ruff) needed for specific schema types or formatters.
  • Low friction: pure Python wheel with nine runtime dependencies (argcomplete, black, genson, inflect, isort, jinja2, pydantic, pyyaml, tomli).
  • Active maintenance—released 2 days ago with 4002 GitHub stars and commits as recent as 2026-08-14.

License · maintenance · safety

MIT (permissive) — MIT license (permissive) allows commercial and private use with minimal restrictions; attribution required but no copyleft obligations.

last release 2026-08-12 (2 days) · last repo commit 2026-08-14 · 4,002 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 17,555,589 downloads/mo, #1,113 on PyPI

Verify before relying

pip install datamodel-code-generator

datamodel-codegen \
  --input schema.json \
  --input-file-type jsonschema \
  --output-model-type pydantic_v2.BaseModel \
  --output model.py
  • Performance characteristics for very large or deeply nested schemas
  • Completeness of schema feature support across all input formats (e.g., edge cases in $ref resolution)
  • Whether the experimental httpx2 backend is production-ready
Same gist for agents: .md · .json

What it is and what it does

Datamodel-code-generator is a CLI tool and library that converts schema definitions into type-safe Python model code. It reads from OpenAPI 3, AsyncAPI, JSON Schema, Apache Avro, XML Schema, Protocol Buffers, GraphQL, MCP tool schemas, and raw data (JSON/YAML/CSV), then outputs Pydantic v2, Pydantic v2 dataclass, dataclass, TypedDict, or msgspec models. The generated code handles complex schema features like $ref, allOf, oneOf, anyOf, enums, and nested types.

It's designed for developers who need to keep Python models in sync with external schema definitions or who want to avoid hand-writing boilerplate. The tool supports both standalone CLI use and integration as a development dependency in projects. It can also retarget existing Python types (Pydantic, dataclass, TypedDict) to different output formats via the --input-model flag. Output is formatted by default with black and isort, though faster builtin or ruff formatters are available.

Use it for

  • Generate Pydantic models from OpenAPI specs to keep API clients and servers synchronized with schema changes.
  • Convert JSON Schema definitions into dataclasses for configuration file parsing with type safety.
  • Transform Protocol Buffer definitions into Python models for gRPC service development.
  • Generate TypedDict or msgspec models from raw JSON/YAML/CSV data for rapid prototyping.
  • Retarget existing Pydantic models to dataclass output for environments that don't use Pydantic.
  • Automate model generation in CI/CD pipelines to enforce schema-driven code generation.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

Active maintenance, no known vulnerabilities, low install friction, and permissive MIT license make it a safe choice. The tool solves a real problem—keeping Python models in sync with external schemas—and supports a wide range of input formats. Install as a dev dependency or standalone CLI depending on your workflow.

Install

datamodel-code-generator on PyPI

Before you install

Low friction: pure Python wheel with nine runtime dependencies (argcomplete, black, genson, inflect, isort, jinja2, pydantic, pyyaml, tomli). Active maintenance—released 2 days ago with 4002 GitHub stars and commits as recent as 2026-08-14.

Requires Python 3.10 or later; optional extras (http, graphql, protobuf, ruff) needed for specific schema types or formatters.

License in practice

MIT license (permissive) allows commercial and private use with minimal restrictions; attribution required but no copyleft obligations.

Quickstart

pip install datamodel-code-generator

datamodel-codegen \
  --input schema.json \
  --input-file-type jsonschema \
  --output-model-type pydantic_v2.BaseModel \
  --output model.py

Verify before relying

  • Performance characteristics for very large or deeply nested schemas
  • Completeness of schema feature support across all input formats (e.g., edge cases in $ref resolution)
  • Whether the experimental httpx2 backend is production-ready

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
9 packages
argcompleteblackgensoninflectisortjinja2pydanticpyyamltomli
MaintenanceActively maintained 2 days since the last release
Last repo commit
First released
Downloads17,555,589 / month, #1,113 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPython

Evidence: datamodel_code_generator-0.72.4-py3-none-any.whl

Tags

Capabilities
generate python models from schemaopenapi to pydanticjson schema code generationdataclass generatorprotocol buffers to pythongraphql schema to modelsavro to python modelsxml schema code gen
Topics
code-generationschema-drivencli-tool

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “xml schema code gen”

  • datamodel-code-generatorGenerates Python data models (Pydantic, dataclasses, TypedDict,…
  • gllm-inference-binaryProvides inference components and utilities for generative AI…
  • xsdataxsdata generates Python dataclasses from XML schemas, WSDL, DTD, and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Build Tools packages

packaging Worth it
PyPI · Build Tools · released Aug 2026

Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.

Apache-2.0 OR BSD-2-Clausepure Python · 3.9+
2.2Bdownloads / mo
tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
pip Worth it
PyPI · Build Tools · released Aug 2026

pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.

MITpure Python · 3.10+
617.5Mdownloads / mo
hatchling Worth it
PyPI · Python Modules · released Aug 2026

Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.

MITpure Python · 3.10+
484.2Mdownloads / mo
grpcio-tools Worth it
PyPI · Build Tools · released Jul 2026

Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.

Apache-2.0compiled wheel · 3.10+
278.2Mdownloads / mo
pre-commit Worth it
PyPI · Build Tools · released Aug 2026

pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.

Install it if your team needs consistent, automated validation at commit time.

permissive licensepure Python · 3.10+
179.9Mdownloads / mo

See also dataclasses-avroschema · py-avro-schema · jsonschema-gentypes · dataclasses-jsonschema · graphql-query · apischema · polyfactory · adaptix · graphene-pydantic · pydantic-avro