caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
812 stars 186 forks source link

Load tree from json #78

Closed yalopov closed 6 years ago

yalopov commented 7 years ago

Is there any way to restaure, load,or parse a tree from json, string or file?

After all we already have those methods for to save an existing tree object, it would be useful.

Thanks for your work

ocervell commented 6 years ago

This would be great if someone could implement it. For large trees, recreating the tree everytime is really slow, making it impossible to do live-updates ... I use treelib to create a JSTree that is consumed by a web interface, the tree is 170k+ nodes and re-creating it takes a while (7 minutes).

athulmurali commented 6 years ago

Yup. It's a great idea. I would love to work on it. This might be greatly helpful for crawling web trees.

ocervell commented 6 years ago

Yes, as well as dynamically changing some node attributes and re-saving the tree to the file, without having to recompute everything. Let me know if you need help on this. EDIT: I see there is already a pull request for this, see #73

caesar0301 commented 6 years ago

Dup #85