Ross ROSS = Recommend OSS · open-source software intelligence for agents

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-10-21

github.com/datamodel-code-generator/datamodel-code-generator · homepage · Python · MIT (permissive) observed · 2026-10-21

Health v2 · maintenance only

96/100

  • Activity 100
  • Release rhythm 88
  • Longevity 100
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.

  • gap_med: 2
  • age_days: 2701
  • days_rel: 2
  • days_push: 0
  • n_releases_24m: 98

Full methodology

Adoption not part of the score

4042 stars · 465 forks observed · 2026-10-21

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

Member repositories

For agents

markdown · JSON · MCP: product_card(name="datamodel-code-generator/datamodel-code-generator")

Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem