Are there any python libraries for data trees?
I mean a tree as a general data structure, not just an xml tree. (Like in this question, but in python.)
Are there any python libraries for data trees?
I mean a tree as a general data structure, not just an xml tree. (Like in this question, but in python.)
pypi, the Python Package Index, suggests tinytree, treedict, caxes, pyavl... these are just the top few after filtering away the many accidental hits (which point to specific tree such as XML ones, AST ones, etc, etc;-). If you clarify what you want to do with your trees it may be easier to suggest a specific package.
I'm happy with treelib. It addresses my problem. Could use a bit more documentation though. But the code is clear.
Although the ETE library seems to be originally developed to work with Phylogenetic trees, it implements many general features to work with any type of hierarchical tree structures, including programmatic tree drawing and visualization.
There is a comprehensive tutorial and a reference guide, in case you want to explore it.
python-graph seems to be a fairly thorough and complete package, and can export DOT graphs for use with Graphviz.
You probably want to look at cElementTree.