Yet another XML to python object mapping, a la Django ORM


Keywords
XML, Schema, Object, to, Document, mapping
License
MIT
Install
pip install xml_orm==0.6.13

Documentation

XML ORM -- XML document to Python object mapping

This library is inspired by Django object to relation layer. XML document schemas are represented by Python classes with fields corresponding to nested elements and attributes. Document namespaces and encodings are stored as class Meta information. Object instances are transparently loaded from XML documents, with validation on load and save operations. Object-oriented approach allows reusing of schema elements by inheritance and overriding of XML elements and attributes represented by Python class members. XML namespaces, serialization an de-serialization to different encodings and optional schema validation are supported, along with most common XSD types to Python objects mapping. XSD inspection utility is provided for conversion of existing XSD schemas to Python objects (very much work in progress, but usable for simple schemas). Documentation is work in progress, mostly in Russian. For reference see source of test.py which showcases all current features.