Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pydantic/pydantic
Data validation using Python type hints
https://github.com/pydantic/pydantic
hints json-schema parsing pydantic python python310 python311 python312 python37 python38 python39 validation
Last synced: about 1 month ago
JSON representation
Data validation using Python type hints
- Host: GitHub
- URL: https://github.com/pydantic/pydantic
- Owner: pydantic
- License: mit
- Created: 2017-05-03T21:23:58.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T20:48:51.000Z (about 1 month ago)
- Last Synced: 2024-04-27T21:07:54.193Z (about 1 month ago)
- Topics: hints, json-schema, parsing, pydantic, python, python310, python311, python312, python37, python38, python39, validation
- Language: Python
- Homepage: https://docs.pydantic.dev
- Size: 103 MB
- Stars: 18,652
- Watchers: 113
- Forks: 1,643
- Open Issues: 388
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: docs/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Citation: CITATION.cff
Lists
- awesome-python-typing - pydantic - Data parsing using Python type hinting. Supports dataclasses. (Dynamic type checkers)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data parsing and validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data parsing and validation using Python type hints (Python)
- awesome-stars - pydantic
- awesome-stars - pydantic/pydantic
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- best-of-python - GitHub - 9% open · ⏱️ 22.05.2024): (Data Validation)
- awesome-starred-test - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-repositories - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- my-awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- my-awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- my-awesome-github-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic
- awesome-stars - pydantic
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- my-awesome - pydantic/pydantic - Data validation using Python type hints (Python)
- docsify-awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- artsz-awesome - pydantic/pydantic - Data parsing and validation using Python type hints (Python)
- awesome-ccamel - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-starts - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-from-stars - pydantic/pydantic
- my-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- jimsghstars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (python)
- awesome-list - pydantic - Data parsing and validation using Python type hints. (Data Processing / Data Representation)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (Python)
- awesome-llm-json - Pydantic
- awesome-python - pydantic - Data validation using Python type hints. (Data Validation)
- awesome-stars - pydantic/pydantic - Data validation using Python type hints (python)
README
# Pydantic
[![CI](https://github.com/pydantic/pydantic/workflows/CI/badge.svg?event=push)](https://github.com/pydantic/pydantic/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![Coverage](https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/pydantic/pydantic)
[![pypi](https://img.shields.io/pypi/v/pydantic.svg)](https://pypi.python.org/pypi/pydantic)
[![CondaForge](https://img.shields.io/conda/v/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic)
[![downloads](https://static.pepy.tech/badge/pydantic/month)](https://pepy.tech/project/pydantic)
[![versions](https://img.shields.io/pypi/pyversions/pydantic.svg)](https://github.com/pydantic/pydantic)
[![license](https://img.shields.io/github/license/pydantic/pydantic.svg)](https://github.com/pydantic/pydantic/blob/main/LICENSE)
[![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://docs.pydantic.dev/latest/contributing/#badges)Data validation using Python type hints.
Fast and extensible, Pydantic plays nicely with your linters/IDE/brain.
Define how data should be in pure, canonical Python 3.8+; validate it with Pydantic.## Pydantic Company :rocket:
We've started a company based on the principles that I believe have led to Pydantic's success.
Learning more from the [Company Announcement](https://pydantic.dev/announcement/).## Pydantic V1.10 vs. V2
Pydantic V2 is a ground-up rewrite that offers many new features, performance improvements, and some breaking changes compared to Pydantic V1.
If you're using Pydantic V1 you may want to look at the
[pydantic V1.10 Documentation](https://docs.pydantic.dev/) or,
[`1.10.X-fixes` git branch](https://github.com/pydantic/pydantic/tree/1.10.X-fixes). Pydantic V2 also ships with the latest version of Pydantic V1 built in so that you can incrementally upgrade your code base and projects: `from pydantic import v1 as pydantic_v1`.## Help
See [documentation](https://docs.pydantic.dev/) for more details.
## Installation
Install using `pip install -U pydantic` or `conda install pydantic -c conda-forge`.
For more installation options to make Pydantic even faster,
see the [Install](https://docs.pydantic.dev/install/) section in the documentation.## A Simple Example
```py
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModelclass User(BaseModel):
id: int
name: str = 'John Doe'
signup_ts: Optional[datetime] = None
friends: List[int] = []external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
print(user)
#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
print(user.id)
#> 123
```## Contributing
For guidance on setting up a development environment and how to make a
contribution to Pydantic, see
[Contributing to Pydantic](https://docs.pydantic.dev/contributing/).## Reporting a Security Vulnerability
See our [security policy](https://github.com/pydantic/pydantic/security/policy).