Amara XML

| | Comments (0) | TrackBacks (0)
This thing is sweet; it's a pythonic xml binding. You know, for python to read and use XML with.
You can slurp in a whole xml file or process by user-defined record-chunks. Attributes and child elements are dot-properties of the document root. Text containers assign-to and stringify sensibly. Using a whole document's bindings to have it around and editable is turning out not to be fast enough at work - I'm talking about creating thousands of python objects in memory in order to bind to a complete video game world file in reasonable time.

The things I'm having trouble with are:
  • preserving attribute order (element/record order seems preserved ok)
  • preserving text nodes in badly written XML from a vendor that contain embedded (illegal!) html entities that describe utf-8 characters - amara loves to transform everything into unicode, so I lose these and have to do bookkeeping on them.
  • speed. now that I want my prototypes to work with every file in the game, it seems unreasonable. Uche's own benchmarks don't show Amara particularly ahead of the curve (about 3x slower than cElementTree in a non-scientific test)

0 TrackBacks

Listed below are links to blogs that reference this entry: Amara XML.

TrackBack URL for this entry: http://skull.piratehaven.org/~epu/mt/mt-tb.cgi/37

Leave a comment

Recent Tweets