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
Source package:
python-benedict.Source repository: fabiocaccamo/python-benedict
Source document: fabiocaccamo/python-benedict
Source license: MIT License.
Example
>>> dict_get_by_path({"a": {"b": 1}}, "a.b") 1
- Returns:
Value at
key_pathordefault.- Return type:
Any