module documentation

Classes for google-style and numpy-style docstring conversion.

Forked from sphinx.ext.napoleon.docstring.

:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
Class ​Field Represent a field with a name and/or a type and/or a description. Commonly a parameter description. It's also used for Returns section and other sections structured with fields.
Class ​Free​Form​Exception Exception to encapsulate the converted lines when numpy-style fields get treated as free form.
Class ​Google​Docstring Convert Google style docstrings to reStructuredText.
Class ​Numpy​Docstring Convert NumPy style docstrings to reStructuredText.
Class ​Token​Type Undocumented
Class ​Type​Docstring Convert natural language type strings to reStructuredText.
Function is​_google​_typed​_arg Is this string a valid type expression and/or google-style field name and type expression in parenthesis?
Function is​_obj​_identifier Is this string a Python object(s) identifier?
Function is​_type Is this string a type expression that can be parsed by TypeDocstring without generating any warnings?
Variable ​_bullet​_list​_regex Undocumented
Variable ​_directive​_regex Undocumented
Variable ​_enumerated​_list​_regex Undocumented
Variable ​_google​_section​_regex Undocumented
Variable ​_google​_typed​_arg​_regex Undocumented
Variable ​_numpy​_section​_regex Undocumented
Variable ​_single​_colon​_regex Undocumented
Variable ​_xref​_or​_code​_regex Undocumented
Variable ​_xref​_regex Undocumented
def is_google_typed_arg(string, parse_type=True):

Is this string a valid type expression and/or google-style field name and type expression in parenthesis?

Valid strings are like:

param (list(str), optional)
list(str), optional
ValueError

When parse_type=True (default), this multi-word field name and type is even recognized:

multiple words parameter (list(str), optional)
Parameters
string:strUndocumented
parse​_type:boolUndocumented
Returns
boolUndocumented
Note
Behave exactly like is_type if parse_type=False.
def is_obj_identifier(string):

Is this string a Python object(s) identifier?

An object identifier is a valid type string. But a valid type can be more complex than an object identifier.

Parameters
string:strUndocumented
Returns
boolUndocumented
def is_type(string):
Is this string a type expression that can be parsed by TypeDocstring without generating any warnings?
Parameters
string:strUndocumented
Returns
boolUndocumented
See Also
TypeDocstring
Note
Some string will be parsed without warnings even if is_type returns False.
_bullet_list_regex =

Undocumented

_directive_regex =

Undocumented

_enumerated_list_regex =

Undocumented

_google_section_regex =

Undocumented

_google_typed_arg_regex =

Undocumented

_numpy_section_regex =

Undocumented

_single_colon_regex =

Undocumented

_xref_or_code_regex =

Undocumented

_xref_regex =

Undocumented