utils Module

Factory

register_class(class_obj)

Registers a class with the class factory dictionary.

unregister_class(class_name)

Removes a class from the class factory dictionary thus making it unavaialble for dynamic instantiation.

get_registered_class(class_name)

Retrieves a class object from the class factory by name.

registered_classes()

Convenience function to inspect the dictionary of registered classes.

Check Utilities

check_key(key, dict_info, context, …[, …])

Checks if a key is in a dictionary dict_info and raises a customized exception message with better context.

check_type(value, to_type, context, …[, …])

Checks if a value is of a certain type and raises a customized exception message with better context.

check_options(value, options, context, …)

Checks if a value is in a list of allowed options.

YAML Utilities

load_yaml_with_include(file_name)

Loads a YAML file safely and returns a dictionary with the configuration data.