Intro to Pydantic, run-time type checking for your dataclasses
summary
Pydantic enforces runtime type checking for dataclasses and BaseModel classes so invalid inputs are rejected immediately and errors name the field and index that failed (example: ham rejected from a toppings tuple). It parses JSON back and forth and emits JSON Schema (Draft 7) for OpenAPI, supports custom root validators to encode business rules and a validate_arguments decorator for functions, plugs into FastAPI for automatic docs, and pairs with Hypothesis to generate tests.
AI-written summary · about
chapters (9)
- 0:00Intro
- 7:26runtime type checking
- 13:25JSON Schema
- 17:45validate arguments decorator
- 19:18pydantic frameworks
- 20:40automatic testing
- 21:44fast API
- 23:41conclusion
- 24:18outro
related talks
21mLet JSON Schema and Pydantic write your data models
28m"Validating Complex Types Using Pydantic"
22mPydantic Power-up: Performance Tips for Lightning-Fast Python Applications
27m"How to Use Static Typing in Python with Type Hints, MyPy and Pydantic"
32mHaving fun with pydantic and pattern matching
27mFrom Pydantic V1 to V2
31mStatic Type Analysis for Robust Data Products
18mIntro to FastAPI
