def import_attribute(name):
    path, attr = name.rsplit('.', 1)
    module = __import__(path, globals(), locals(), [attr])

    return getattr(module, attr)
Import attribute using string reference.
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tools.py/import_attribute