"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.12.tar.gz
(23.1 kB
view details)
File details
Details for the file docstring_parser-0.12.tar.gz.
File metadata
- Download URL: docstring_parser-0.12.tar.gz
- Upload date:
- Size: 23.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6723a3728c81e080a0454a550d11c7ad27dca0461099f3952218acf98488e1d5
|
|
| MD5 |
19b4aa0690bff96db37252a6463d4c48
|
|
| BLAKE2b-256 |
4c97caac8f0c628e5348f4f7ee6ece9e9236a5b3f43154636399d57d7a04e6fa
|