{"library":"sphinx-automodapi","title":"Sphinx AutoModAPI","type":"library","description":"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.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install sphinx-automodapi"],"cli":null},"imports":["extensions = ['sphinx.ext.autodoc', 'sphinx_automodapi.automodapi']"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/astropy/sphinx-automodapi","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sphinx-automodapi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import os\nimport shutil\n\n# 1. Create dummy package structure\npackage_dir = 'my_package'\ndocs_dir = 'docs'\n\nshutil.rmtree(docs_dir, ignore_errors=True)\nshutil.rmtree(package_dir, ignore_errors=True)\n\nos.makedirs(os.path.join(package_dir, 'submodule'), exist_ok=True)\nos.makedirs(docs_dir, exist_ok=True)\n\n# 2. Create a dummy Python module for documentation\nwith open(os.path.join(package_dir, '__init__.py'), 'w') as f: f.write('')\nwith open(os.path.join(package_dir, 'my_module.py'), 'w') as f:\n    f.write('''\ndef my_function(arg1, arg2):\n    \"\"\"A sample function.\n\n    :param arg1: First argument.\n    :param arg2: Second argument.\n    :return: The sum of arg1 and arg2.\n    \"\"\"\n    return arg1 + arg2\n\nclass MyClass:\n    \"\"\"A sample class.\n\n    :param name: The name for the class instance.\n    \"\"\"\n    def __init__(self, name):\n        self.name = name\n\n    def greet(self):\n        \"\"\"Greets the user.\n        \"\"\"\n        return f\"Hello, {self.name}!\"\n''')\n\n# 3. Create Sphinx conf.py\nwith open(os.path.join(docs_dir, 'conf.py'), 'w') as f:\n    f.write(f'''\nimport os\nimport sys\nsys.path.insert(0, os.path.abspath('..')) # Add parent directory to path for module discovery\n\nproject = 'My Awesome Project'\ncopyright = '2023, Your Name'\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.napoleon', # Recommended for Google/NumPy style docstrings\n    'sphinx_automodapi.automodapi',\n    'sphinx_automodapi.automodsumm' # For generating summary tables\n]\nhtml_theme = 'alabaster'\n\n# REQUIRED for sphinx-automodapi\nautomodapi_toctreedir = '_autosummary'\n''')\n\n# 4. Create an RST file to use automodapi\nwith open(os.path.join(docs_dir, 'index.rst'), 'w') as f:\n    f.write(f'''\n.. automodapi:: my_package.my_module\n   :no-inherited-members:\n\n.. toctree::\n   :maxdepth: 2\n   :caption: Contents:\n\n   _autosummary/my_package.my_module\n''')\n\nprint(\"Setup complete!\\n\")\nprint(\"To build the documentation:\\n\")\nprint(f\"1. Navigate to the '{docs_dir}' directory: cd {docs_dir}\")\nprint(\"2. Run Sphinx build command: sphinx-build -b html . _build\")\nprint(\"3. Open _build/index.html in your browser.\")\nprint(\"Note: You need Sphinx installed (pip install sphinx) to run sphinx-build.\")\n","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.21.0","pypi_latest":"0.22.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.2,"avg_import_s":0,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.1,"import_time_s":0,"mem_mb":0,"disk_size":"94M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"102.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.1,"import_time_s":0,"mem_mb":0,"disk_size":"103M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.9,"import_time_s":0,"mem_mb":0,"disk_size":"94M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5,"import_time_s":0,"mem_mb":0,"disk_size":"94M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.0M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sphinx-automodapi","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.1,"import_time_s":0,"mem_mb":0,"disk_size":"93M"}]}}