CodeVetter · Repo Unpack · System map
pydantic/pydantic
This checkout is a library workspace with Python and native-extension boundaries. The Python package constructs schemas and exposes developer APIs; pydantic-core compiles schema descriptions into Rust validator and serializer objects. Model state belongs to Python instances, while compiled schemas belong to classes or adapters. Packaging, documentation publication, and ecosystem checks are handled by repository tooling and GitHub Actions.
- The package entrypoint checks core compatibility immediately, then lazily resolves public attributes through _dynamic_imports and caches exports from the imported module.
- ModelMetaclass collects configuration and decorators, builds fields, and either installs deferred mocks or calls complete_model_class.
- Core schemas are dictionaries with supported type tags; GenerateSchema produces them, and Rust build_validator_inner dispatches their type to concrete validator builders.
- The _pydantic_core PyO3 module exports SchemaValidator, SchemaSerializer, JSON helpers, URL types, and structured errors; module initialization also exposes build information and the recursion limit.
- The root package requires Python >=3.10, uses Hatchling, and pins pydantic-core==2.49.0; uv resolves that dependency from the local workspace member.
- The core uses Maturin with module name pydantic_core._pydantic_core; Cargo builds cdylib/rlib artifacts with Rust edition 2024 and minimum Rust 1.88.
- The inspected storage boundary is caller-owned: model state consists of __dict__, extras, explicit-field tracking, and private attributes; dumps return values rather than writing application records.
- Makefile defines lint, typecheck, test, benchmark, and documentation commands; tag-gated CI publishes core before Pydantic, while documentation jobs publish dev/latest versions and upload Algolia search data.