DDEX Reader for Python
This project allows you to read DDEX files into friendly Python data types. XML files are decoded using the PyXB library.
Keep in mind that this is a fairly low level library that only aims at making DDEX files easier to read using Python. Some DDEX data structures expose lists containing only one element, and some value like UpdateIndicator are not cast as booleans.
- Free software: MIT license
- Documentation: https://ddexreader.readthedocs.org.
- Repository: https://github.com/Trax-air/ddexreader
- Open an XML file into a DDEX data structure generated by pyxb corresponding to the DDEX version.
- Parse this DDEX data structure into a Python dict.
Supported DDEX versions
- 3.2 (untested)
Version 3.7 is causing issues with PyXB.
from ddexreader import open_ddex, ddex_to_dict xml_path = '/path/to/my/ddex_file.xml' ddex = open_ddex(xml_path) ddex_dict = ddex_to_dict(ddex)
How to add more DDEX definitions
After installing pyxb on your (unix) system, enter:
pyxbgen -u [the url to the definition file]