# Pydantic

Data validation using Python type hints

Repository: https://github.com/pydantic/pydantic
Canonical: https://ross.abutalabs.com/products/pydantic
Homepage: https://pydantic.dev/docs/validation
Language: Python
License: MIT
License Family: permissive
Topics: validation, parsing, json-schema, pydantic, python39, python, hints, python310, python311, python312, python313
Last push: 2026-08-26T19:16:36+00:00
Link (homepage): https://pydantic.dev/docs/validation
Link (site_page): https://pydantic.dev/docs
Link (site_page): https://pydantic.dev/docs/ai
Link (site_page): https://pydantic.dev/docs/logfire
Link (site_page): https://pydantic.dev/docs/httpx2/get-started

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 83, longevity 100
- inputs: {"age_days": 3409, "days_push": 7, "days_rel": 119, "gap_med": 7.5, "n_releases_24m": 37}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 28626, forks 2901 (observed 2026-08-28T04:11:52.738745+00:00)

## What it is
Pydantic is the most widely used data validation library for Python, defining schemas via type hints and validating, parsing, and serializing data with a Rust-powered core (pydantic-core). It also emits JSON Schema and supports strict/lax validation modes, dataclasses, and TypedDicts.

## Use cases
- validate api request payloads against python type hints
- parse untrusted json into typed models
- generate json schema from python classes
- serialize and deserialize dataclasses and typeddicts
- validate settings and environment configuration
- coerce string data into typed fields with lax mode
- enforce field constraints with annotated types

## When to choose
- you want schema validation driven by python type hints with ide and mypy integration
- you need fast validation - the core is written in rust
- you're building fastapi, sqlmodel, or langchain apps where pydantic is the standard
- you need json schema output for tool integration
- you want both strict and coercive (lax) validation modes

## When to avoid
- you need validation in a non-python language
- you're on python 3.8 or older
- you want zero compiled dependencies - pydantic-core ships rust binaries
- you're migrating a large v1 codebase without time to handle v2 breaking changes

## Facets
- artifact type: library
- maturity: stable
- function: serialization, parser, json, data-science
- domain: developer-tools, apis, web-development
- platform: python, cross-platform
- tags: data-validation, type-hints, json-schema, pydantic-core, rust, fastapi-ecosystem, schema-validation, parsing, data-engineering

## Member repositories
- pydantic/pydantic (main) score 94
- pydantic/pydantic-core (backend) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:52.738745+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:54:20.886979+00:00, confidence not recorded.
  - readme: https://github.com/pydantic/pydantic (fetched 2026-08-28T04:11:52.738745+00:00, sha e42c4364bdb7)
  - homepage: https://pydantic.dev/docs/validation (fetched 2026-08-29T07:50:52.108273+00:00, sha 45a18505182c)
  - site_page: https://pydantic.dev/docs (fetched 2026-08-29T07:50:52.117663+00:00, sha 8fbf5785f930)
  - site_page: https://pydantic.dev/docs/ai (fetched 2026-08-29T07:50:52.119712+00:00, sha 5a0acbe090de)
  - site_page: https://pydantic.dev/docs/logfire (fetched 2026-08-29T07:50:52.122086+00:00, sha 44d3778fd335)
  - site_page: https://pydantic.dev/docs/httpx2/get-started (fetched 2026-08-29T07:50:52.124147+00:00, sha 9e483eaace82)
  - site_page: https://pydantic.dev/docs/monty/get-started (fetched 2026-08-29T07:50:52.126158+00:00, sha 10df026bf6ec)
  - site_page: https://pydantic.dev/docs/validation/latest/get-started/why (fetched 2026-08-29T07:50:52.128023+00:00, sha a2b06a019519)
  - site_page: https://pydantic.dev/docs/validation/latest/get-started/help_with_pydantic (fetched 2026-08-29T07:50:52.130023+00:00, sha 4168e4d83159)
  - site_page: https://pydantic.dev/docs/validation/latest/get-started/install (fetched 2026-08-29T07:50:52.131713+00:00, sha 107902a90128)
- Data as of 2026-08-30T08:39:29.467469+00:00.
