What problem does it solve?
Provide a consistent, testable pattern for defining Pydantic models that reduces duplication, enforces validation, and ensures stable API request/response and database document contracts across Python backends.
Core Features & Use Cases
- Multi-Model Pattern: Produces Base, Create, Update, Response, and InDB model variants to separate concerns for input validation, partial updates, API responses, and storage.
- Pydantic v2 Guidance: Uses modern v2 patterns such as model_config/ConfigDict, populate_by_name, from_attributes, and field_validator/model_validator for robust validation and aliasing.
- Database & Integration: Includes doc_type conventions for Cosmos DB partitioning and examples for exporting models and aligning TypeScript types for front-end contracts.
- Use Case: Ideal for backend engineers building REST/GraphQL endpoints that require precise input validation, consistent response shapes, and straightforward persistence mappings.
Quick Start
Create Pydantic models for a new resource by copying assets/template.py, replacing {{ResourceName}} and {{resource_name}} with your resource names, and adding the models to src/backend/app/models/.