koxudaxi/datamodel-code-generator
Generate Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON/YAML/CSV. observed · 2026-08-28
Health v2 · maintenance only
95/100
- Activity 99
- Release rhythm 87
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 3.0
- age_days: 2653
- days_rel: 9
- days_push: 7
- n_releases_24m: 87
Adoption not part of the score
4007 stars · 453 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A Python CLI tool that generates type-safe Python data models (Pydantic v2, dataclasses, TypedDict, msgspec.Struct) from schema definitions like OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON/YAML/CSV. It handles complex schema features such as $ref, allOf/oneOf/anyOf, enums, and nested types, and can also retarget existing Python model classes to a different output type.
Use cases
- generate pydantic models from openapi spec
- convert schema to python dataclasses
- generate typeddict from yaml schema
- create python models from graphql schema
- generate msgspec structs from protobuf
- generate pydantic models from raw data
- codegen python types for fastapi from swagger
When to choose
- you need Python model classes from API or schema definitions
- you want type-safe, validated models for Pydantic v2, dataclasses, TypedDict, or msgspec
- you want to automate model generation in CI from OpenAPI/JSON Schema sources
When to avoid
- you need runtime schema validation rather than code generation
- you target languages other than Python
- you need hand-crafted models with custom logic that generated code would overwrite
Facets
cli-tool · maturity active
parser serialization developer-tools developer-tools apis web-development backend python cli cross-platform pydantic openapi -schema codegen dataclasses typeddict msgspec graphql protobuf avro fastapi code-generation
6 sources
- readme: https://github.com/koxudaxi/datamodel-code-generator · fetched 2026-08-28 · e6452614b074
- homepage: https://datamodel-code-generator.koxudaxi.dev/ · fetched 2026-08-29 · 15adcd63ad1f
- site_page: https://datamodel-code-generator.koxudaxi.dev/getting-started · fetched 2026-08-29 · 548e4611809d
- registry_pypi: https://pypi.org/pypi/datamodel-code-generator/json · fetched 2026-08-29 · 2fead759a86b
- site_page: https://datamodel-code-generator.koxudaxi.dev/experimental · fetched 2026-08-29 · fe45f1b0517a
- site_page: https://datamodel-code-generator.koxudaxi.dev/faq · fetched 2026-08-29 · fba529213839
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| koxudaxi/datamodel-code-generator | main | 95 |
For agents
markdown · JSON · MCP: product_card(name="koxudaxi/datamodel-code-generator")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem