Is there a way to save a python dict structure in config then access it?
For example:
dict = {'root': {'category': {'item': 'test'}}}
# in my config
key = 'some string here'
print (dict[key])
# output
>> test
Solution thanks to answers below:
from functools import reduce
import json
dict = {'root': {'category': {'item': 'test'}}}
# you can put this in your config.ini file
map = '["root", "category", "item"]'
print (reduce(lambda d, k: d[k], json.loads(map), dict))
#output
test