tsdat.config.utils

Module Contents

Functions

configure_yaml()

Configure yaml to automatically substitute environment variables

instantiate_handler(*args, handler_desc: Dict = None) → Union[object, List[object]]

Class to instantiate one or more classes given a dictionary containing

_instantiate_class(*args, **kwargs)

Instantiates a python class given args and kwargs.

_parse_fully_qualified_name(fully_qualified_name: str) → Tuple[str, str]

Splits a fully qualified name into the module name and the class name.

tsdat.config.utils.configure_yaml()

Configure yaml to automatically substitute environment variables referenced by the following syntax: ${VAR_NAME}

tsdat.config.utils.instantiate_handler(*args, handler_desc: Dict = None)Union[object, List[object]]

Class to instantiate one or more classes given a dictionary containing the path to the class to instantiate and its parameters (optional). This method returns the handle(s) to the instantiated class(es).

Parameters

handler_desc (Dict, optional) – The dictionary containing at least a classname entry, which should be a str that links to a python module on the PYTHONPATH. The handler_desc can also contain a parameters entry, which will is passed as a keyword argument to classes instantiated by this method. This parameter defaults to None.

Returns

The class, or list of classes specified by the handler_desc

Return type

Union[object, List[object]]

tsdat.config.utils._instantiate_class(*args, **kwargs)

Instantiates a python class given args and kwargs.

Returns

The python class.

Return type

object

tsdat.config.utils._parse_fully_qualified_name(fully_qualified_name: str)Tuple[str, str]

Splits a fully qualified name into the module name and the class name.

Parameters

fully_qualified_name (str) – The fully qualified classname.

Returns

Returns the module name and class name.

Return type

Tuple[str, str]