package documentation

Support for NumPy and Google style docstrings.

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Module docstring sphinx.ext.napoleon.docstring ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module iterators sphinx.ext.napoleon.iterators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From __init__.py:

Class ​Config Sphinx napoleon extension settings in conf.py.
Function ​_patch​_python​_domain Undocumented
Function ​_process​_docstring Process the docstring for a given python object.
Function ​_skip​_member Determine if private and special class members are included in docs.
Function setup Sphinx extension setup function.
def setup(app):

Sphinx extension setup function.

When the extension is loaded, Sphinx imports this module and executes the setup() function, which in turn notifies Sphinx of everything the extension offers.

Parameters

app : sphinx.application.Sphinx
Application object representing the Sphinx process
Parameters
app:SphinxUndocumented
Returns
Dict[str, Any]Undocumented
def _patch_python_domain():

Undocumented

def _process_docstring(app, what, name, obj, options, lines):

Process the docstring for a given python object.

Called when autodoc has read and processed a docstring. lines is a list of docstring lines that _process_docstring modifies in place to change what Sphinx outputs.

The following settings in conf.py control what styles of docstrings will be parsed:

  • napoleon_google_docstring -- parse Google style docstrings
  • napoleon_numpy_docstring -- parse NumPy style docstrings

Parameters

app : sphinx.application.Sphinx
Application object representing the Sphinx process.
what : str
A string specifying the type of the object to which the docstring belongs. Valid values: "module", "class", "exception", "function", "method", "attribute".
name : str
The fully qualified name of the object.
obj : module, class, exception, function, method, or attribute
The object to which the docstring belongs.
options : sphinx.ext.autodoc.Options
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.
lines : list of str

The lines of the docstring, see above.

Note

lines is modified in place

Parameters
app:SphinxUndocumented
what:strUndocumented
name:strUndocumented
obj:AnyUndocumented
options:AnyUndocumented
lines:List[str]Undocumented
def _skip_member(app, what, name, obj, skip, options):

Determine if private and special class members are included in docs.

The following settings in conf.py determine if private and special class members or init methods are included in the generated documentation:

  • napoleon_include_init_with_doc -- include init methods if they have docstrings
  • napoleon_include_private_with_doc -- include private members if they have docstrings
  • napoleon_include_special_with_doc -- include special members if they have docstrings

Parameters

app : sphinx.application.Sphinx
Application object representing the Sphinx process
what : str
A string specifying the type of the object to which the member belongs. Valid values: "module", "class", "exception", "function", "method", "attribute".
name : str
The name of the member.
obj : module, class, exception, function, method, or attribute.
For example, if the member is the __init__ method of class A, then obj will be A.__init__.
skip : bool
A boolean indicating if autodoc will skip this member if _skip_member does not override the decision
options : sphinx.ext.autodoc.Options
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.

Returns

bool
True if the member should be skipped during creation of the docs, False if it should be included in the docs.
Parameters
app:SphinxUndocumented
what:strUndocumented
name:strUndocumented
obj:AnyUndocumented
skip:boolUndocumented
options:AnyUndocumented
Returns
boolUndocumented