datamodel-code-generator
Generate Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct from various data formats.
- Type
- Agent Skill
- Open source
- Yes
- GitHub Stars
- ★ 4.0k
- Source
- skill-github
Overview
datamodel-code-generator is a powerful tool that generates Python data models from multiple data formats including OpenAPI, JSON Schema, GraphQL, Avro, Protobuf, and raw JSON/YAML/CSV. It supports generating Pydantic v2 models, dataclasses, TypedDict, and msgspec.Struct. The tool handles complex schema definitions such as `$ref`, `allOf`, `oneOf`, `anyOf`, enumerations, and nested types. With a simple command-line interface, users can quickly generate type-safe and validated code that works well with IDEs and type checkers. Ideal for developers who need to generate Python data models from various data sources.
Capabilities
- ▪Generate Pydantic v2 models from OpenAPI
- ▪Generate dataclasses from JSON Schema
- ▪Generate TypedDict from GraphQL
- ▪Generate msgspec.Struct from Avro
- ▪Handle complex schema definitions
- ▪Generate type-safe code
Use cases
Setup
pip install datamodel-code-generator
This information was compiled by AI from public sources and may contain inaccuracies — please refer to the source.
FAQ
How do I install additional dependencies?
Use `pip install 'datamodel-code-generator[http]'` to install HTTP support.
Is Docker support available?
Yes, you can use `docker pull koxudaxi/datamodel-code-generator`.
Related skills
valaxy
A static blog framework based on Vue 3 and Vite with AI capabilities.
sast-skills
Transform your AI coding assistant into a SAST scanner to automatically detect vulnerabilities in code.
Lightswind-UI-Library
AI-native CLI-first React component library with MCP Server support.
scientific-agent-skills
Transform any AI agent into a scientific assistant with 147 ready-to-use research skills.
susi_alexa_skill
A skill that enables question-and-answer interactions between Alexa and Susi AI.
claude-context
Provides code search capabilities for Claude Code, turning the entire codebase into context.