docstring-parser
Parse Python docstrings in reST, Google and Numpydoc format
Install
docstring-parser on PyPI
pip
pip install docstring-parseruv
uv add docstring-parserpoetry
poetry add docstring-parserPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 121 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: docstring_parser-0.18.0-py3-none-any.whl
About docstring-parser
from the package's own PyPI description — quoted content, verbatim
docstring_parser
Parse Python docstrings. Currently support ReST, Google, Numpydoc-style and Epydoc docstrings.
Example usage:
>>> from docstring_parser import parse
>>>
>>>
>>> docstring = parse(
... '''
... Short description
...
... Long description spanning multiple lines
... - First line
... - Second line
... - Third line
...
... :param name: description 1
... :param int priority: description 2
... :param str sender: description 3
... :raises ValueError: if name is invalid
... ''')
>>>
>>> docstring.long_description
'Long description spanning multiple lines\n- First line\n- Second line\n- Third line'
>>> docstring.params[1].arg_name
'priority'
>>> docstring.raises[0].type_name
'ValueError'
Read API Documentation.
Installation
Installation using pip
```shell pip install docstring_parser
or if you want to install it in a virtual environment
python -m venv venv # create environment source...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Parses Python docstrings in multiple formats (ReST, Google, Numpydoc, Epydoc) and extracts structured metadata like descriptions, parameters, return types, and exceptions.
Straightforward installation with no runtime dependencies and low friction. Actively maintained with recent releases and a stable repository.
MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Usage
pip install docstring_parser
from docstring_parser import parse
docstring = parse("""
:param name: description
:raises ValueError: if invalid
""")
print(docstring.params[0].arg_name)
print(docstring.raises[0].type_name)
Requires Python 3.8 or later.
Verdict: A lightweight, actively maintained parser for extracting structured metadata from Python docstrings across multiple formats. Zero runtime dependencies and permissive MIT licensing make it a low-friction choice for documentation tooling and code analysis.
Needs verification
- Performance characteristics when parsing very large or complex docstrings
- Completeness of support for edge cases in each docstring format variant
Similar packages
permissive · top 1,000 on PyPI
flit-corepermissive · top 1,000 on PyPI
retrypermissive · top 1,000 on PyPI
rich-rstpermissive · top 1,000 on PyPI
annotated-docpermissive · top 100 on PyPI
fsspecunclear · top 100 on PyPI
deprecationpermissive · top 1,000 on PyPI
pdfminer.sixpermissive · top 1,000 on PyPI
Sphinxpermissive · top 1,000 on PyPI
websocket-clientpermissive · top 1,000 on PyPI