Skip to content

Generated models

The file pylegifrance/models/generated/model.py is auto-generated by datamodel-codegen from the schema pylegifrance/models/generated/legifrance.json.

Fenêtre de terminal
uv run datamodel-codegen \
--input pylegifrance/models/generated/legifrance.json \
--output pylegifrance/models/generated/model.py

Config lives in pyproject.toml under [tool.datamodel-codegen].

  • The JSON Schema (legifrance.json) is the source of truth for the exchange shapes with the API.
  • model.py provides the matching Pydantic v2 DTOs.
  • The domain models (models/<fond>/) consume and wrap these DTOs — see /en/concepts/fond-facade and /en/concepts/enum-wrapping.