Learn Pydantic
Data validation and parsing for Python, driven by type hints
Pydantic validates and converts data using classes whose fields are ordinary Python type hints. You describe the shape of your data once and get parsing, clear error messages, serialization and JSON Schema from it. It is the validation layer behind FastAPI, many LLM SDKs and countless config loaders, and its v2 core is written in Rust.
Before you start
How deep do you want to go?
1. EssentialsRead and write simple code, do the everyday basics
2. PracticalUse it productively at work, with the usual idioms
3. AdvancedThe less common features, performance and trade-offs
4. ExpertInternals and the edge cases experts know