AmadeusITGroup's Edison gives Python a real syntax tree for EDIFACT
Parsing EDIFACT in Python with syntax trees

Edison, an open-source Python library from AmadeusITGroup, parses EDIFACT messages as recursive syntax trees instead of flat segment lists. You define a schema in Python, and Edison compiles it into a state machine for parsing, validation, and pretty-printing. It supports versioned schemas, mandatory and repeatable groups, parsing callbacks, escaped separators, EBCDIC normalization, and pydot transition graphs. Requires Python 3.12+.
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.
- CharlesW
In case other HNers have also not heard of this: https://en.wikipedia.org/wiki/EDIFACT
- LouDNL
Really nice! I've been preparing to parse this for a possible customer in another language. Thanks for the insights.
- DonaldPShimoda
What is a "real" syntax tree? I wonder if the intent was "concrete" (the contrast to an abstract syntax tree), or if it's meant colloquially (as in "you really get a syntax tree" or "you get an actual syntax tree") rather than as a technical term.