Project description

Yet Another XML parser is a powerful event-based memory-efficient Python module.
It analyses the XML stream node by node and builds subtrees only if it is really needed.

In case of record-oriented XML input (when some subtree structure is repeated many times),
it processes the file in a sequential manner similar to that of SAX.
However, conditions can be defined which trigger a DOM like processing where subtrees are created.

This method is also efficient on very large data (which do not fit into the memory)
both in terms of storage and computational time complexity.

Dependencies

YAX uses Python 3.x and above. It doesn’t depend on any third party module.
However, if you have lxml installed you can use it as back-end.
(See the documentation about performance.)

Installation

Download as a zip archive, uncompress and use it.

pip3 install yax

(Soon…) Downolad the deb package and install it.

Usage

A simple example which prints all the elements with tagname “a” and containing “href” attribute:

This example shows that it would be erease all unneccessary children from the subtree
to save memory but in this case we need the child called “ele”.
For more example or the complete reference see the documentation.