def class_from_name(module_name, class_name):
 m = importlib.import_module(module_name)
 c = getattr(m, class_name)
 return c

def class_from_name ( module_name , class_name ) : m = importlib . import_module ( module_name ) c = getattr ( m , class_name ) return c
adapted from URL .