Overview of the pyx12 API structure
masterThe pyx12 API is organized into several thematic groups to handle different stages of X12 processing. Depending on your goal, you will interact with different modules:
- Reading and Writing: Use
x12filefor streaming reader/writer operations,x12contextfor context-aware parsing (iterating loops and altering children), orrawx12filefor low-level stream access. - Data Modeling: Use
segmentfor the segment/composite/element model andpathfor XPath-style references into transactions. - Validation: Use
validationfor data element type checks,codesfor external code list lookups, anddataelefor the normalized data element catalog. - Mapping: Use
map_ifto load/traverse implementation guides,map_indexto locate maps, andmap_walkerto traverse map trees. - XML Conversion: Use
x12xmlorx12xml_simplefor rendering X12 to XML, andxmlx12_simplefor round-tripping simple XML back to X12. - Error Handling: Use
errorsfor exception classes,error_handlerto attach errors to the ISA/GS/ST hierarchy, anderror_htmlfor HTML error reports. - High-level Orchestration: Use
x12n_documentas the primary entry point for validating and emitting 997/999/HTML/XML,x12metadatafor extracting interchange/group/transaction metadata, andparamsfor runtime configuration.