Skip to main content

visualize the tree structure of any recursable object in python

Project description

Visual Tree Python Package

Introduction

this is a simple tool to visualize the tree structure of any recursable object in python.

Installation

pip install visual-tree

Usage

from visual_tree import build_tree
tree = build_tree(data_structure)

# print the data_structure
print(tree)

# print the tree directly
tree()

# get the tree as a string (member of tree)
tree.tree

# get the tree as a list of strings (__iter__)
list(tree)

Example

look at the example.py file for more examples.

requirements

  • python needs to be installed
  1. data structure with __iter__ (better with __len__ also)
  2. data structure with __bool__
  3. data structure with __str__

or

  1. instand of __iter__ you can use other extending methods pass with mkchild parameter
  2. instand of __bool__ you can use other extending methods pass with valid parameter

License

Apache License 2.0 (see LICENSE file)

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

visual-tree-1.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

visual_tree-1.0.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file visual-tree-1.0.1.tar.gz.

File metadata

  • Download URL: visual-tree-1.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for visual-tree-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cd819890a6f528b7065f0af337f5d57f5ecd086663cd2950e1c09303fc827f89
MD5 b4719dcf77a94b3af8cf1dc1fbcefdb3
BLAKE2b-256 bf5881e78f4b595fcb144503bbcba015a02d5740c6a17ae84078da172c946196

See more details on using hashes here.

File details

Details for the file visual_tree-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: visual_tree-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for visual_tree-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 755ef678492aa89ba1e1f8a61bc1e7cfcd15564cb2548fe7e92567ce42508341
MD5 8572b82baddab4b5d3948925e897165c
BLAKE2b-256 9ea058830076b826bea2a0328994437290a42117c4f03a0f7d4a51dec5b83eee

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