Skip to main content

'dtree': Linux 'tree' but for dictionaries

Project description

dtree: Linux tree but for dictionaries

Dictionaries are fun and useful!. But just like a folder structure, they can be multitiered storing all kinds of things in nested hierarchies. tree is a Linux utility that prints the multilevel structure of directories as a beautiful tree. dtree does the same but for dictionaries.

Example

Consider the following dictionary

dictionary = { "A": { "B": { "C": 0, "D": "some-string" }, "E": None }, "F": { "G": 0.0, "H": set([]) } }

Using dtree you can print the tree structure in different ways:

Demo

Known limitations

This version currenly prints the str representation of the dictionary keys for the nodes of the tree. When keys are custom class objects, printing them could be very verbose so that would cause issues with the printed tree. I'll fix this in future PRs.

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

dtree-metalcycling-0.0.0.tar.gz (147.7 kB view details)

Uploaded Source

Built Distribution

dtree_metalcycling-0.0.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file dtree-metalcycling-0.0.0.tar.gz.

File metadata

  • Download URL: dtree-metalcycling-0.0.0.tar.gz
  • Upload date:
  • Size: 147.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for dtree-metalcycling-0.0.0.tar.gz
Algorithm Hash digest
SHA256 df61ea70363ab38a5ccf4cebc9ac3adb6844a306e98e79e5201abadfe5f14dfc
MD5 76bd10f61b88868ff0058a30a1b356c7
BLAKE2b-256 b673c0d6b21b2f7099a51e6969b0c417fd401384067ee65fab3fc3af0cc1fcd4

See more details on using hashes here.

Provenance

File details

Details for the file dtree_metalcycling-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dtree_metalcycling-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55c5fa2ca89d137fea37af964a0fcfb2e2241f529d302c18579f1f3254e76b58
MD5 d041ba0b013217ee4b1ccda59a557837
BLAKE2b-256 fad159ea4e9eb29eab7f5144e80fb223409144dad8e8f6593d2d0b53fcc7ef40

See more details on using hashes here.

Provenance

Supported by

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