skillfed

mkdocstrings-python

A Python handler for mkdocstrings.

mkdocstrings-python v2.0.5 12.1M downloads/30d#1,344 on PyPI278
Permissive license ISC Active released

What it is and what it does

mkdocstrings-python is a handler that extends mkdocstrings to automatically generate API documentation from Python source code. It uses griffelib to parse the Abstract Syntax Tree (AST) of your code, extract docstrings, and collect type annotations, then renders them as searchable HTML documentation integrated into your MkDocs site.

The handler supports multiple docstring styles, automatically generates cross-references to other objects in your API, and can display source code inline. You reference Python modules by their dotted path in your documentation, and the handler recursively documents all classes, functions, and attributes without requiring manual entries for each one.

Use it for:

  • Generate complete API reference documentation for a Python library automatically from docstrings and type hints.
  • Create searchable, cross-referenced documentation that links parameter types to their definitions across your codebase.
  • Build documentation sites that stay in sync with source code changes without manual updates to API docs.
  • Display inline source code for functions and classes alongside their documentation for developer reference.
  • Support teams maintaining multiple Python packages by reusing the same documentation pipeline across projects.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates API documentation for Python projects by parsing source code and docstrings, integrating with mkdocstrings to produce searchable, cross-referenced documentation.

Yes. The package is actively maintained, has low install friction, carries a permissive ISC license, and solves a real problem—keeping API documentation synchronized with source code. It has no known vulnerabilities and is well-positioned in the top 5000 PyPI packages. Install it if you use mkdocstrings and want to document Python code automatically.

Install

mkdocstrings-python on PyPI

pip

pip install mkdocstrings-python

uv

uv add mkdocstrings-python

poetry

poetry add mkdocstrings-python

Installing mkdocstrings-python

Before you install

Low friction install with 4 runtime dependencies; actively maintained with recent release (56 days ago) and ongoing commits.

License in practice

ISC license is permissive, allowing use in proprietary and open-source projects with minimal restrictions.

Quickstart

pip install mkdocstrings-python

import mkdocstrings
# In mkdocs.yml, configure the Python handler and reference modules by dotted path:
# ::: mypackage.mymodule

Requires Python 3.10 or later; mkdocstrings must be installed and configured in your MkDocs project.

Verify before relying

  • Performance characteristics when documenting very large Python codebases with hundreds of modules.
  • Compatibility with popular MkDocs themes and recent versions of mkdocs-autorefs.
  • Whether all three docstring styles (Google, NumPy, Sphinx) are equally well supported or have known limitations.

Package facts

License ISC (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — mkdocstrings, mkdocs-autorefs, griffelib, typing-extensions
Maintenance actively maintained — 56 days since the last release
Last repo commit
First released
Downloads 12,088,218/month — #1,344 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mkdocstrings_python-2.0.5-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: DocumentationTopic :: Software DevelopmentTopic :: Software Development :: DocumentationTopic :: UtilitiesTyping :: Typed

Tags

python api documentation generatormkdocstrings python handlerauto-generate python docsdocstring to html documentationpython source code documentationgriffe ast parser documentationmkdocs python api docs
documentation-generationapi-docsmkdocs-plugin

More Software Development packages