No project description provided
Project description
dict dig utils
Some functionality would be quite comfortable to manipulate dicts, and that we do not have to write them all the time. Perhaps they already exist, but for any case, here is a simple version of them for myself.
flattening
First thing is to turn keys into a flattened string, like
- key1
- key2
- key3
- key2
turns to key1/key2/key3 Then texts can be easily searched in keys and values withuot transversing the whole structure
display
a simple printing function that indents with the levels of the dict may be intuitive to see what is in a dict.
search for a key
within the whole tree, and return whatever element is found under it in a list, allowing for multiple keys. It searches text in the key, thus using the in operator.
list keys
run through recursively, and give a list of keys from within. This is useful for complex, deep dict trees, when one has no idea where to find a specific key, or how it is spelled.
redisplay depth
after coming back from a deeper dict, display the current depth again
lists
use lists as lists with a serial index along enumerate of the list in dict_disp()
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
Built Distribution
Hashes for dictDigUtils-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffd42d65fd05f6b7fe29523363a0ca37567256e81dae3f25332d39db6c4e8ea |
|
MD5 | d448028be4a5cc276bae05de8b6fae1e |
|
BLAKE2b-256 | d1b24e40fb1ce3b82e03e3699e9bb3ec29a5cb7870232f3beec35727f0e38089 |