Welcome to nodestack’s documentation!¶
Note
This project is under active development.
Nodestack¶
Nodestack is a library that allows user to build structured trees of datas.
Project is under active development. Have a look at the repository for usage. Feel free to push patches.
Content:¶
Installation:¶
(venv) $ git clone https://gitea.lutix.org/ftg/nodestack.git
or
(venv) $ pip install nodestack
Source code is hosted on my own instance of gitea.
Basic Usage:¶
import nodestack
class Person(nodestack.Node):
pass
bob = Person('Bob')
eve = Person('Eve')
alice = Person('Alice')
alice_again = Person('Alice') # will raise an error
# Alice is parent of bob and eve
alice.add_child(bob)
alice.add_child(eve)
alice.pretty_print()
Alice
-- Bob
-- Eve