Pydantic
Python data validation library using type hints. The backbone of FastAPI, LLM structured output, and a lot of modern Python codebases.
Infrastructure Beginner
Category
Infrastructure
Difficulty
Beginner
When to use
Validating or serializing structured data in Python — API payloads, configuration, LLM outputs, anything with a schema.
When not to use
Hot inner loops where validation overhead matters and the data is already trusted.
Alternatives
dataclasses attrs marshmallow msgspec