from importlib import import_module


def get_class_from_route(route):
    """
    From a Python class path in string format, returns the class
    """
    values = route.split('.')
    module = import_module('.'.join(values[:-1]))
    cl = getattr(module, values[-1])
    return cl