mkdocstrings-python-legacy
A legacy Python handler for mkdocstrings.
What it is and what it does
mkdocstrings-python-legacy is a plugin handler that integrates Python API documentation generation into MkDocs sites. It uses pytkdocs to extract object trees and docstrings from Python source code, then renders them as Markdown with support for Google, Numpydoc, and Sphinx docstring styles. It displays type annotations, recursive module documentation, documented attributes, and source code listings, with each object appearing as a navigable heading in the table of contents.
This is a legacy package—the project recommends using the newer mkdocstrings-python handler instead. It remains available for projects with existing configurations or specific compatibility needs. The package depends on mkdocstrings, mkdocs-autorefs, and pytkdocs, and supports Python 3.9 through 3.14.
Use it for:
- Maintaining existing MkDocs documentation sites that were built with the legacy Python handler and do not require migration.
- Generating API reference documentation from Python docstrings without manually writing Markdown files.
- Displaying type hints and function signatures alongside docstrings in auto-generated documentation.
- Converting Google-style or Numpydoc-style docstrings into admonitions and formatted Markdown.
- Building a searchable table of contents for Python module and class documentation in Material theme sites.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A legacy Python documentation handler for mkdocstrings that extracts and renders API documentation from Python source code, docstrings, and type annotations into MkDocs sites.
Yes, if you are maintaining an existing MkDocs site already using this handler and do not need to migrate. No, if you are starting a new documentation project—use the recommended newer mkdocstrings-python handler instead. The legacy package is stable and permissively licensed, but aging (449 days since last release) and explicitly superseded; install only for backward compatibility.
Install
mkdocstrings-python-legacy on PyPI
pip
pip install mkdocstrings-python-legacyuv
uv add mkdocstrings-python-legacypoetry
poetry add mkdocstrings-python-legacyInstalling mkdocstrings-python-legacy
Before you install
Low install friction with a pure-Python wheel. Maintenance is aging—last release was 449 days ago and the repository has only 3 stars—but the codebase remains active (last commit 2026-01-13) and the package is explicitly marked as legacy in favor of a newer handler.
License in practice
ISC license is permissive and poses no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
# Install via mkdocstrings extra or directly
pip install mkdocstrings[python-legacy]
# or
pip install mkdocstrings-python-legacy
# In mkdocs.yml, configure the handler
plugins:
- mkdocstrings:
handlers:
python:
handler: python-legacy
Requires mkdocstrings >=0.18 and Python >=3.9; intended as a fallback for projects already using the legacy handler.
Verify before relying
- Whether the legacy handler remains compatible with the latest mkdocstrings releases and MkDocs Material theme.
- Performance and feature parity compared to the recommended newer mkdocstrings-python handler.
- Active maintenance timeline and whether critical bug fixes are still applied.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — mkdocstrings, mkdocs-autorefs, pytkdocs |
| Maintenance | aging — 449 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 228,741/month — #9,147 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mkdocstrings_python_legacy-0.2.7-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
mkdocstringsAn MkDocs plugin that automatically generates…
permissive · top 5,000 on PyPI
mkdocstrings-pythonGenerates API documentation for Python projects…
permissive · top 5,000 on PyPI
pytkdocsExtracts and serializes Python object…
permissive · top 15,000 on PyPI
mkdocs-api-autonavAutomatically generates API reference…
permissive · top 15,000 on PyPI
haystack-pydoc-toolsGenerates Docusaurus-compatible Markdown API…
permissive · top 15,000 on PyPI
mkdocs-github-admonitions-pluginA MkDocs plugin that converts GitHub-flavored…
permissive · top 15,000 on PyPI
docrepDocrep provides utilities to intelligently…
permissive · top 15,000 on PyPI
pdoc3Generates API documentation for Python 3+…
agpl · top 15,000 on PyPI
mkdocs-techdocs-coreBundles Spotify's TechDocs defaults—themes,…
permissive · top 15,000 on PyPI
griffe-typingdocGriffe extension that enables inline…
permissive · top 15,000 on PyPI