Skip to content

parsers ¤

This module imports all the defined parsers.

Classes:

  • Parser

    Enumeration of the different docstring parsers.

Functions:

  • parse

    Parse the docstring.

Parser ¤


          flowchart TD
          griffe.docstrings.parsers.Parser[Parser]

          

          click griffe.docstrings.parsers.Parser href "" "griffe.docstrings.parsers.Parser"
          

Enumeration of the different docstring parsers.

Attributes:

  • google

    Google-style docstrings parser.

  • numpy

    Numpydoc-style docstrings parser.

  • sphinx

    Sphinx-style docstrings parser.

google class-attribute instance-attribute ¤

google = 'google'

Google-style docstrings parser.

numpy class-attribute instance-attribute ¤

numpy = 'numpy'

Numpydoc-style docstrings parser.

sphinx class-attribute instance-attribute ¤

sphinx = 'sphinx'

Sphinx-style docstrings parser.

parse ¤

parse(
    docstring: Docstring,
    parser: (
        Literal["google", "numpy", "sphinx"] | Parser | None
    ),
    **options: Any
) -> list[DocstringSection]

Parse the docstring.

Parameters:

  • docstring (Docstring) –

    The docstring to parse.

  • parser (Literal['google', 'numpy', 'sphinx'] | Parser | None) –

    The docstring parser to use. If None, return a single text section.

  • **options (Any, default: {} ) –

    The options accepted by the parser.

Returns: