Skip to content

Parse Python docstrings in reST and Google format

License

Notifications You must be signed in to change notification settings

HtheChemist/docstring_parser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

This project uses Black with -l79 setting as well as isort.

About

Parse Python docstrings in reST and Google format

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%