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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dictDigUtils-1.0.3.tar.gz.
File metadata
- Download URL: dictDigUtils-1.0.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0803098d057a0d5ce32893389c0c903747a1c33cfdc756dfa80648c8bc98939e
|
|
| MD5 |
a339d8dbe2e792cf537300dbf6e41aa7
|
|
| BLAKE2b-256 |
58bee2fa823c69d692ebb8ac8ba7da7d61ee673f31309578ad19d2dcc5dee7b8
|
File details
Details for the file dictDigUtils-1.0.3-py3-none-any.whl.
File metadata
- Download URL: dictDigUtils-1.0.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ffd42d65fd05f6b7fe29523363a0ca37567256e81dae3f25332d39db6c4e8ea
|
|
| MD5 |
d448028be4a5cc276bae05de8b6fae1e
|
|
| BLAKE2b-256 |
d1b24e40fb1ce3b82e03e3699e9bb3ec29a5cb7870232f3beec35727f0e38089
|