pyufunc.dict_get_by_path#

pyufunc.dict_get_by_path(mapping, key_path, default=None, *, separator='.')#

Get a nested dictionary value by key path.

Parameters:
  • mapping – Source mapping.

  • key_path – Key path to read.

  • default – Value returned when the path is missing.

  • separator – Key path separator.

Note

Example

>>> dict_get_by_path({"a": {"b": 1}}, "a.b")
1
Returns:

Value at key_path or default.

Return type:

Any