A Python handler for mkdocstrings.
Actively maintained. Last release 3 weeks ago, commits in 9 of the last 26 weeks. A safe choice.
pip install mkdocstrings-pythonmkdocstrings-python
A Python handler for mkdocstrings.

The Python handler uses Griffe to collect documentation from Python source code. The word "griffe" can sometimes be used instead of "signature" in French. Griffe is able to visit the Abstract Syntax Tree (AST) of the source code to extract useful information. It is also able to execute the code (by importing it) and introspect objects in memory when source code is not available. Finally, it can parse docstrings following different styles.
Installation
You can install this handler as a mkdocstrings extra:
# PEP 621 dependencies declaration
# adapt to your dependencies manager
[project]
dependencies = [
"mkdocstrings[python]>=0.18",
]
You can also explicitly depend on the handler:
# PEP 621 dependencies declaration
# adapt to your dependencies manager
[project]
dependencies = [
"mkdocstrings-python",
]
Preview

Features
-
Data collection from source code: collection of the object-tree and the docstrings is done thanks to Griffe.
-
Support for type annotations: Griffe collects your type annotations and uses them to display parameter types or return types. It is even able to automatically add cross-references to other objects from your API, from the standard library or third-party libraries! See to enable it.
