Dict Helpers¶
-
basic_utils.dict_helpers.
get_keys
(d, keys, default=None)[source]¶ Returns multiple values for keys in a dictionary
Empty key values will be None by default
>>> d = {'x': 24, 'y': 25} >>> get_keys(d, ('x', 'y', 'z')) (24, 25, None)
Return type: Tuple
-
basic_utils.dict_helpers.
get_in_dict
(d, keys)[source]¶ Retrieve nested key from dictionary
>>> d = {'a': {'b': {'c': 3}}} >>> get_in_dict(d, ('a', 'b', 'c')) 3
Return type: Any