Pydantic lets you describe expected data shapes with standard Python type hints and validate inputs against those models. It aims to stay fast, extensible, and comfortable in editors and with linters.
Overview
Pydantic Validation is a Python library for checking that data matches structures you express with type hints. You define how values should look in ordinary Python, then run validation through Pydantic models instead of hand-written checks scattered through your code.
The project emphasizes speed and extension points, and is meant to fit alongside typical linting and IDE workflows. Recent major work centers on Pydantic V2, described as a full rewrite that adds features and performance gains along with some breaking changes from V1. Teams on older code can still reach V1 behaviors via a compatibility import path while they migrate.
Install the package with standard Python packaging tools such as pip or conda, as documented in the project materials. Optional install paths are noted for users who want additional performance-related setups.
The broader Pydantic organization also offers separate products for AI observability, agents, and evaluation, but the core open-source validation library remains the widely used piece for typed model validation in Python applications.
Key features
- Validation driven by Python type hints
- Fast, extensible validation core
- Editor and linter friendly models
- JSON Schema related validation support
- V2 rewrite with V1 compatibility import
- pip and conda installation paths
- Data validation driven by Python type hints
Use cases
- Parsing API request and response payloads
- Configuration and settings objects
- Structured data before business logic
- Shared schemas between Python services