entry = self.companies
for path in options['path']: # options['path'] == ['up', 'middle', 'down']
entry = entry[path] # Нужно получить объект: self.companies['up']['middle']['down'] и изменить его
entry = options['value']
entry = self.companies
entries = {}
for index, path in enumerate(options['path']): # options['path'] == ['up', 'middle', 'down']
if index == 0:
entries[index] = entry[path]
else:
entries[index] = entries[index - 1][path]
path_length = len(options['path'])
entries[path_length - 2][options['path'][path_length - 1]] = options['value']