get_recursive

  • full name: tenpy.tools.misc.get_recursive

  • parent module: tenpy.tools.misc

  • type: function

tenpy.tools.misc.get_recursive(nested_data, recursive_key, separator='.')[source]

Extract specific value from a nested data structure.

Parameters
  • nested_data (dict of dict (-like)) – Some nested data structure supporting a dict-like interface.

  • recursive_key (str) – The key(-parts) to be extracted, separated by separator. A leading separator is ignored.

  • separator (str) – Separator for splitting recursive_key into subkeys.

Returns

For example, recursive_key="some.sub.key" will result in extracing nested_data["some"]["sub"]["key"].

Return type

entry

See also

set_recursive

same for changing/setting a value.

flatten

Get a completely flat structure.