module documentation

Google-style docstring parsing.

Class GoogleParser Parser for Google-style docstrings.
Class Section A docstring section.
Class SectionType Types of sections.
Function compose Render a parsed docstring into docstring text.
Function parse Parse the Google-style docstring into its components.
Constant DEFAULT_SECTIONS Undocumented
Constant GOOGLE_ARG_DESC_REGEX Undocumented
Constant GOOGLE_TYPED_ARG_REGEX Undocumented
Constant MULTIPLE_PATTERN Undocumented
def compose(docstring: Docstring, rendering_style: RenderingStyle = RenderingStyle.COMPACT, indent: str = ' ') -> str: (source)

Render a parsed docstring into docstring text.

Parameters
docstring:Docstringparsed docstring representation
rendering_style:RenderingStylethe style to render docstrings
indent:strthe characters used as indentation in the docstring string
Returns
strdocstring text
def parse(text: str | None) -> Docstring: (source)

Parse the Google-style docstring into its components.

Returns
Docstringparsed docstring
DEFAULT_SECTIONS = (source)

Undocumented

Value
[Section('Arguments', 'param', SectionType.MULTIPLE),
 Section('Args', 'param', SectionType.MULTIPLE),
 Section('Parameters', 'param', SectionType.MULTIPLE),
 Section('Params', 'param', SectionType.MULTIPLE),
 Section('Raises', 'raises', SectionType.MULTIPLE),
 Section('Exceptions', 'raises', SectionType.MULTIPLE),
 Section('Except', 'raises', SectionType.MULTIPLE),
...
GOOGLE_ARG_DESC_REGEX = (source)

Undocumented

Value
re.compile(r'.*\. Defaults to (.+)\.')
GOOGLE_TYPED_ARG_REGEX = (source)

Undocumented

Value
re.compile(r'\s*(.+?)\s*\(\s*(.*[^\s]+)\s*\)')
MULTIPLE_PATTERN = (source)

Undocumented

Value
re.compile(r'(\s*[^:\s]+:)|([^:]*\]:.*)|(\s*\w+(?:\s*\|\s*\w+)+:)')