sherlockpipe.loading.common

Functions

extract_custom_class(module_path)

Given a module path, it loads it dynamically and extracts its inner class, assuming that the module and the class have the same name.

get_from_dict(target, key)

Given a target dictionary, it retrieves the value associated to a key

get_from_dict_or_default(target, key, default)

This method does the same get_from_user(), but returns a default value if the key had none.

get_from_user_or_config(target, ...)

Given the root user_properties dictionary and the specific target dictionary, it loads the property with name key iteratively: first tries to load the value from user_properties, then it tries to load it from target.

get_from_user_or_config_or_default(target, ...)

This method does the same as get_from_user_or_config() but also returns a default value if no value was found associated to the given key

load_from_yaml(file)

Loads a yaml file into a dictionary

load_module(module_path)

Allows the dynamic load of a python module into the system