Generated models
The file pylegifrance/models/generated/model.py is auto-generated by
datamodel-codegen
from the schema pylegifrance/models/generated/legifrance.json.
Regenerate
Section titled “Regenerate”uv run datamodel-codegen \ --input pylegifrance/models/generated/legifrance.json \ --output pylegifrance/models/generated/model.pyConfig lives in pyproject.toml under [tool.datamodel-codegen].
Role in the architecture
Section titled “Role in the architecture”- The JSON Schema (
legifrance.json) is the source of truth for the exchange shapes with the API. model.pyprovides the matching Pydantic v2 DTOs.- The domain models (
models/<fond>/) consume and wrap these DTOs — see/en/concepts/fond-facadeand/en/concepts/enum-wrapping.