AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Dev Tooling/
datamodel-code-generator
datamodel-code-generator logo

datamodel-code-generator

Active·★ 4.1k·MIT·Updated 2026-11-18

datamodel-code-generator is useful when a team already has a data specification and needs corresponding Python models. An agent tool returning support tickets, for example, may need stable fields, enumerations and nested objects. Generating the models reduces repetitive declarations and makes the schema a visible starting point for changes.

The most important result of our review is that successful generation does not give every output type the same runtime behavior. The generated Pydantic model rejected several invalid inputs. A plain dataclass constructor accepted corresponding invalid values. Default coercion and nullable fields also needed explicit checks against the intended interface contract.

On November 4, 2026, we used datamodel-code-generator 0.88.0, Pydantic 2.14.2 and Python 3.12.13. Our handwritten draft-07 JSON Schema describes a support ticket with a required identifier, priority enumeration, nested requester, non-negative retry count, a limit on labels, and forbidden extra properties.

Read the full review, verification scope and sources →

Hands-on tested · Tested on 2026-11-04 with datamodel-code-generator 0.88.0; Pydantic 2.14.2.

Setup: Python 3.12.13 on macOS arm64; one handwritten local JSON Schema, no external business data or model

Commands run

python -m pip install -r doc/review-fixtures/datamodel-code-generator/requirements.txt
python doc/review-fixtures/datamodel-code-generator/verify.py

What we saw

  • Generation repeated identically with timestamps disabled. Valid nested input and its default worked; six classes of invalid data were rejected.
  • Default runtime coerced a numeric string; strict runtime rejected it. Default generated optional integer accepted null; --strict-nullable rejected null and retained the omitted default.
  • Plain dataclass constructors accepted invalid values. Scope is one local JSON Schema, not full conformance or other-format testing.

Data as of 2026-11-12.

License
MIT
Latest release
0.93.0 · 2026-11-11
Last commit
2026-11-11
Contributors
221
Forks
487
Open issues and PRs
61
First published
2019-05-29
PyPI package
datamodel-code-generator 0.93.0 · 4,029,725 downloads last week

Source: GitHub, npm and PyPI public APIs.

#agent-skills#code-generator#csv#dataclass#datamodel#dev-tooling#fastapi#generator
$ Install
$ python -m pip install datamodel-code-generator==0.88.0
↗ Visit site★ GitHub
01

Features

01Inputs: OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, MCP schemas
02Outputs: Pydantic v2, dataclasses, TypedDict, msgspec
03Handles $ref, allOf, oneOf, anyOf and enums
04Browser playground running locally via Pyodide
02

Why choose it

+The generated Pydantic model enforced the six tested required, enum, range, nested, extra-field and array-limit cases.
+Explicit output targets let us compare runtime-validating Pydantic models with plain dataclass containers.
+Generation was byte-repeatable in the tested environment after disabling timestamps.
03

Trade-offs

!Default optional-integer output accepted explicit null; our fixture needed --strict-nullable to reject it while retaining its omitted default.
!Pydantic may coerce inputs, while a plain dataclass constructor does not enforce the same schema restrictions.
!Our single local schema establishes no full-conformance, remote-reference or other-format compatibility result.
05

Maintenance check

ActiveChecked: 2026-11-10
Last commit
2026-11-10
Commits, last 90 days
100+
Releases, last 90 days
23
Latest release
0.92.0 (2026-11-10)
Open issues
93
Recent issues with at least one comment
1/18
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 23, 49, 120, 45, 36, 102, 171, 158, 276, 260, 394, 98

Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.

Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.

Most discussed open issues

  • #2022 Add Swift codable structs support7 comments · 2024-06-30
  • #2775 Migrate to Ruff as the default formatter for improved performance3 comments · 2025-12-24
  • #419 SQL DDL as source input3 comments · 2021-04-28
  • #3658 Support ATProto lexicons as input2 comments · 2026-07-26
  • #3058 Option to not install formatters2 comments · 2026-03-18

Issue titles are quoted from GitHub. Open the link to check whether a problem still applies to the version you use.

04

Who it fits

Pick it if
  • You already maintain a schema and want repeatable generation of Python data models.
  • You can test validation, coercion, omission and null behavior against your interface contract.
Look elsewhere if
  • The domain contract is still undefined and you expect code generation to decide it.
  • You need every generated output type to perform identical runtime validation automatically.
06

Compatibility

Python
3.10+; tested 3.12.13 with target 3.12
Verified via docs
Pydantic
v2 output tested with 2.14.2
Verified via docs
07

Quick start

1
$ python -m pip install datamodel-code-generator==0.88.0
08

Use cases

↳Generating typed Python clients from an OpenAPI spec
↳Converting JSON samples into Pydantic models
09

Alternatives

⚡Top VS:
VSAnthropic Skills★196.7k→VStaste-skill★117.7k→VSimpeccable★112.2k→VSdiagram-design★67.9k→
Anthropic Skills logo
Anthropic Skills★ 196.7k
Public repository for Agent Skills
VSCompare→
taste-skill logo
taste-skill★ 117.7k
Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
VSCompare→
impeccable logo
impeccable★ 112.2k
The design vocabulary for your coding agent. Steer with polish and bolder, review with critique and audit, catch AI slop before it ships.
VSCompare→
diagram-design logo
diagram-design★ 67.9k
Editorial diagram design for Claude Code, Codex, GitHub Copilot, Cursor, Factory Droid, Qoder, and Pi. 45 diagram types. Self-contained HTML + SVG. No shadows. No Mermaid slop.
VSCompare→
skills logo
skills★ 57.8k
Skills for Designers and Engineers.
VSCompare→
awesome-copilot logo
awesome-copilot★ 41.3k
Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
VSCompare→
darwin-skill logo
darwin-skill★ 7.0k
达尔文.skill —— 一个让你的Skill无限进化的系统:评估→改进→测试→保留或回滚 | Autoresearch-inspired autonomous skill optimization for Claude Code. Evaluate, improve, test, keep or revert.
VSCompare→
melonJS logo
melonJS★ 6.5k
A modern & fully featured HTML5 game engine (2D & 3D) for JavaScript/TypeScript, with WebGL/WebGPU rendering, built-in physics, Tiled map & glTF support and WebAudio.
VSCompare→
See all alternatives →

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs05Maintenance check04Who it fits06Compatibility07Quick start08Use cases09Alternatives
datamodel-code-generator /
datamodel-code-generator
↗

Generate Python models from schemas and verify their runtime contract

4.1k487MIT
Last commitToday
StatusActive
CategoryDev Tooling
Contributors221
Latest release0.93.0
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.