Pydoctor is a standalone API documentation generator that works by static analysis. It was primarily written to replace epydoc for the Twisted project, especially due to epydoc's difficulties with `zope.interface`. It aims to provide comprehensive API documentation for Python projects, supporting various docstring formats like epytext, reStructuredText, Google, and Numpy styles. The current version is 25.10.1 and it is actively maintained.
pip install pydoctorNo compatibility data collected yet for this library.
Pydoctor is primarily a command-line interface (CLI) tool. This quickstart demonstrates how to create a minimal Python project and generate its API documentation using the `pydoctor` command-line utility. The `--html-output` option specifies the output directory, and the positional arguments are the paths to the Python source to be documented.
Ensure your Python environment meets the minimum `requires_python` version specified on PyPI (currently >=3.9 for 25.10.1).
Configure `--html-viewsource-base` with a static reference, such as `https://github.com/your-org/your-repo/tree/v1.2.3` or `https://github.com/your-org/your-repo/tree/COMMIT_SHA`.
Instead of `--html-write-function-pages`, utilize the generated Intersphinx inventory (`objects.inv`) for deep-linking to specific functions or methods in your documentation.
Interpret exit codes carefully in CI/CD pipelines. A non-zero exit code doesn't always mean a critical failure of documentation generation, but may indicate docstring quality issues. Use `--warnings-as-errors` if strict docstring formatting is required.
Enable verbose logging with `-v` (or multiple `-vvv`) to get more details. Check for issues in the source code or docstring parsing. Consult the full traceback for the specific error location.
Upgrade pydoctor to version 25.4.0 or newer to support implicit native namespace packages (PEP 420). Alternatively, ensure that the source directories being documented are valid Python packages with an `__init__.py` file, or explicitly configure them.
Verify the path provided to the `--template-dir` option (or its equivalent in a config file) is correct and points to an existing directory containing valid template files.
Specify the project's base directory using `--project-base-dir` for accurate source link computation. Use `--add-package` or `--add-module` explicitly, and ensure all relevant source code is discoverable. For module/package name collisions, better messages are triggered in newer versions.