Skip to content

ChenchaoZhao/groot

Repository files navigation

Groot

test License: MIT PyPI version

Manage hierarchical concept trees with style

Install

pip install i-am-groot

Goals

  • Save the trees in most compact format
  • Be able to load the trees from serialized files
  • List all nodes
  • List nodes on a given depth
  • List all atomic nodes

Example

import groot

tree = groot.Tree.from_yaml(serialized_file)
print(groot.utils.draw_tree(tree, show_level=True))

    0   1   2
    ┼───┼───┼
    a
    ├── a.a
    │   ├── a.a.b ■
    │   └── a.a.a ■
    ├── a.c ■
    └── a.b
        └── a.b.ab
    ├── b.a ■
    └── b.b

Documentation

Full documentation