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 | FreeFormException |
Exception to encapsulate the converted lines when numpy-style fields get treated as free form. |
Class | GoogleDocstring |
Convert Google style docstrings to reStructuredText. |
Class | NumpyDocstring |
Convert NumPy style docstrings to reStructuredText. |
Class | TokenType |
Undocumented |
Class | TypeDocstring |
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 |
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:str | Undocumented |
parse_type:bool | Undocumented |
Returns | |
bool | Undocumented |
Note | |
Behave exactly like is_type if parse_type=False. |
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:str | Undocumented |
Returns | |
bool | Undocumented |
TypeDocstring
without generating any warnings?Parameters | |
string:str | Undocumented |
Returns | |
bool | Undocumented |
See Also | |
TypeDocstring | |
Note | |
Some string will be parsed without warnings
even if is_type returns False . |