| ▲ | alexprengere 2 days ago | |
Edison is a Python library for parsing EDIFACT messages. Instead of treating a message as a flat list of segments, it models messages as a syntax tree: segments can define groups of child segments, recursively. You define the syntax tree once, then parse, validate, or pretty-print messages against that structure. It works by converting the syntax tree to a state machine of possible transitions between segments. | ||
| ▲ | nurettin 29 minutes ago | parent [-] | |
Once you know the tree, edi is trivial to parse. You can even do it with a loop and a state to store which level has which tag and what the current count is. The real challenge was to discover what the tree was. Like wayfair order listings, cargo delivery messages, which are also similar to how Rhenus does them. Every vendor has their own format and standards. | ||