Closed mj0nez closed 1 year ago
Parser
are now configurable by injecting a Character
instance during object creation.Parser
instance is now an optional argument to Interchange.from_str
and Interchang.from_file
and reusable:parser = Parser(characters=Characters.from_str("UNA:+.? '"))
edi = (
"UNB+UNOC:1+1234+3333+200102:2212+42'"
"UNH+42z42+PAORES:93:1:IA'"
"UNT+2+42z42'"
"UNZ+1+42'"
)
interchange = Interchange.from_str(edi, parser=parser)
assert edi.characters.decimal_point == "."
Creating an Interchange
without a parser is still possible, but uses the pydifact default character set:
interchange = Interchange.from_str(edi)
assert edi.characters.decimal_point == ","
SegmentFactory
AbstractSegmentContainer
and Interchange
.
PR for #58