def value_for_keypath(dict, keypath):

    if len(keypath) == 0:
        return dict

    keys = keypath.split('.')
    value = dict
    for key in keys:
        if key in value:
            value = value[key]
        else:
            return None

    return value
Returns the value of a keypath in a dictionary
dataset/ETHPy150Open ambitioninc/django-query-builder/querybuilder/helpers.py/value_for_keypath