You love pydantic โค and you want to document your models and configuration settings with sphinx?
Perfect, let's go. But wait, sphinx' autodoc does not integrate too well with pydantic models ๐.
Don't worry - just pip install autodoc_pydantic
โบ.
Features
- ๐ฌ provides default values, alias and constraints for model fields
- ๐ adds hyperlinks between validators and corresponding fields
- ๐ includes collapsable model json schema
- ๐ natively integrates with autodoc and autosummary extensions
- ๐ defines explicit pydantic prefixes for models, settings, fields, validators and model config
- ๐ shows summary section for model configuration, fields and validators
- ๐ hides overloaded and redundant model class signature
- ๐ฑ visualizes entity-relationship-diagrams for class hierarchies
- ๐ Supports
pydantic >= 1.5.0
andsphinx >= 4.0.0
Documentation
For more details, please visit the official documentation:
Comparison between autodoc sphinx and autodoc pydantic
To see those features in action, jump over to the example documentation to compare the appearance of standard sphinx autodoc with autodoc_pydantic.
Acknowledgements
Thanks to great open source projects sphinx, pydantic and poetry (and so many more) โค in addition to the following contributors:
This project follows the all-contributors specification. Contributions of any kind welcome!