atpthings.dict.get_keys#

atpthings.dict.get_keys(dict_: dict, keys: list) dict#

Get keys from dictionary.

Parameters:
dict_dict

Dictionary.

keyslist

List of keys to be extracted.

Returns:
dict

Dictionary with only specificated keys.

Examples

>>> dict_in = {"one": 1, "two": 2, "three": 3}
>>> keys_list = ["one", "three"]
>>> atpthings.util.dictionary.get_keys(dict_in, keys_list)
>>> {'one': 1, 'three': 3}