class documentation

Convert Google style docstrings to reStructuredText. Parameters ---------- docstring : :obj:`str` or :obj:`list` of :obj:`str` The docstring to parse, given either as a string or split into individual lines. config: :obj:`sphinx.ext.napoleon.Config` or :obj:`sphinx.config.Config` The configuration settings to use. If not given, defaults to the config object on `app`; or if `app` is not given defaults to the a new :class:`sphinx.ext.napoleon.Config` object. Other Parameters ---------------- app : :class:`sphinx.application.Sphinx`, optional Application object representing the Sphinx process. what : :obj:`str`, optional A string specifying the type of the object to which the docstring belongs. Valid values: "module", "class", "exception", "function", "method", "attribute". name : :obj:`str`, optional The fully qualified name of the object. obj : module, class, exception, function, method, or attribute The object to which the docstring belongs. options : :class:`sphinx.ext.autodoc.Options`, optional The options given to the directive: an object with attributes inherited_members, undoc_members, show_inheritance and noindex that are True if the flag option of same name was given to the auto directive. Example ------- >>> from sphinx.ext.napoleon import Config >>> config = Config(napoleon_use_param=True, napoleon_use_rtype=True) >>> docstring = '''One line summary. ... ... Extended description. ... ... Args: ... arg1(int): Description of `arg1` ... arg2(str): Description of `arg2` ... Returns: ... str: Description of return value. ... ''' >>> print(GoogleDocstring(docstring, config)) One line summary. <BLANKLINE> Extended description. <BLANKLINE> :param arg1: Description of `arg1` :type arg1: int :param arg2: Description of `arg2` :type arg2: str <BLANKLINE> :returns: Description of return value. :rtype: str <BLANKLINE>

Method __init__ Undocumented
Method __str__ Return the parsed docstring in reStructuredText format.
Method lines Return the parsed lines of the docstring in reStructuredText format.
Method _consume_contiguous Undocumented
Method _consume_empty Undocumented
Method _consume_field Undocumented
Method _consume_fields Undocumented
Method _consume_indented_block Undocumented
Method _consume_inline_attribute Undocumented
Method _consume_returns_section Undocumented
Method _consume_section_header Undocumented
Method _consume_to_end Undocumented
Method _consume_to_next_section Undocumented
Method _consume_usage_section Undocumented
Method _dedent Undocumented
Method _escape_args_and_kwargs Undocumented
Method _fix_field_desc Undocumented
Method _format_admonition Undocumented
Method _format_block Undocumented
Method _format_docutils_params Undocumented
Method _format_field Undocumented
Method _format_fields Undocumented
Method _get_current_indent Undocumented
Method _get_indent Undocumented
Method _get_initial_indent Undocumented
Method _get_min_indent Undocumented
Method _indent Undocumented
Method _is_indented Undocumented
Method _is_list Undocumented
Method _is_section_break Undocumented
Method _is_section_header Undocumented
Method _load_custom_sections Undocumented
Method _lookup_annotation Undocumented
Method _parse Undocumented
Method _parse_admonition Undocumented
Method _parse_attribute_docstring Undocumented
Method _parse_attributes_section Undocumented
Method _parse_custom_generic_section Undocumented
Method _parse_custom_params_style_section Undocumented
Method _parse_custom_returns_style_section Undocumented
Method _parse_examples_section Undocumented
Method _parse_generic_section Undocumented
Method _parse_keyword_arguments_section Undocumented
Method _parse_methods_section Undocumented
Method _parse_notes_section Undocumented
Method _parse_other_parameters_section Undocumented
Method _parse_parameters_section Undocumented
Method _parse_raises_section Undocumented
Method _parse_receives_section Undocumented
Method _parse_references_section Undocumented
Method _parse_returns_section Undocumented
Method _parse_see_also_section Undocumented
Method _parse_usage_section Undocumented
Method _parse_warns_section Undocumented
Method _parse_yields_section Undocumented
Method _partition_field_on_colon Undocumented
Method _strip_empty Undocumented
Class Variable _name_rgx Undocumented
Instance Variable _annotations Undocumented
Instance Variable _app Undocumented
Instance Variable _config Undocumented
Instance Variable _directive_sections Undocumented
Instance Variable _is_in_section Undocumented
Instance Variable _lines Undocumented
Instance Variable _name Undocumented
Instance Variable _obj Undocumented
Instance Variable _opt Undocumented
Instance Variable _parsed_lines Undocumented
Instance Variable _section_indent Undocumented
Instance Variable _sections Undocumented
Instance Variable _what Undocumented
def __init__(self, docstring, config=None, app=None, what='', name='', obj=None, options=None): (source)

Undocumented

Parameters
docstring:str|list[str]Undocumented
config:SphinxConfig|NoneUndocumented
app:Sphinx|NoneUndocumented
what:strUndocumented
name:strUndocumented
obj:AnyUndocumented
options:AnyUndocumented
def __str__(self): (source)

Return the parsed docstring in reStructuredText format. Returns ------- unicode Unicode version of the docstring.

Returns
strUndocumented
def lines(self): (source)

Return the parsed lines of the docstring in reStructuredText format. Returns ------- list(str) The lines of the docstring in a list.

Returns
list[str]Undocumented
def _consume_contiguous(self): (source)

Undocumented

Returns
list[str]Undocumented
def _consume_empty(self): (source)

Undocumented

Returns
list[str]Undocumented
def _consume_field(self, parse_type=True, prefer_type=False): (source)

Undocumented

Parameters
parse_type:boolUndocumented
prefer_type:boolUndocumented
Returns
tuple[str, str, list[str]]Undocumented
def _consume_fields(self, parse_type=True, prefer_type=False, multiple=False): (source)

Undocumented

Parameters
parse_type:boolUndocumented
prefer_type:boolUndocumented
multiple:boolUndocumented
Returns
list[tuple[str, str, list[str]]]Undocumented
def _consume_indented_block(self, indent=1): (source)

Undocumented

Parameters
indent:intUndocumented
Returns
list[str]Undocumented
def _consume_inline_attribute(self): (source)

Undocumented

Returns
tuple[str, list[str]]Undocumented
def _consume_returns_section(self, preprocess_types=False): (source)

Undocumented

Parameters
preprocess_types:boolUndocumented
Returns
list[tuple[str, str, list[str]]]Undocumented
def _consume_section_header(self): (source)

Undocumented

Returns
strUndocumented
def _consume_to_end(self): (source)

Undocumented

Returns
list[str]Undocumented
def _consume_to_next_section(self): (source)

Undocumented

Returns
list[str]Undocumented
def _consume_usage_section(self): (source)

Undocumented

Returns
list[str]Undocumented
def _dedent(self, lines, full=False): (source)

Undocumented

Parameters
lines:list[str]Undocumented
full:boolUndocumented
Returns
list[str]Undocumented
def _escape_args_and_kwargs(self, name): (source)

Undocumented

Parameters
name:strUndocumented
Returns
strUndocumented
def _fix_field_desc(self, desc): (source)

Undocumented

Parameters
desc:list[str]Undocumented
Returns
list[str]Undocumented
def _format_admonition(self, admonition, lines): (source)

Undocumented

Parameters
admonition:strUndocumented
lines:list[str]Undocumented
Returns
list[str]Undocumented
def _format_block(self, prefix, lines, padding=None): (source)

Undocumented

Parameters
prefix:strUndocumented
lines:list[str]Undocumented
padding:str|NoneUndocumented
Returns
list[str]Undocumented
def _format_docutils_params(self, fields, field_role='param', type_role='type'): (source)

Undocumented

Parameters
fields:list[tuple[str, str, list[str]]]Undocumented
field_role:strUndocumented
type_role:strUndocumented
Returns
list[str]Undocumented
def _format_field(self, _name, _type, _desc): (source)

Undocumented

Parameters
_name:strUndocumented
_type:strUndocumented
_desc:list[str]Undocumented
Returns
list[str]Undocumented
def _format_fields(self, field_type, fields): (source)

Undocumented

Parameters
field_type:strUndocumented
fields:list[tuple[str, str, list[str]]]Undocumented
Returns
list[str]Undocumented
def _get_current_indent(self, peek_ahead=0): (source)

Undocumented

Parameters
peek_ahead:intUndocumented
Returns
intUndocumented
def _get_indent(self, line): (source)

Undocumented

Parameters
line:strUndocumented
Returns
intUndocumented
def _get_initial_indent(self, lines): (source)

Undocumented

Parameters
lines:list[str]Undocumented
Returns
intUndocumented
def _get_min_indent(self, lines): (source)

Undocumented

Parameters
lines:list[str]Undocumented
Returns
intUndocumented
def _indent(self, lines, n=4): (source)

Undocumented

Parameters
lines:list[str]Undocumented
n:intUndocumented
Returns
list[str]Undocumented
def _is_indented(self, line, indent=1): (source)

Undocumented

Parameters
line:strUndocumented
indent:intUndocumented
Returns
boolUndocumented
def _is_list(self, lines): (source)

Undocumented

Parameters
lines:list[str]Undocumented
Returns
boolUndocumented
def _is_section_break(self): (source)

Undocumented

Returns
boolUndocumented
def _is_section_header(self): (source)

Undocumented

Returns
boolUndocumented
def _load_custom_sections(self): (source)

Undocumented

def _lookup_annotation(self, _name): (source)

Undocumented

Parameters
_name:strUndocumented
Returns
strUndocumented
def _parse(self): (source)

Undocumented

def _parse_admonition(self, admonition, section): (source)

Undocumented

Parameters
admonition:strUndocumented
section:strUndocumented
Returns
list[str]Undocumented
def _parse_attribute_docstring(self): (source)

Undocumented

Returns
list[str]Undocumented
def _parse_attributes_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_custom_generic_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_custom_params_style_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_custom_returns_style_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_examples_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_generic_section(self, section, use_admonition): (source)

Undocumented

Parameters
section:strUndocumented
use_admonition:boolUndocumented
Returns
list[str]Undocumented
def _parse_keyword_arguments_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_methods_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_notes_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_other_parameters_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_parameters_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_raises_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_receives_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_references_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_returns_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_see_also_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_usage_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_warns_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _parse_yields_section(self, section): (source)

Undocumented

Parameters
section:strUndocumented
Returns
list[str]Undocumented
def _partition_field_on_colon(self, line): (source)

Undocumented

Parameters
line:strUndocumented
Returns
tuple[str, str, str]Undocumented
def _strip_empty(self, lines): (source)

Undocumented

Parameters
lines:list[str]Undocumented
Returns
list[str]Undocumented
_name_rgx = (source)

Undocumented

_annotations = (source)

Undocumented

Undocumented

Undocumented

_directive_sections: list[str] = (source)
_is_in_section: bool = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

_parsed_lines = (source)

Undocumented

_section_indent = (source)

Undocumented

Undocumented

Undocumented