Python documentation libraries

Updated Nov 2026

Python documentation libraries generate documentation websites and API references from Markdown, reStructuredText, and source code. An API generator imports or parses each module and renders its docstrings and type annotations as reference pages. These libraries let open-source projects and internal teams publish documentation that stays in step with their code.

Popularity

Sphinx has the most monthly downloads in this comparison, at 20.3M.

LibraryMonthly downloadsStarsLast releaseLicense
Sphinx
20.3M
8.1KOct 2026BSD-2-Clause
MkDocs
18.6M
22.6KAug 2024BSD-2-Clause
mkdocstrings
8.0M
2.1KOct 2026ISC
pdoc
1.1M
2.5KOct 2025MIT-0
Sphinx AutoAPI
597.3K
497Oct 2026MIT
Jupyter Book
353.6K
4.3KSep 2026BSD-3-Clause
pdoc3
194.8K
1.2KMar 2025AGPL-3.0
Pydoc-Markdown
165.2K
503Jun 2023MIT
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Generates Python documentation.

Downloads / mo
20.3M
Stars
8.1K
Last release
9.2.0
License
BSD-2-Clause

Quickstart

From quickstart.html
$ pip install sphinx
from pathlib import Path
import subprocess

Path('docs').mkdir(exist_ok=True)
Path('docs/conf.py').write_text("project = 'Example'\n")
Path('docs/index.rst').write_text('Example\n=======\n\nHello.\n')
subprocess.run(['sphinx-build', '-b', 'html', 'docs', 'site'], check=True)

Builds static project documentation sites from Markdown and YAML configuration.

Downloads / mo
18.6M
Stars
22.6K
Last release
1.6.1
License
BSD-2-Clause

Strengths

  • Builds sites from Markdown. Keep pages in Markdown and site settings in one YAML file.
  • Produces portable static sites. Host the generated files anywhere that serves static content.

Limitations

  • Automatic API pages need plugins. Add mkdocstrings to generate references from Python source.
  • Unlisted pages miss global navigation. Add pages to nav for global and previous/next links.

Quickstart

From getting-started.md
$ pip install mkdocs
import subprocess

subprocess.run(['mkdocs', 'new', 'example'], check=True)
subprocess.run(['mkdocs', 'build'], cwd='example', check=True)

MkDocs examples

From open-source projects on GitHub

Generates documentation from source code for MkDocs.

Downloads / mo
8.0M
Stars
2.1K
Last release
1.0.8
License
ISC

Quickstart

From index.html
$ pip install mkdocstrings[python]
from pathlib import Path
import subprocess

Path('docs').mkdir(exist_ok=True)
Path('demo.py').write_text('\"\"\"Example API.\"\"\"\nVALUE = 1\n')
Path('docs/index.md').write_text('# API\n\n::: demo\n')
Path('mkdocs.yml').write_text('site_name: Example\nplugins:\n  - mkdocstrings:\n      handlers:\n        python:\n          paths: [.]\n')
subprocess.run(['mkdocs', 'build'], check=True)

mkdocstrings examples

From open-source projects on GitHub

Generates Python API reference pages from modules, docstrings, and type annotations.

Downloads / mo
1.1M
Stars
2.5K
Last release
16.0.0
License
MIT-0

Strengths

  • Uses Markdown inside docstrings. Write API descriptions with Markdown formatting.
  • Links documented identifiers automatically. Build related modules together to link their API references.

Limitations

  • Imports modules while building. Module-level code runs while API pages are generated.
  • Generates HTML output only. Choose another generator when a project needs output other than HTML.

Quickstart

From README.md
$ pip install pdoc
from pathlib import Path
import pdoc

pdoc.pdoc('json', output_directory=Path('html'))

Sphinx AutoAPI

Generates API documentation inside Sphinx.

Downloads / mo
597.3K
Stars
497
Last release
3.9.0
License
MIT

Quickstart

From README.rst
$ pip install sphinx-autoapi
from pathlib import Path
import subprocess

Path('src').mkdir(exist_ok=True)
Path('src/demo.py').write_text('\"\"\"Example API.\"\"\"\nVALUE = 1\n')
Path('docs').mkdir(exist_ok=True)
Path('docs/conf.py').write_text("extensions = ['autoapi.extension']\nautoapi_dirs = ['../src']\n")
Path('docs/index.rst').write_text('Example\n=======\n')
subprocess.run(['sphinx-build', '-b', 'html', 'docs', 'site'], check=True)

Jupyter Book

Creates reusable, reproducible, and interactive computational narratives.

Downloads / mo
353.6K
Stars
4.3K
Last release
2.1.7
License
BSD-3-Clause

Quickstart

From index.html
$ pip install jupyter-book
from pathlib import Path
import subprocess

Path('index.md').write_text('# Example\n\nHello.\n')
Path('myst.yml').write_text('version: 1\nproject:\n  title: Example\nsite:\n  template: book-theme\n')
subprocess.run(['jupyter', 'book', 'build', '--html'], check=True)

Generates API documentation for Python projects.

Downloads / mo
194.8K
Stars
1.2K
Last release
0.11.6
License
AGPL-3.0

Quickstart

From __init__.py
$ pip install pdoc3
from pathlib import Path
import pdoc

Path('json-api.html').write_text(pdoc.html('json'), encoding='utf-8')

pdoc3 examples

From open-source projects on GitHub

Pydoc-Markdown

Creates Python API documentation in Markdown format.

Downloads / mo
165.2K
Stars
503
Last release
4.8.2
License
MIT

Quickstart

From __init__.py
$ pip install pydoc-markdown
from pathlib import Path
from pydoc_markdown import PydocMarkdown
from pydoc_markdown.contrib.loaders.python import PythonLoader
from pydoc_markdown.contrib.renderers.markdown import MarkdownRenderer

Path('demo.py').write_text('\"\"\"Example API.\"\"\"\nVALUE = 1\n')
docs = PydocMarkdown(loaders=[PythonLoader(search_path=['.'], modules=['demo'])],
                     renderer=MarkdownRenderer(filename='api.md'))
modules = docs.load_modules()
docs.process(modules)
docs.render(modules)

FAQ

Sphinx suits large projects that need its extension and cross-reference ecosystem. MkDocs suits project sites written in Markdown, with mkdocstrings for API pages. pdoc suits a quick API reference generated straight from modules.

MkDocs builds static documentation sites from Markdown files and a YAML configuration. Themes and plugins extend each site.

Sphinx is a documentation generator with a native ecosystem of extensions and domains. Its autodoc extension pulls API documentation from docstrings.

MkDocs writes pages in Markdown and adds API pages through mkdocstrings. Sphinx writes pages in reStructuredText or Markdown through extensions and offers a larger extension ecosystem.

Jupyter Book builds reusable, reproducible, and interactive computational narratives from MyST documents and notebooks.

For coding agents

Found your documentation library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official