merge_google_napoleon_docs

utilipy.utils.doc_parse_tools.merge_google_napoleon_docs(prnt_doc: Optional[str] = None, child_doc: Optional[str] = None, method: Union[typing_extensions.Literal[merge], typing_extensions.Literal[replace]] = 'replace')[source]

Merge two google-style docstrings into one google-napoleon docstring.

Given the google-style docstrings from a parent and child’s attributes, merge the docstring sections such that the child’s section is used, wherever present, otherwise the parent’s section is used.

Any whitespace that can be uniformly removed from a docstring’s second line and onwards is removed. Sections will be separated by a single blank line.

Aliased docstring sections are normalized. E.g Args, Arguments -> Parameters

Parameters
prnt_doc: Optional[str]

The docstring from the parent.

child_doc: Optional[str]

The docstring from the child.

method: {merge, replace}, optional

‘merge’ merges the sections. ‘replace’ (default) parent with child sections, if exists.

Returns
Union[str, None]

The merged docstring.