tags:

views:

152

answers:

3

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.)

A: 

You probably want to look at cElementTree.

Teddy
+1  A: 

Not a library but you would like it ;)

Problem Solving with Algorithms and Data Structures Using Python
Chapter 5 Trees Source Code
.

If your want to roll your own tree library then this will be helpful.

TheMachineCharmer
+2  A: 

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.

Alex Martelli