Registry / serialization / docstring-parser

docstring-parser

JSON →
library0.17.0pypypi✓ verified 35d ago

A Python library for parsing docstrings in reST, Google, and Numpydoc formats. Current version: 0.17.0, released on July 21, 2025. Maintained with a stable release cadence.

serialization
Install & Compatibility
Where this runs
tested against v0.18.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.925 runs
installs and imports cleanly · install 0.0s · import 0.047s · 18.2MB
glibc
py 3.103.925 runs
installs and imports cleanly · install 1.5s · import 0.040s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Ensure correct import path to access the 'parse' function.

from docstring_parser import parse

A quickstart guide demonstrating how to parse a sample docstring using the 'parse' function from docstring_parser.

from docstring_parser import parse # Sample docstring docstring = """ This is a sample function. :param x: The input value :type x: int :return: The squared value of x :rtype: int """ # Parse the docstring parsed = parse(docstring) # Access parsed components print(f"Description: {parsed.short_description}") print(f"Parameters: {parsed.params}") print(f"Returns: {parsed.returns}")
Debug
Known footguns
breakingIn version 0.17.0, the 'parse' function now requires the 'style' parameter to be explicitly set. Omitting it will raise a TypeError.
deprecatedThe 'parse_from_object' function is deprecated and will be removed in a future release. Use 'parse' with the appropriate style parameter instead.
gotchaWhen parsing docstrings with the 'parse' function, ensure that the 'style' parameter matches the docstring format (e.g., 'reST', 'Google', 'Numpydoc') to avoid parsing errors.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
17 hits · last 30 days
gptbot
4
ahrefsbot
4
claudebot
4
commoncrawl
1
chatgpt-user
1
Resources