docstripy.rest#

docstripy.rest.build_doc#

Docstring building functions for numpy style.

build_doc_rest(current_docstring, sections_dict, max_len, indent, *, include_type=True)#

Build docstring for rest style.

Return type:

List[str]

build_section_params_rest(param_dicts, max_len, indent, section_name, *, include_type=True)#

Build parameters, returns, raises, and attributes sections for google style.

Return type:

List[str]

docstripy.rest.parse_doc#

Parser for ReST style docstrings.

parse_params(lines, section_name='param', pattern_type='type')#

Parse parameter section from reStructuredText format.

Parameters:
  • lines (List[str]) – Lines of docstring.

  • section_name (str, optional) – Name of the section, one of “param”, “return”, “attribute”, “raises”. It is also the pattern before element name for description: :<pattern> name: <description>. By default, “param”.

  • pattern_type (str, optional) – Pattern before element name for type: :<pattern> name: <type>. By default, “type”.

Return type:

List[dict]

parse_sections_ranges(lines)#

Parse reStructuredText sections to the docstring.

Return type:

Dict