pydantic
Installation
SKILL.md
Pydantic v2
Pydantic v2 is the standard library for data validation, serialization, and settings management in Python. It uses type annotations to define data schemas and validates data at runtime with a high-performance Rust core.
Model Basics
Define models by subclassing BaseModel. Use standard type annotations for fields and Field() for metadata and constraints.
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field