treelib icon indicating copy to clipboard operation
treelib copied to clipboard

An efficient implementation of tree data structure in python 2/3.

Results 88 treelib issues
Sort by recently updated
recently updated
newest added

>>> from treelib import Node, Tree >>> tree = Tree() >>> tree.create_node('Students', 'Students', parent=None) Node(tag=Students, identifier=Students, data=None) >>> tree.create_node('Ben', 'Ben',parent='Students') Node(tag=Ben, identifier=Ben, data=None) >>> tree.create_node('Annie', 'Annie',parent='Students') Node(tag=Annie, identifier=Annie, data=None) >>>...

Hello everyone! I am a fellow developer and I have developed a python package using this one on its core, for tree creation purposes. I have tested your package in...

When exporting to the graphviz dot format, the edge between nodes will always be "->" but when not exporting as "digraph" (but as undirected "graph"), the dot format requires the...

making use of the `.` and `=` in order to modify a node's identifier causes the node to disappear Ex: `tree["old_identifier"].identifier = "new_identifier " ` the code I used to...

Obviously, there is only one node for any nid.

Right now, I see .contains() on the tree will search the tree for a given node. Suppose I only want to search the immediate children of a node? Based on...

enhancement

Good evening everyone. I would like some assistance on a specific matter of treelib's tree. Lets assume that I am having the following code: ``` from treelib import Tree,Node tree...

question

Hi, I am using a fair amount of trees (on some evolutionary computing task) and I find misself with some memory leak, I've traced the problem down to treelib's `deepcopy`....

Not sure if this is already possible, but I at least didn't see anything in the documentation. Something like... json_tree = #Json object here t = Tree(json_tree)

enhancement

Is there a way to add weight to edges using treelib? Something similar to: https://anytree.readthedocs.io/en/latest/tricks/weightededges.html

enhancement