Useful syntax for digging into nested dictionaries, and removes the need to check if a key exists
Project description
Digs into Dicts
Useful syntax for digging into nested dictionaries, and removes the need to check if a key exists
Installation
$ pip install
Usage
import dict_digger
h = {
'a': {
'b': 'tuna',
'c': 'fish'
},
'b': {}
}
result = dict_digger.dig(h, 'a','b')
print result # prints 'tuna'
result = dict_digger.dig(h, 'c','a')
print result # prints None
# Important!! Does not through an error, just returns None
Testing
We are using nose
$ nosetests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dict_digger-0.1.1.tar.gz
(1.3 kB
view hashes)