numpydoc
Sphinx extension to support docstrings in Numpy format
What it is and what it does
numpydoc is a Sphinx extension that teaches Sphinx how to read and render docstrings written in NumPy's standardized documentation format. It parses sections like Parameters, Returns, Examples, and Notes, converting them into properly formatted HTML or other Sphinx output formats. The extension also provides specialized directives (np:function, np-c:function, etc.) for documenting NumPy-style code.
You install it as a dependency of your Sphinx documentation project, add it to your conf.py extensions list, and then write your code docstrings following the NumPy format guide. Sphinx will automatically use numpydoc to render them. It depends on Sphinx and tomli, making it a lightweight addition to existing documentation workflows.
Use it for:
- Documenting scientific Python libraries that follow NumPy's docstring conventions
- Converting existing NumPy-format docstrings into polished HTML API documentation via Sphinx
- Adding specialized code directives (np:function, np-c:function) to Sphinx projects documenting NumPy-adjacent code
- Enforcing consistent docstring structure across a team's scientific Python codebase
- Building documentation sites for projects that inherit or adopt NumPy's documentation standards
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Sphinx extension that parses and renders docstrings written in NumPy documentation format, adding specialized directives for function and code documentation.
Yes. numpydoc is actively maintained, has no known vulnerabilities, installs with low friction, and is essential if you document scientific Python code using NumPy-format docstrings. The permissive BSD license poses no restrictions. Install it as part of your Sphinx setup if your project or team uses NumPy docstring conventions.
Install
numpydoc on PyPI
pip
pip install numpydocuv
uv add numpydocpoetry
poetry add numpydocInstalling numpydoc
Before you install
Low friction installation with a pure-Python wheel. Actively maintained with recent commits and no known vulnerabilities. Requires Python 3.10+ and Sphinx 6+.
License in practice
BSD 2-Clause permissive license allows use in commercial and private projects with minimal restrictions; only requires copyright notice and disclaimer in distributions.
Quickstart
pip install numpydoc
# In conf.py (Sphinx configuration):
extensions = ['numpydoc']
# Then write NumPy-format docstrings in your code
Requires Python 3.10+ and Sphinx 6+; must be configured in a Sphinx project's conf.py
Verify before relying
- Whether the extension handles all NumPy docstring edge cases or has known limitations with specific formats
- Performance characteristics when processing large codebases with many NumPy-format docstrings
Package facts
| License | Copyright (C) 2008-2023 Stefan van der Walt <stefan@mentat.za.net>, Pauli Virtanen <pav@iki.fi> Redistribution and use in source and binary forms, with or without modification, are permitted provided… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — sphinx, tomli |
| Maintenance | actively maintained — 255 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,301,154/month — #3,156 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: numpydoc-1.10.0-py3-none-any.whl
Keywords: sphinx, numpy
Tags
More Documentation packages
Docutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
griffeGriffe extracts the complete structure and…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
sphinxcontrib-napoleonA Sphinx extension that converts Google and…
permissive · top 15,000 on PyPI
docstring-parser-forkParses Python docstrings in ReST, Google,…
permissive · top 5,000 on PyPI
sphinx-data-viewerAdds an interactive data viewer to Sphinx…
permissive · top 15,000 on PyPI
pydoctorpydoctor generates API documentation from…
permissive · top 15,000 on PyPI
darglintDarglint is a docstring linter that checks…
permissive · top 15,000 on PyPI
docstring-inheritanceAutomatically inherits docstrings from parent…
permissive · top 15,000 on PyPI
pydoc-markdownPydoc-Markdown parses Python source code and…
permissive · top 15,000 on PyPI
pydoclintPydoclint is a Python docstring linter that…
permissive · top 5,000 on PyPI
pdoc3Generates API documentation for Python 3+…
agpl · top 15,000 on PyPI