Backend Data Modelling

Enforce Pydantic model conventions with DTO patterns and field validation.

Updated Apr 2, 2025
One-click install
npx skills add https://github.com/mazerunner70/housef3 --skill backend-data-modelling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Backend Data Modelling
Source: https://github.com/mazerunner70/housef3/tree/main/.agent/skills/backend-data-modelling
Command: npx skills add https://github.com/mazerunner70/housef3 --skill backend-data-modelling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill establishes clear conventions for Pydantic models, ensuring data integrity, consistent API contracts, and efficient data handling in backend systems.

Core Features & Use Cases

  • DTO Pattern Enforcement: Guides the separation of database models, creation DTOs, and update DTOs.
  • Field Validation Standards: Enforces snake_case for internal fields with camelCase aliases, and mandates integer timestamps for dates.
  • Enum Handling: Provides strategies for robust enum validation against various input types.
  • Use Case: Ensure all new API endpoints adhere to a strict data modeling standard, preventing common errors related to data types, naming conventions, and optional fields.

Quick Start

Follow the conventions outlined in this skill for defining new Pydantic models.

Frequently Asked Questions about Backend Data Modelling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize Pydantic models for robust backend APIs?

To standardize Pydantic models for robust APIs, enforce DTO patterns separating database models from creation and update DTOs, apply snake_case fields with camelCase aliases, and represent dates as integer timestamps.

What is the DTO pattern for separating database models in Pydantic?

The DTO pattern in Pydantic separates database models from creation DTOs and update DTOs, ensuring data integrity and consistent API contracts by isolating internal data structures from external API inputs.

How do I handle snake_case and camelCase field validation in Pydantic?

Handle snake_case and camelCase field validation by enforcing snake_case for internal Pydantic fields while configuring camelCase aliases, ensuring consistent data handling across API boundaries.

Does Pydantic support enum preservation and model update patterns?

Yes, Pydantic supports enum preservation by validating against various input types, and provides model update patterns to facilitate robust data handling and modifications for backend systems.

When do I need integer timestamps instead of datetime objects in API models?

You need integer timestamps in API models when enforcing strict data modeling standards for backend systems, mandating integer representation for dates to ensure consistent data handling and prevent type-related errors.