Pydantic is a data validation library for Python.
Define how data should be in pure, canonical Python 3.7+; validate it with Pydantic.
This is free and open source software.
Key Features
- Type hints powering schema validation. The schema that Pydantic validates against is generally defined by Python type hints.
- Core validation logic is implemented in separate package pydantic-core, where validation for most types is implemented in Rust.
- Provides functionality to serialize model in three ways:
- To a Python dict made up of the associated Python objects.
- To a Python dict made up only of “jsonable” types.
- To a JSON string.
- JSON Schema can be generated for any Pydantic schema — allowing self-documenting APIs and integration with a wide variety of tools which support JSON Schema.
- Strict mode and data coercion.
- Provides four ways to create schemas and perform validation and serialization:
- BaseModel — Pydantic’s own super class with many common utilities available via instance methods.
- pydantic.dataclasses.dataclass – a wrapper around standard dataclasses which performs validation when a dataclass is initialized.
- TypeAdapter – a general way to adapt any type for validation and serialization. This allows types like TypedDict and NampedTuple to be validated as well as simple scalar values like int or timedelta – all types supported can be used with TypeAdapter.
- validate_call – a decorator to perform validation when calling a function.
- Customisation
Website: docs.pydantic.dev/latest
Support: GitHub Code Repository
Developer: Pydantic Services Inc. and individual contributors
License: MIT License
Pydantic is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Python Data Validation | |
|---|---|
| Pydantic | Data validation using Python type hints |
| pandera | Framework for precision data testing |
| jsonschema | Implementation of JSON Schema for Python |
| Cerberus | Lightweight and extensible data validation library |
| schema | Library for validating Python data structures |
| GX | Validating, documenting, and profiling data |
| marshmallow | ORM/ODM/framework-agnostic library |
| Voluptuous | Python data validation library |
| Schematics | Combine types into structures, validate , and transform the shapes of data |
| Colander | Serialization / deserialization / validation library |
| Valideer | Lightweight data validation and adaptation Python library |
| OpenRefine | Desktop program for data cleanup and transformation |
| Soda Core | Data quality and data contract verification engine |
| OpenMetadata | Unified metadata platform |
| Elementary OSS | dbt-native data observability command-line tool |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

