typedargs.doc_annotate module

Routines for extracting parameter and return information from a docstring.

Summary

Functions:

parse_docstring Parse a docstring into ParameterInfo and ReturnInfo objects.

Reference

typedargs.doc_annotate.parse_docstring(doc, validate_type=True)[source]

Parse a docstring into ParameterInfo and ReturnInfo objects.

Parameters:
  • doc (str) – docstring to parse
  • validate_type (bool) – True if ValidationError should be raised where type is not specified for arg or return value.
Returns:

type information from passed docstring

Return type:

Tuple[Dict[str, ParameterInfo], Union[ReturnInfo, None]]