Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dictDigUtils-1.0.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dictDigUtils-1.0.3-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for dictDigUtils-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0803098d057a0d5ce32893389c0c903747a1c33cfdc756dfa80648c8bc98939e
MD5 a339d8dbe2e792cf537300dbf6e41aa7
BLAKE2b-256 58bee2fa823c69d692ebb8ac8ba7da7d61ee673f31309578ad19d2dcc5dee7b8

See more details on using hashes here.

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

Hashes for dictDigUtils-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7ffd42d65fd05f6b7fe29523363a0ca37567256e81dae3f25332d39db6c4e8ea
MD5 d448028be4a5cc276bae05de8b6fae1e
BLAKE2b-256 d1b24e40fb1ce3b82e03e3699e9bb3ec29a5cb7870232f3beec35727f0e38089

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page