pdoc is a free, open source documentation & knowledge base project written in Python and released under AGPL-3.0. It has 1,181 GitHub stars, 146 forks and 109 open issues, and was last pushed 1 months ago. On this registry it ranks #36 of 40 tracked projects in Documentation & Knowledge Base, with 5 head-to-head comparisons available.

What is pdoc?

What it is

pdoc is an API documentation generator for Python 3+ projects, published to PyPI as the package pdoc3 and maintained under the AGPL-3.0 license. It lives in the Python ecosystem, and it is itself a Python tool: it accepts a Python module file, a package directory, or an import path, then produces documentation. The project has existed for eight years, carries 1,181 stars and 145 forks, and its own documentation site is generated with pdoc.

The concrete problem it solves is the gap between docstrings that already exist in source code and documentation a reader can actually browse. Rather than requiring a separate authoring format or a configuration-heavy build, pdoc reads the docstrings, type annotations, and variable definitions already present in a project and renders them into HTML documentation. It aims to produce sensible API documentation with prose without any special configuration, which means a project with reasonable docstrings gets a browsable reference without a second source of truth.

Key capabilities

  • Generates API and prose documentation from a module file, package directory, or import path with no special configuration.
  • Supports common docstring formats including Markdown, numpydoc, and Google-style docstrings.
  • Renders LaTeX math and supports some reStructuredText directives.
  • Reads PEP 484 and PEP 526 type annotations.
  • Respects __all__ when it is present, and inherits docstrings for overridden class members when they are unspecified.
  • Documents module, class, and instance variables by traversing abstract syntax trees.
  • Automatically cross-links referenced identifiers, and allows docstring generation to be overridden through a module-level __pdoc__ dictionary.
  • Provides templates that can be customized and extended, plus a built-in development web server for near-instant previews.

Who uses it and how

  • Library maintainers publish generated HTML API references for their packages, since pdoc's own documentation is produced this way.
  • Developers preview rendered docstrings locally through the built-in development web server while writing documentation.
  • Teams with existing Markdown, numpydoc, or Google-style docstrings generate output without converting their comment style first.
  • Projects that annotate code with PEP 484 or PEP 526 types get those annotations reflected in the rendered output.
  • Projects needing to hide or reshape specific entries use the __pdoc__ dictionary to override what is documented.
  • Projects with non-standard presentation needs customize the templates rather than replacing the generator.

Getting started

Install with pip install pdoc3, then run pdoc your_project against a module file, package directory, or import path. Additional command-line switches are listed in pdoc --help, and the project documentation covers further usage examples.

When to use it β€” and when not

Use pdoc when a Python project already carries usable docstrings and wants readable HTML output without adopting a separate documentation format or an elaborate build configuration. A self-hoster operates nothing beyond a Python environment: the tool emits static HTML, and the development web server is built in

project readme (upstream, from github) β€” read inline

pdoc

Build Status Code Coverage Source lines of code pdoc3 on PyPI package downloads total downloads GitHub Sponsors

Auto-generate API documentation for Python 3+ projects.

Project website

Documentation

Installation

$ pip install pdoc3

Usage

Pdoc will accept a Python module file, package directory or an import path.

$ pdoc your_project

See pdoc --help for more command-line switches and the documentation for more usage examples.

Features

The above features are explained in more detail in pdoc's documentation (generated with pdoc).

Development

Check CONTRIBUTING.md for hacking details.

Frequently asked questions

Is pdoc free to use?

pdoc is open source under the AGPL-3.0 licence. There is no licence fee and no seat count β€” you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does pdoc do?

🐍 ➑️ πŸ“œ Auto-generate API docs for Python projects

What is pdoc written in?

pdoc is primarily written in Python. Its source is publicly available at https://github.com/pdoc3/pdoc, and it has 1,181 GitHub stars.