pydantic
Installation
SKILL.md
Pydantic v2 Best Practices
Pydantic is the most widely used data validation library for Python. This skill covers idiomatic patterns, common pitfalls, and performance guidance for Pydantic v2 (the current major version).
Models
Define models by inheriting from BaseModel
from pydantic import BaseModel, ConfigDict
class User(BaseModel):
model_config = ConfigDict(str_strip_whitespace=True, extra='forbid')
id: int
name: str
email: str | None = None