Usage
Add structured information to the end of your python docstrings.
- parse_docdata(obj: X | None = None, *, delimiter: str = '---', formatter: Callable[[Any], str] | None = None) X | Callable[[X], X][source]
Parse the structured data from the end of the docstr and store it in
__docdata__.The data after the delimiter should be in the YAML form. It is parsed with
yaml.safe_load()then stored in the__docdata__field of the object.- Parameters:
obj – Any object that can has a
__doc__field.delimiter – The delimiter between the actual docstring and structured YAML.
formatter – A function that takes the parsed docdata and turns it into more documentation
- Returns:
The same object with a modified docstr.
- Raises:
AttributeError – if the object has no
__doc__field.