class NumpyDocstring(GoogleDocstring): (source)
Convert NumPy 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. ... ... Parameters ... ---------- ... arg1 : int ... Description of `arg1` ... arg2 : str ... Description of `arg2` ... Returns ... ------- ... str ... Description of return value. ... ''' >>> print(NumpyDocstring(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> Methods ------- __str__() Return the parsed docstring in reStructuredText format. Returns ------- str UTF-8 encoded version of the docstring. __unicode__() Return the parsed docstring in reStructuredText format. Returns ------- unicode Unicode version of the docstring. lines() Return the parsed lines of the docstring in reStructuredText format. Returns ------- list(str) The lines of the docstring in a list.
Method | __init__ |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _escape |
Undocumented |
Method | _get |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _parse |
Derived from the NumpyDoc implementation of _parse_see_also. |
Method | _parse |
Undocumented |
Instance Variable | _directive |
Undocumented |
Inherited from GoogleDocstring
:
Method | __str__ |
Return the parsed docstring in reStructuredText format. |
Method | lines |
Return the parsed lines of the docstring in reStructuredText format. |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _consume |
Undocumented |
Method | _dedent |
Undocumented |
Method | _fix |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _format |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _indent |
Undocumented |
Method | _is |
Undocumented |
Method | _is |
Undocumented |
Method | _load |
Undocumented |
Method | _lookup |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _partition |
Undocumented |
Method | _strip |
Undocumented |
Class Variable | _name |
Undocumented |
Instance Variable | _annotations |
Undocumented |
Instance Variable | _app |
Undocumented |
Instance Variable | _config |
Undocumented |
Instance Variable | _is |
Undocumented |
Instance Variable | _lines |
Undocumented |
Instance Variable | _name |
Undocumented |
Instance Variable | _obj |
Undocumented |
Instance Variable | _opt |
Undocumented |
Instance Variable | _parsed |
Undocumented |
Instance Variable | _section |
Undocumented |
Instance Variable | _sections |
Undocumented |
Instance Variable | _what |
Undocumented |