def pathGet(dictionary, path):
    for item in path.split('/'):
        dictionary = dictionary[item]
return dictionary

def pathSet(dictionary, path, setItem):
    path = path.split('/')
key = path[-1]
dictionary = pathGet(dictionary, '/'.join(path[:-1]))
dictionary[key] = setItem
Хранение пути к словарю в Python