Registry / serialization / griffe-pydantic

griffe-pydantic

JSON →
library1.3.1pypypi✓ verified 83d ago

Griffe extension that extracts Pydantic models, fields, validators, and configurations from Python source code for documentation generation. Current version: 1.3.1. Released under MIT license with regular updates.

pip install griffe-pydantic
INSTALL
IMPORT
SIG · GRIFFE-PYDANTIC
G
griffe-pydantic
serializationpythonv1.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PydanticExtension
from griffe_pydantic import PydanticExtension
from griffe_pydantic import GriffePydanticExtension

Load a package and extract Pydantic models with the extension.

import griffe from griffe_pydantic import GriffePydanticExtension ext = GriffePydanticExtension() loader = griffe.load('my_package', extensions=[ext]) for model in loader.modules['my_package'].classes: print(model.name, model.lines)
griffe --version
Debug
Known issues
breakingAs of griffe-pydantic 1.3.0, the dependency changed from 'griffe' to 'griffelib' (griffe 1.x). Existing installations must be updated to use griffelib.
fix
pip install griffelib; ensure griffe-pydantic>=1.3.0 and griffelib (not griffe) are installed.
affects: >=1.3.0
deprecatedThe logger name was changed to 'griffe_pydantic' in 1.1.5; the old logger name may still work but is deprecated.
fix
Use the logger named 'griffe_pydantic' instead.
affects: <1.1.5
gotchaProperties in Pydantic models are not processed as fields (since 1.1.4). If you rely on properties being documented as fields, update your model design or use @property explicitly for other behavior.
fix
Use Field() or class attributes for fields; do not expect @property to be treated as a model field.
affects: >=1.1.4
Upgrade
Version history
1.3.1latest on PyPI · released Feb 20, 2026
Audit
Dependencies
griffelibrequiredCore dependency as of 1.3.0; replaces griffe
pydanticrequiredRequired as the extension processes Pydantic models
Agent activity
8 hits · last 30 days
node
8
Resources
griffe-pydantic — pip install griffe-pydantic · libregistry