numpydocstring module

Currently jupydocs works only with numpy doc strings. At this time some numpydoc strings may not work as expected because the library is still under development.

All markdown documentation below was generated using jupydocs.

NumpyDocString

Convert function docstrings into markdown documentation.

Parameters

NAMETYPEDESCRIPTION
functionfunctionA python function that has been documented using numpy styling
header_levelstr, optional[description], by default '##'

Attributes

NAMETYPEDESCRIPTION
docindexlistTBD
description_tbdtbd
functiontbdtbd
function_nametbdtbd
docstringtbdtbd
numpy_section_regextbdtbd
docstring_splittbdtbd
header_leveltbdtbd

Methods

Work in progress

Examples

Work in progress

NumpyDocString methods

create_doc_index

Create an index of the docstring.

Returns

TYPEDESCRIPTION
listA list of tuples, where each item in the list is a tuple with: (section_name, start_line, end_line).

find_section

A helper function that finds the section of docstring

Parameters

NAMETYPEDESCRIPTION
docstrThe docstring to be parsed.
section_keywordslistA list of keywords that identify the section

Returns

TYPEDESCRIPTION
(int, int)A tuple with the start and end line of the desired section.

parse_code_blocks

Identify and clean up code blocks.

Parameters

NAMETYPEDESCRIPTION
doclistThe docstring in list format, where each item in the list is a line in the doc string.

Returns

TYPEDESCRIPTION
listThe docstring with code strings formatted for markdown rendering.

parse_description

Parse the description section of a docstring.

Returns

TYPEDESCRIPTION
[type][description]

parse_generic

Parse generic sections

Parameters

NAMETYPEDESCRIPTION
keywords[type][description]

Returns

TYPEDESCRIPTION
[type][description]

parse_parameters

Parse the paramters section of a docstring.

Parameters

NAMETYPEDESCRIPTION
startintThe starting line of docstring section.
endintThe ending line of docstring section.

Returns

TYPEDESCRIPTION
strA string in markdown formatting.

parse_returns

Parse the return section of a docstring

Parameters

NAMETYPEDESCRIPTION
keywords[type][description]

Returns

TYPEDESCRIPTION
[type][description]

render_md

Render the docstring into a markdown format.

Parameters

NAMETYPEDESCRIPTION
return_strbool, optionalIf true will return a string instead of markdown, by default False.

Returns

TYPEDESCRIPTION
IPython.display.Markdown or strThe docstring rendered into markdown or a string.

render_class

Render an entire class into docstring markdown format

Parameters

NAMETYPEDESCRIPTION
objClassA python class object
return_strbool, optionalIf true will return a string instead of markdown, by default False.

Returns

TYPEDESCRIPTION
IPython.display.Markdown or strThe docstring rendered into markdown or a string.