dynamically load a class from a string

    http://thomassileo.com/blog/2012/12/21/dynamically-load-python-modules-or-classes/

def load_class(full_class_string):
    """
    dynamically load a class from a string

    http://thomassileo.com/blog/2012/12/21/dynamically-load-python-modules-or-classes/
    """
    class_parts = full_class_string.split(".")
    module_path = ".".join(class_parts[:-1])
    class_name = class_parts[-1]

    module = importlib.import_module(module_path)

    return getattr(module, class_name)