getnested#

getnested(nested, keylist, safe=False)[source]#

Get the value for the given list of keys

Parameters:
  • nested (any) – the nested object (dict, list, or object) to get from

  • keylist (list) – the list of keys

  • safe (bool) – whether to return None if the key is not found

Example:

sc.getnested(foo, ['a','b']) # Gets foo['a']['b']

See sc.makenested() for full documentation.