I'm looking for the best way to go about subscripting a multi-layer Python dict with a string containing forward slashes to indicate sub keys. Currently I have something like this:
>>> data = {'some': {'key': 'value'}, 'foo': {'bar': 'pow'}} # data received from an external api
>>> field = 'some/key' # metadata path received from the same api
>>> for key in field.split('/'):
... data = data.get(key)
... print(data)
value