"Parse Python docstrings in reST, Google and Numpydoc format"
Project description
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'
Contributing
This project uses precommit. You can install it with
python3 -m pip install --user pre-commit
and running pre-commit install
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
docstring_parser-0.11.tar.gz
(22.8 kB
view details)
File details
Details for the file docstring_parser-0.11.tar.gz
.
File metadata
- Download URL: docstring_parser-0.11.tar.gz
- Upload date:
- Size: 22.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b3f8f481c7d24e37c5d9f30293c89e2933fa209421c8abd731dd3ef0715ecb |
|
MD5 | 13953f84fa0251ce5ce5bef10c9cc329 |
|
BLAKE2b-256 | a2ce5d6a3782b9f88097ce3e579265015db3372ae78d12f67629b863a9208c96 |