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 details)
File details
Details for the file dict_digger-0.1.1.tar.gz
.
File metadata
- Download URL: dict_digger-0.1.1.tar.gz
- Upload date:
- Size: 1.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de05951de8a0e862bd597cf5755a5e037bced6db38f31254f16958d70b41da33 |
|
MD5 | 10152038b0f8d35faf6885ee80cb21d1 |
|
BLAKE2b-256 | 11d392f82a91bc89153bc5b9477d7498c863c43fdd38c773e37789daec617f8c |