"Parse Python docstrings in reST, Google and Numpydoc format"
Project description
docstring_parser
Parse Python docstrings. Currently support ReST, Google, and Numpydoc-style 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
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.8.1.tar.gz
(14.2 kB
view details)
File details
Details for the file docstring_parser-0.8.1.tar.gz
.
File metadata
- Download URL: docstring_parser-0.8.1.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd68bbe33446e9dbdec087fd18bad8f6dc8eedda4c5c2321208951f3acfc5e04 |
|
MD5 | 39f0706b2f990e4c703a86633c5eed5a |
|
BLAKE2b-256 | b0d9fff7bdbc6bcd949dbf8bd64967a07d79f2767ae147fc5c1f0b2c8a063a77 |