NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #972 most downloaded on PyPI
Datamodel Code Generator
Latest stable
0.92.0
Last release 9 days ago
10 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
296 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
feat: add new option --parent-scoped-naming to avoid name collisions by @gjcarneiro in https://github.com/koxudaxi/datamodel-code-generator/pull/2373
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.29.0...0.30.0
Fix shadowed import errors by aliasing conflicting symbols in generated models by @sternakt in https://github.com/koxudaxi/datamodel-code-generator/pu
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.5...0.29.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
fix: Fix Union type parsing with recursive None removal by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2342
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.4...0.28.5
feat: add ruff formatters by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2340
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.3...0.28.4
[pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/koxudaxi/datamodel-code-generator/pull/2331
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.2...0.28.3
[pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/koxudaxi/datamodel-code-generator/pull/2328
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.1...0.28.2
Graphql --set-default-enum-member by @andrew-womeldorf in https://github.com/koxudaxi/datamodel-code-generator/pull/2323
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.28.0...0.28.1
Drop <3.9 support as run and generation target by @gaborbernat in https://github.com/koxudaxi/datamodel-code-generator/pull/2324
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.27.3...0.28.0
Reuse extras instead of dependency groups by @gaborbernat in https://github.com/koxudaxi/datamodel-code-generator/pull/2307
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.27.2...0.27.3
fix: Fix extra dependencies by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2306
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.27.1...0.27.2
Support isort 6 by @cjwatson in https://github.com/koxudaxi/datamodel-code-generator/pull/2289
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.27.0...0.27.1
Migrate to use uv instead of poetry by @gaborbernat in https://github.com/koxudaxi/datamodel-code-generator/pull/2288
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.5...0.27.0
typo: Fix 'Allow to' sentence. by @jas4711 in https://github.com/koxudaxi/datamodel-code-generator/pull/2240
[tool.black] section is omitted by @otonnesen in https://github.com/koxudaxi/datamodel-code-generator/pull/2242Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.4...0.26.5
remove poetry-lock in .pre-commit-config.yaml by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2184
uri as a supported data type by @joscha in https://github.com/koxudaxi/datamodel-code-generator/pull/2217required with type: [array, null] by @joscha in https://github.com/koxudaxi/datamodel-code-generator/pull/2216Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.3...0.26.4
[pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/koxudaxi/datamodel-code-generator/pull/2096
--output-datetime-class datetime by @indrat in https://github.com/koxudaxi/datamodel-code-generator/pull/2124use_enum_values in ConfigDict by @nbro10 in https://github.com/koxudaxi/datamodel-code-generator/pull/2134Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.2...0.26.3
New CLI option --output-datetime-class #1996 by @archetipo in https://github.com/koxudaxi/datamodel-code-generator/pull/2100
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.1...0.26.2
feat: support string format: duration for pydantic/msgspec by @indrat in https://github.com/koxudaxi/datamodel-code-generator/pull/2084
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.26.0...0.26.1
Drop support python 3.7 on runtime by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/2060
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.9...0.26.0
Fix merging config and args by @mahdilamb in https://github.com/koxudaxi/datamodel-code-generator/pull/2015
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.8...0.25.9
feat: new cli option --use-exact-imports by @alpoi-x in https://github.com/koxudaxi/datamodel-code-generator/pull/1983
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.7...0.25.8
Add from_attributes to ConfigDict by @michael2to3 in https://github.com/koxudaxi/datamodel-code-generator/pull/1946
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.6...0.25.7
Fix missing Union by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1905
BaseClassDataType by @rshah-evertz in https://github.com/koxudaxi/datamodel-code-generator/pull/1862Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.5...0.25.6
Fix overriden required by @fft001 in https://github.com/koxudaxi/datamodel-code-generator/pull/1868
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.4...0.25.5
Fix object instance comparison. Add test. by @jamesbezuk in https://github.com/koxudaxi/datamodel-code-generator/pull/1849
--input-file-type options by @JoeHCQ1 in https://github.com/koxudaxi/datamodel-code-generator/pull/1846Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.3...0.25.4
Enable ability to use custom JsonSchemaObject in JsonSchemaParser by @WilliamJamieson in https://github.com/koxudaxi/datamodel-code-generator/pull/178
JsonSchemaObject in JsonSchemaParser by @WilliamJamieson in https://github.com/koxudaxi/datamodel-code-generator/pull/1783Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.2...0.25.3
Fix original_name validation by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1755
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.1...0.25.2
Fix invalid definition of graphql requirement by @denisart in https://github.com/koxudaxi/datamodel-code-generator/pull/1741
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.25.0...0.25.1
Improve collapse_root_models for list by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1700
Item suffix of anyOf and oneOf model names by https://github.com/koxudaxi/datamodel-code-generator/pull/1682
datetime.datetime to pydantic.AwareDatetime in pydantic v2 by https://github.com/koxudaxi/datamodel-code-generator/pull/1735Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.24.2...0.25.0
Fix join_url bug when httpx 2.4.0 or later by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1699
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.24.1...0.24.2
Add pyyaml by @mmwinther in https://github.com/koxudaxi/datamodel-code-generator/pull/1698
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.24.0...0.24.1
Fix UnionIntFloat json schema generation. by @jboulmier in https://github.com/koxudaxi/datamodel-code-generator/pull/1669
pysnooper, prance, openapi-spec-validator from the default dependencies list.
If you want to use --debug and --validation, please add the extra option when you install packages datamodel-code-generator[debug] and datamodel-code-generator[validation]--validation option will be removed in the new future. please use other tools to validate OpenAPI Schema.Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.23.0...0.24.0
Support $defs for Draft 2019-09 by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1630
--remove-special-field-name-prefix + fields (e.g. enum members) starting with numbers by @lord-haffi in https://github.com/koxudaxi/datamodel-code-generator/pull/1654Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.1...0.23.0
Ignore broken pydantic version 2.4.0 by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1593
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.22.0...0.22.1
Organize help options by @howardj99 in https://github.com/koxudaxi/datamodel-code-generator/pull/1540
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.5...0.22.0
Added protect namespace to Pydantic v2 ConfigDict by @willarmiros in https://github.com/koxudaxi/datamodel-code-generator/pull/1489
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.4...0.21.5
switch away from deprecated pydantic method by @iliakur in https://github.com/koxudaxi/datamodel-code-generator/pull/1485
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.3...0.21.4
Give Pydantic V2 its own dump_resolve_reference_action to use model_rebuild not update_forward_refs by @lmmx in https://github.com/koxudaxi/datamodel-
dump_resolve_reference_action to use model_rebuild not update_forward_refs by @lmmx in https://github.com/koxudaxi/datamodel-code-generator/pull/1468base_class validation similar to _validate_base_class to bare generate calls by @kylebebak in https://github.com/koxudaxi/datamodel-code-generator/pull/1453Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.2...0.21.3
Pre-commit-hooks by @yehoshuadimarsky in https://github.com/koxudaxi/datamodel-code-generator/pull/1416
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.1...0.21.2
Relax version constraint of prance by @tetsuok in https://github.com/koxudaxi/datamodel-code-generator/pull/1409
None by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1411Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.21.0...0.21.1
Pydantic v2 is a major release with many breaking changes. See the migration guide for more information: https://docs.pydantic.dev/2.0/migration/
datamodel-code-generator supports Pydantic v1 and v2 as output model type.
Pydantic v2 is a major release with many breaking changes. See the migration guide for more information: https://docs.pydantic.dev/2.0/migration/
__root__ field (a.k.a Custom Root Types)__root__ field (a.k.a Custom Root Types) is removed in pydantic v2.
The model is changed to RootModel
https://docs.pydantic.dev/2.0/migration/#changes-to-pydanticfield
typing.Set. this feature is discussed in https://github.com/pydantic/pydantic-core/issues/296pydantic.Config -> pydantic.ConfigDictFull Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.20.0...0.21.0
Update documentation by @noddycode in https://github.com/koxudaxi/datamodel-code-generator/pull/1316
openapi-spec-validator to 0.5.2 by @Fokko in https://github.com/koxudaxi/datamodel-code-generator/pull/1343Due to differences in file loading order between operating systems, we've added a sorting process when fetching file listings within directories in order to eliminate discrepancies in model and field names. As a result, model names that differ from those generated by existing earlier versions may be produced.
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.19.0...0.20.0
Import Annotated from typing_extensions for Python <= 3.8 by @airwoodix in https://github.com/koxudaxi/datamodel-code-generator/pull/1274
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.18.1...0.19.0
default_factory field should be non-optional by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1254
py.typed to mark project as typed by @KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1259Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.18.0...0.18.1
Update __all__ to expose needed types by @ShaneMurphy2 in https://github.com/koxudaxi/datamodel-code-generator/pull/1230
--input-file-type is auto. by @KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1248--input-file-type is auto by @KotlinIsland in https://github.com/koxudaxi/datamodel-code-generator/pull/1249Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.17.2...0.18.0
Remove union operator error when target-python is 3.9 or early version by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1094
docuemnt -> document by @kamyar in https://github.com/koxudaxi/datamodel-code-generator/pull/1179Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.17.1...0.17.2
Change custom template dir structure by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1070
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.17.0...0.17.1
Add --keep-model-order by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1043
--keep-model-order by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1043discriminator by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1045patternProperties by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1046default_factory by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1047--field-extra-keys-without-x-prefix by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/1066Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.16.1...0.17.0
Change default value to None by @JensHeinrich in https://github.com/koxudaxi/datamodel-code-generator/pull/1028
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.16.0...0.16.1
Fix the order of the model having multiple base_class by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/995
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.15.0...0.16.0
The release has some improvements in model generation. The generated model names or the structure will be changed.
The release has some improvements in model generation. The generated model names or the structure will be changed.
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.14.1...0.15.0
Fix deprecation warnings around "copy_on_model_validation" by @Dominic-Walther in https://github.com/koxudaxi/datamodel-code-generator/pull/927
--allow-extra-fields by @fgebhart in https://github.com/koxudaxi/datamodel-code-generator/pull/949Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.14.0...0.14.1
Drop python3.6 support by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/887
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.5...0.14.0
Fix mro field on enum by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/891
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.4...0.13.5
Fix alias modular default enum member by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/888
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.3...0.13.4
Fix modular default enum member by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/876
| by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/884Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.2...0.13.3
Use default of $ref on enum by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/832
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.1...0.13.2
Added IPv4/IPv6Network support. by @ngaranko in https://github.com/koxudaxi/datamodel-code-generator/pull/789
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.13.0...0.13.1
Fix --snake-case-field breaks class_name by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/777
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.12.3...0.13.0
Support --original-field-name-delimiter option by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/776
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.12.2...0.12.3
Support subclass enum by @koxudaxi in https://github.com/koxudaxi/datamodel-code-generator/pull/771
Full Changelog: https://github.com/koxudaxi/datamodel-code-generator/compare/0.12.1...0.12.2
One column per quarter.