Reputation: 1206
Looking for a python library to convert X12 (277U format) to CSV format. I Came across https://pypi.python.org/pypi/pyx12/2.1.1 but looks like it is converting X12 format to XML.. Please help
Upvotes: 2
Views: 6535
Reputation: 21661
No.
EDI is a hierarchical/multidimensional data format with repeating/looping structures. CSV is a two-dimensional data format that can represent repeating structures but will have a really hard time representing hierarchy or multidimensionality. This fact alone means there cannot be a standard/out of the box way to do this kind of transformation. Certain decisions have to be made as to what data will get flattened and how, or whether certain data will be ignored or repeated. Your end consumer may have documentation on this, but no standard tool would be able to figure it out for you.
It is, of course, possible to transform the 277 data into a CSV format for your ERP/CRM/whatever end system, but that involves parsing the EDI and doing custom logic on it. The linked package may help you do that but I'm not familiar with it. At the very least, it looks like it would help you validate the document and send a response back to your trading partner, but your mileage may vary...
Upvotes: 3