numpydoc

1.10.0 · active · verified Sat Apr 11

numpydoc is a Sphinx extension that enables the use of NumPy-style docstrings in Sphinx-generated documentation. It processes docstrings formatted according to the NumPy documentation format, adding functionality like autodoc integration and custom directives for functions and classes. The current version is 1.10.0, with releases occurring a few times a year.

Warnings

Install

Imports

Quickstart

To use numpydoc, you primarily need to add 'numpydoc' to the `extensions` list in your Sphinx `conf.py` file. This enables NumPy-style docstring parsing. You typically use it alongside `sphinx.ext.autodoc` for automatic documentation generation. Other common extensions like `sphinx.ext.autosummary` are often used and are automatically loaded by numpydoc.

# conf.py (in your Sphinx project's docs/source directory)

import os
import sys
# If your project is a package, add its path to sys.path
# sys.path.insert(0, os.path.abspath('../../src')) # Example for a 'src' directory two levels up

project = 'My Project'
copyright = '2026, Your Name'
author = 'Your Name'
release = '0.1'

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.coverage',
    'sphinx.ext.mathjax',
    'sphinx.ext.viewcode',
    'numpydoc'
]

templates_path = ['_templates']
exclude_patterns = []

html_theme = 'alabaster'
html_static_path = ['_static']

# Numpydoc specific configuration (optional, set as needed)
numpydoc_show_class_members = False
numpydoc_class_members_toctree = False
numpydoc_xref_param_type = True

# To enable validation of docstrings during build
numpydoc_validation_checks = {"all"}

view raw JSON →