Datamodel Code Generator

Datamodel Code Generator

Generate Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON/YAML/CSV.

Install

uv tool install datamodel-code-generator
uv add --dev datamodel-code-generator
pip install datamodel-code-generator

Copied from the project's README. Read what it does before you run it.

README scanSafe

Nothing risky found in the commands its README asks you to run.

We scan the README only, not the code. A clean result is not proof of safety. How we scan

View on GitHub

Repository

Stars
4,060
Forks
488
Last updated
Nov 14, 2026
License
MIT
Language
Python
Created
May 29, 2019
Open issues
74
Quality score
S 81/100

datamodel-code-generator/datamodel-code-generator

Read from GitHub daily.

See alternatives

Made by

No owner listed.

Sign in to claim this tool.