# pydantic

> Data validation using Python type hints

- **URL**: https://www.freshcrate.ai/projects/pydantic
- **Author**: pypi
- **Category**: Frameworks
- **Latest version**: `2.13.3` (2026-04-21)
- **License**: Unknown
- **Source**: https://github.com/sponsors/samuelcolvin
- **Homepage**: https://pypi.org/project/pydantic/
- **Language**: Python
- **Registry**: pypi (`pydantic`)
- **Tags**: `pypi`

## Description

# Pydantic Validation

[![CI](https://img.shields.io/github/actions/workflow/status/pydantic/pydantic/ci.yml?branch=main&logo=github&label=CI)](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)
[![llms.txt](https://img.shields.io/badge/llms.txt-green)](https://docs.pydantic.dev/latest/llms.txt)

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.9+; validate it with Pydantic.

## Pydantic Logfire :fire:

We've launched Pydantic Logfire to help you monitor your applications.
[Learn more](https://pydantic.dev/logfire/?utm_source=pydantic_validation)

## 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

```python
from datetime import datetime
from typing import Optional
from pydantic import BaseModel

class 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).

## Changelog

<!-- markdownlint-disable no-bare-urls -->
<!-- markdownlint-disable descriptive-link-text -->
<!-- markdownlint-disable-next-line first-line-heading -->

## v2.13.3 (2026-04-20)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.13.3)

### What's Changed

#### Fixes

* Handle `AttributeError` subclasses with `from_attributes` by [@Viicos](https://github.com/Viicos) in [#13096](https://github.com/pydantic/pydantic/pull/13096)

## v2.13.2 (2026-04-17)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.13.2)

### What's Changed

#### Fixes

* Fix `ValidationInfo.field_name` missing with `model_validate_json()` by [@Viicos](https://github.com/Viicos) in [#13084](https://github.com/pydantic/pydantic/pull/13084)

## v2.13.1 (2026-04-15)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.13.1)

### What's Changed

#### Fixes

* Fix `ValidationInfo.data` missing with `model_validate_json()` by [@davidhewitt](https://github.com/davidhewitt) in [#13079](https://github.com/pydantic/pydantic/pull/13079)

## v2.13.0 (2026-04-13)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.13.0)

The highlights of the v2.13 release are available in the [blog post](https://pydantic.dev/articles/pydantic-v2-13-release).
Several minor changes (considered non-breaking changes according to our [versioning policy](https://pydantic.dev/docs/validation/2.13/get-started/version-policy/#pydantic-v2))
are also included in this release. Make sure to look into them before upgrading.

This release contains the updated `pydantic.v1` namespace, matching version 1.10.26 which includes support for Python 3.14.

### What's

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `2.13.3` | 2026-04-21 | Low | Imported from PyPI (2.13.3) |

## Citation

- HTML: https://www.freshcrate.ai/projects/pydantic
- Markdown: https://www.freshcrate.ai/projects/pydantic.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/pydantic/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
