--- id: autodoc-pydantic version: "2.2.0" license: MIT license_treatment: permissive maintenance: active --- # autodoc_pydantic — Seamlessly integrate pydantic models in your Sphinx documentation. License: permissive · Maintenance: active · Downloads: 406.5K/mo ## What it is and what it does autodoc_pydantic is a Sphinx extension that bridges the gap between pydantic model definitions and Sphinx's autodoc system. When you use Sphinx to auto-document Python code containing pydantic models, autodoc normally struggles to extract and display pydantic-specific metadata like field defaults, aliases, and validation constraints. This extension teaches Sphinx how to recognize and render that metadata, so your generated documentation includes the full picture of what each model field expects. The extension integrates natively with Sphinx's autodoc and autosummary extensions, requires only four runtime dependencies (Sphinx, pydantic, pydantic-settings, importlib-metadata), and supports pydantic versions from 1.5.0 onward. It's actively maintained and has been in use since early 2021, with a permissive MIT license. Use it for: - Auto-generate API documentation for FastAPI or other frameworks that use pydantic models for request/response schemas. - Document configuration classes built with pydantic-settings so users see all valid fields and their constraints in one place. - Include collapsible JSON schema representations of pydantic models directly in your Sphinx docs. - Maintain hyperlinks between pydantic validators and the fields they validate within generated documentation. - Visualize class hierarchies and entity-relationship diagrams for pydantic model inheritance in your docs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sphinx extension that automatically generates documentation for pydantic models and settings, integrating pydantic's field metadata (defaults, aliases, constraints) directly into Sphinx autodoc output. Yes. The package solves a real friction point—Sphinx's autodoc does not natively understand pydantic metadata—with a well-maintained, low-friction extension. Active development, no known vulnerabilities, permissive license, and broad pydantic version support make it a safe choice for any project using pydantic models and Sphinx documentation. ## Install pip install autodoc-pydantic uv add autodoc-pydantic poetry add autodoc-pydantic ## Installing autodoc_pydantic Before you install: Low friction install with four straightforward runtime dependencies (Sphinx, pydantic, pydantic-settings, importlib-metadata). Active maintenance as of 2026-08-12 with 181 repository stars. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install autodoc_pydantic # In conf.py, add to extensions: extensions = ['autodoc_pydantic'] # Then use standard Sphinx autodoc on pydantic models: # .. automodel:: mymodule.MyModel Requires Sphinx >= 4.0.0 and pydantic >= 1.5.0; Python >= 3.8.1, < 4.0.0. Verify before relying: - Whether the package supports pydantic v2 models with the same feature completeness as v1 models, given the v2 classifier. - Performance impact when documenting large numbers of pydantic models or deeply nested schemas. - Compatibility with recent Sphinx versions beyond what the classifiers declare. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 406.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pydantic sphinx documentation, autodoc pydantic models, sphinx pydantic extension, generate docs from pydantic, pydantic model documentation, sphinx autodoc pydantic, pydantic settings documentation, sphinx-extension, pydantic-integration, api-documentation [View on SkillFed](https://skillfed.io/packages/autodoc-pydantic) · [View on PyPI](https://pypi.org/project/autodoc-pydantic/)