docstring-parser
Parse Python docstrings in reST, Google and Numpydoc format
Decision gist · record as of 2026-08-14
Yes. This is a stable, actively maintained library with zero dependencies, a permissive license, and a clear, narrow purpose. Install it if you need to programmatically read and extract structured data from Python docstrings. The low friction and broad format support make it a straightforward choice for documentation tooling.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction—pure Python wheel with no runtime dependencies.
- Actively maintained with a recent release; last commit 2026-06-30.
- Supports Python 3.8 through 3.14.
License · maintenance · safety
MIT (permissive) — MIT license (permissive); you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2026-04-14 (122 days) · last repo commit 2026-06-30 · 270 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 274,897,544 downloads/mo, #147 on PyPI
Alternatives
Verify before relying
pip install docstring_parser
from docstring_parser import parse
docstring = parse("""
Short description
:param name: description
:raises ValueError: if invalid
""")
print(docstring.params[0].arg_name)
print(docstring.raises[0].type_name)- Whether the parser handles malformed or ambiguous docstrings gracefully (error behavior not specified in excerpt).
- Performance characteristics when parsing very large docstrings or batch processing many functions.
What it is and what it does
docstring_parser is a lightweight library that reads and extracts structured information from Python docstrings written in common formats—ReST, Google, Numpydoc, and Epydoc. It parses the raw text and returns an object model with separate fields for short and long descriptions, parameters (with names and types), return values, exceptions, and other metadata. The library has no runtime dependencies and runs on Python 3.8 or later.
You use it when you need to programmatically inspect function or class documentation—for example, to generate API reference sites, validate docstring completeness in a linter, extract parameter information for IDE tooltips, or build documentation tools that understand multiple docstring conventions. It handles the parsing logic so you don't have to write regex or string-splitting code yourself.
Use it for
- Build a documentation generator that reads docstrings and outputs formatted API reference pages.
- Implement a linter or pre-commit hook that validates docstring format and completeness.
- Extract parameter and return-type metadata from functions to populate IDE autocomplete or type hints.
- Parse docstrings in a codebase to generate a searchable index of function signatures and descriptions.
- Migrate docstrings between formats (e.g., from ReST to Google style) by parsing and re-rendering.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a stable, actively maintained library with zero dependencies, a permissive license, and a clear, narrow purpose. Install it if you need to programmatically read and extract structured data from Python docstrings. The low friction and broad format support make it a straightforward choice for documentation tooling.
Install
docstring-parser on PyPI
Before you install
Low friction—pure Python wheel with no runtime dependencies. Actively maintained with a recent release; last commit 2026-06-30. Supports Python 3.8 through 3.14.
License in practice
MIT license (permissive); you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install docstring_parser
from docstring_parser import parse
docstring = parse("""
Short description
:param name: description
:raises ValueError: if invalid
""")
print(docstring.params[0].arg_name)
print(docstring.raises[0].type_name)
Verify before relying
- Whether the parser handles malformed or ambiguous docstrings gracefully (error behavior not specified in excerpt).
- Performance characteristics when parsing very large docstrings or batch processing many functions.
Package 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 122 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 274,897,544 / month, #147 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Documentation :: SphinxTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: Markup |
Evidence: docstring_parser-0.18.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “docstring extraction”
- docstring-parserParses Python docstrings in ReST, Google, Numpydoc, and Epydoc…
- mkdocstringsAn MkDocs plugin that automatically generates API documentation from…
- pytkdocsExtracts and serializes Python object documentation (modules,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also docstring-parser-fork · numpydoc · pydoctor · docstring-inheritance · docstr-coverage · docrep · docsig · attributes-doc · pydocstringformatter · flake8-docstrings