Sphinx AutoModAPI is an extension for Sphinx that simplifies the automatic generation of API documentation for entire Python modules and packages. It integrates with Sphinx's autodoc and autosummary to create comprehensive API reference pages and summary tables. The current version is 0.22.0, and it maintains a regular release cadence, often aligning with new Python and Sphinx versions.
pip install sphinx-automodapiVerified import paths — ran on the pinned version, not inferred.
This quickstart code creates a minimal Python package and a Sphinx documentation project. It configures `conf.py` to enable `sphinx_automodapi.automodapi` and `sphinx_automodapi.automodsumm`, and creates an `index.rst` file that uses `automodapi` to document `my_package.my_module`. Run this Python script, then navigate into the `docs` directory and use `sphinx-build` to generate the HTML documentation.
Upgrade your Python environment to 3.10 or newer, or pin `sphinx-automodapi` to an older version compatible with your current Python environment (e.g., `sphinx-automodapi<0.22` for Python 3.9).
Ensure `sphinx-automodapi` and `Sphinx` versions are compatible. Consult the changelog or testing matrix in the project's GitHub repository for specific version requirements, or update both to their latest compatible versions.
Use `sphinx_automodapi.automodapi` to create dedicated API pages. Use `sphinx_automodapi.automodsumm` to embed compact, sortable tables of functions, classes, or attributes into other documentation pages.
In your `docs/conf.py`, add the path to your package's root directory to `sys.path`. A common pattern is `sys.path.insert(0, os.path.abspath('../'))` if `conf.py` is in the `docs` folder next to your package. Alternatively, install your package in editable mode (`pip install -e .`).