# Python documentation libraries

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

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [Sphinx](#sphinx-library) | 20.3M | 8.1K | Oct 2026 | BSD-2-Clause |
| [MkDocs](#mkdocs) | 18.6M | 22.6K | Aug 2024 | BSD-2-Clause |
| [mkdocstrings](#mkdocstrings) | 8.0M | 2.1K | Oct 2026 | ISC |
| [pdoc](#pdoc) | 1.1M | 2.5K | Oct 2025 | MIT-0 |
| [Sphinx AutoAPI](#sphinx-autoapi) | 597.3K | 497 | Oct 2026 | MIT |
| [Jupyter Book](#jupyter-book) | 353.6K | 4.3K | Sep 2026 | BSD-3-Clause |
| [pdoc3](#pdocthree) | 194.8K | 1.2K | Mar 2025 | AGPL-3.0 |
| [Pydoc-Markdown](#pydoc-markdown) | 165.2K | 503 | Jun 2023 | MIT |

Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Sphinx](#sphinx-library) has the most monthly downloads in this comparison, at 20.3M.

## Capabilities

| Library | Standalone HTML site build | Import free API extraction |
| --- | --- | --- |
| [Sphinx](#sphinx-library) | Yes | Via plugin |
| [MkDocs](#mkdocs) | Yes | Via plugin |
| [mkdocstrings](#mkdocstrings) | No | Yes |
| [pdoc](#pdoc) | Yes | No |
| [Sphinx AutoAPI](#sphinx-autoapi) | No | Yes |
| [Jupyter Book](#jupyter-book) | Yes | Undocumented |
| [pdoc3](#pdocthree) | Yes | No |
| [Pydoc-Markdown](#pydoc-markdown) | Via plugin | Yes |

## Libraries

### Sphinx

[GitHub](https://github.com/sphinx-doc/sphinx) · [PyPI](https://pypi.org/project/sphinx) · [Docs](https://www.sphinx-doc.org/)

Generates Python documentation.

- Downloads / mo: 20.3M
- Stars: 8.1K
- Last release: 9.2.0
- License: BSD-2-Clause
- Capabilities: [From the Sphinx docs](https://www.sphinx-doc.org/)

```sh
pip install sphinx
```

**Quickstart**

```python
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)
```

From [quickstart.html](https://www.sphinx-doc.org/en/master/usage/quickstart.html) · [Find projects using Sphinx →](https://dashboard.exa.ai/playground/search?q=sphinx%20GitHub%20projects)

### MkDocs

[GitHub](https://github.com/mkdocs/mkdocs) · [PyPI](https://pypi.org/project/mkdocs) · [Docs](https://www.mkdocs.org/)

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
- Capabilities: [From the MkDocs docs](https://www.mkdocs.org/)

**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.

**Watch out for**

- **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.

```sh
pip install mkdocs
```

**boardpack/pydantic-i18n** (103 stars)

[boardpack/pydantic-i18n](https://github.com/boardpack/pydantic-i18n) 

```python
@app.command()
def build_all():
    """
    Build mkdocs site for en, and then build each language inside, end result is located
    at directory ./site/ with each language inside.
    """
    site_path = Path("site").absolute()
    update_languages(lang=None)
    current_dir = os.getcwd()
    os.chdir(en_docs_path)
    typer.echo("Building docs for: en")
    mkdocs.commands.build.build(mkdocs.config.load_config(site_dir=str(site_path)))
    os.chdir(current_dir)
    langs = []
    for lang in get_lang_paths():
        if lang == en_docs_path or not lang.is_dir():
            continue
        langs.append(lang.name)
    cpu_count = os.cpu_count() or 1
    with Pool(cpu_count * 2) as p:
        p.map(build_lang, langs)
```

[scripts/docs.py](https://github.com/boardpack/pydantic-i18n/blob/c6cd6d23c12d72342b50ece2b3797b9094cb4af9/scripts/docs.py#L211-L231) · [More projects using MkDocs →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20mkdocs%20for%20translated%20documentation%20builds%2C%20API%20references%20and%20custom%20search%20extensions&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```python
import subprocess

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

From [getting-started.md](https://www.mkdocs.org/getting-started/)

### mkdocstrings

[GitHub](https://github.com/mkdocstrings/mkdocstrings) · [PyPI](https://pypi.org/project/mkdocstrings) · [Docs](https://mkdocstrings.github.io)

Generates documentation from source code for MkDocs.

- Downloads / mo: 8.0M
- Stars: 2.1K
- Last release: 1.0.8
- License: ISC
- Capabilities: [From the mkdocstrings docs](https://mkdocstrings.github.io)

```sh
pip install mkdocstrings[python]
```

**mkdocstrings/python** (285 stars)

[mkdocstrings/python](https://github.com/mkdocstrings/python) 

```python
@staticmethod
def load_inventory(
    in_file: BinaryIO,
    url: str,
    base_url: str | None = None,
    domains: list[str] | None = None,
    **kwargs: Any,  # noqa: ARG004
) -> Iterator[tuple[str, str]]:
    """Yield items and their URLs from an inventory file streamed from `in_file`.

    This implements mkdocstrings' `load_inventory` "protocol" (see [`mkdocstrings.BaseHandler.load_inventory`][]).

    Arguments:
        in_file: The binary file-like object to read the inventory from.
        url: The URL that this file is being streamed from (used to guess `base_url`).
        base_url: The URL that this inventory's sub-paths are relative to.
        domains: A list of domain strings to filter the inventory by, when not passed, "py" will be used.
        **kwargs: Ignore additional arguments passed from the config.

    Yields:
        Tuples of (item identifier, item URL).
    """
    domains = domains or ["py"]
    if base_url is None:
        base_url = posixpath.dirname(url)

    for item in Inventory.parse_sphinx(in_file, domain_filter=domains).values():
        yield item.name, posixpath.join(base_url, item.uri)
```

[src/mkdocstrings_handlers/python/_internal/handler.py](https://github.com/mkdocstrings/python/blob/f5b9e2572850c87740fabac74e57122f0538a4d6/src/mkdocstrings_handlers/python/_internal/handler.py#L151-L178) · [More projects using mkdocstrings →](https://dashboard.exa.ai/playground/search?q=mkdocstrings%20GitHub%20projects)

**Quickstart**

```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)
```

From [index.html](https://mkdocstrings.github.io/python/usage/)

### pdoc

[GitHub](https://github.com/mitmproxy/pdoc) · [PyPI](https://pypi.org/project/pdoc) · [Docs](https://pdoc.dev/docs/pdoc.html)

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
- Capabilities: [From the pdoc docs](https://pdoc.dev/docs/pdoc.html)

**Strengths**

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

**Watch out for**

- **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.

```sh
pip install pdoc
```

**Quickstart**

```python
from pathlib import Path
import pdoc

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

From [README.md](https://pdoc.dev/docs/pdoc.html) · [Find projects using pdoc →](https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20pdoc%20for%20translated%20documentation%20builds%2C%20API%20references%20and%20custom%20search%20extensions&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

### Sphinx AutoAPI

[GitHub](https://github.com/readthedocs/sphinx-autoapi) · [PyPI](https://pypi.org/project/sphinx-autoapi) · [Docs](https://sphinx-autoapi.readthedocs.io/en/latest/)

Generates API documentation inside Sphinx.

- Downloads / mo: 597.3K
- Stars: 497
- Last release: 3.9.0
- License: MIT
- Capabilities: [From the Sphinx AutoAPI docs](https://sphinx-autoapi.readthedocs.io/en/latest/)

```sh
pip install sphinx-autoapi
```

**Quickstart**

```python
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)
```

From [README.rst](https://pypi.org/pypi/sphinx-autoapi/3.9.0/json#info.description) · [Find projects using Sphinx AutoAPI →](https://dashboard.exa.ai/playground/search?q=sphinx-autoapi%20GitHub%20projects)

### Jupyter Book

[GitHub](https://github.com/jupyter-book/jupyter-book) · [PyPI](https://pypi.org/project/jupyter-book) · [Docs](https://pypi.org/project/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
- Capabilities: [From the Jupyter Book docs](https://pypi.org/project/jupyter-book/)

```sh
pip install jupyter-book
```

**Quickstart**

```python
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)
```

From [index.html](https://jupyterbook.org/stable/get-started/init/) · [Find projects using Jupyter Book →](https://dashboard.exa.ai/playground/search?q=jupyter-book%20GitHub%20projects)

### pdoc3

[GitHub](https://github.com/pdoc3/pdoc) · [PyPI](https://pypi.org/project/pdoc3) · [Docs](https://pdoc3.github.io/pdoc/doc/pdoc/)

Generates API documentation for Python projects.

- Downloads / mo: 194.8K
- Stars: 1.2K
- Last release: 0.11.6
- License: AGPL-3.0
- Capabilities: [From the pdoc3 docs](https://pdoc3.github.io/pdoc/doc/pdoc/)

```sh
pip install pdoc3
```

**postlund/pyatv** (1.2K stars)

[postlund/pyatv](https://github.com/postlund/pyatv) 

```python
def _api_modules():
    def _recursive_htmls(mod):
        yield mod.name, mod.html()
        for submod in mod.submodules():
            yield from _recursive_htmls(submod)

    modules = ["pyatv"]
    context = pdoc.Context()

    modules = [
        pdoc.Module(mod, context=context, docfilter=_filter_func) for mod in modules
    ]
    pdoc.link_inheritance(context)

    for mod in modules:
        for module_name, html in _recursive_htmls(mod):
            output_file = os.path.join("docs", "api", module_name + ".html")
            yield output_file, html
```

[scripts/api.py](https://github.com/postlund/pyatv/blob/b277a4c8222ecdcbaab8a24e3e713ca44765adb4/scripts/api.py#L30-L47) · [More projects using pdoc3 →](https://dashboard.exa.ai/playground/search?q=pdoc3%20GitHub%20projects)

**Quickstart**

```python
from pathlib import Path
import pdoc

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

From [__init__.py](https://pdoc3.github.io/pdoc/doc/pdoc/)

### Pydoc-Markdown

[GitHub](https://github.com/NiklasRosenstein/pydoc-markdown) · [PyPI](https://pypi.org/project/pydoc-markdown) · [Docs](https://pypi.org/project/pydoc-markdown/)

Creates Python API documentation in Markdown format.

- Downloads / mo: 165.2K
- Stars: 503
- Last release: 4.8.2
- License: MIT
- Capabilities: [From the Pydoc-Markdown docs](https://pypi.org/project/pydoc-markdown/)

```sh
pip install pydoc-markdown
```

**Quickstart**

```python
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)
```

From [__init__.py](https://github.com/NiklasRosenstein/pydoc-markdown/blob/f6c4b8cebc08cb38fc2a8694e0743b482034916b/src/pydoc_markdown/__init__.py) · [Find projects using Pydoc-Markdown →](https://dashboard.exa.ai/playground/search?q=pydoc-markdown%20GitHub%20projects)

## FAQ

### Which Python documentation library should I use?

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

### What is MkDocs?

[MkDocs](#mkdocs) builds static documentation sites from Markdown files and a YAML configuration. Themes and plugins extend each site.

### What is Sphinx in Python?

[Sphinx](#sphinx-library) is a documentation generator with a native ecosystem of extensions and domains. Its autodoc extension pulls API documentation from docstrings.

### MkDocs vs Sphinx: which should I use?

[MkDocs](#mkdocs) writes pages in Markdown and adds API pages through [mkdocstrings](#mkdocstrings). [Sphinx](#sphinx-library) writes pages in reStructuredText or Markdown through extensions and offers a larger extension ecosystem.

### What is Jupyter Book?

[Jupyter Book](#jupyter-book) builds reusable, reproducible, and interactive computational narratives from MyST documents and notebooks.

## How this page was built

Data checked Nov 20, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "Best Python documentation libraries Sphinx MkDocs pdoc pydoctor code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
