obsplus.utils.docs module

Obsplus Utilities for documentation.

obsplus.utils.docs.compose_docstring(**kwargs)[source]

Decorator for composing docstrings.

This allows components of docstrings which are often repeated to be specified in a single place. Values provided to this function should have string keys and string or list values. Keys are found in curly brackets in the wrapped functions docstring and their values are substituted with proper indentation.

Notes

A function’s docstring can be accessed via the __docs__ attribute.

Examples

@compose_docstring(some_value=’10’) def example_function():

‘’’ Some useful description

The following line will be the string ‘10’: {some_value} ‘’’

obsplus.utils.docs.format_dtypes(dtype_dict)[source]

Convert a dictionary of datatypes to a string printable format for displaying in docstrings.

Parameters:

dtype_dict (Dict[str, Any]) – A dict of columns (keys) and values (dtypes).

Return type:

A string formatted for obsplus.utils.docs.compose_docstring().