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-0.0.2.tar.gz (5.7 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-0.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for visual-tree-0.0.2.tar.gz
Algorithm Hash digest
SHA256 aee10ccf3dfaa489bfff05f13ada97f27cde04badf3d1e81a79c34f2f6c00edd
MD5 f2564710fdbd5ecf58903b2d287482d2
BLAKE2b-256 2f5ecbed66372a844ea009e00870bcfb4fb6258f3d1bb812848ffeb013e44ed9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for visual_tree-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea30f50919585c5155a303fbd5e4cead9294285eba933016875a80ac336e0487
MD5 f22eea8410f0e5f8d2c5f18a6848dc9b
BLAKE2b-256 e81ad66d5c22ab887ba04d7e9e9e9c2809264c00c9815ad3740f620b91632487

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