Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notpeter/edicat
Print and concatenate X12 and Edifact EDI
https://github.com/notpeter/edicat
edi edifact newline x12
Last synced: 2 months ago
JSON representation
Print and concatenate X12 and Edifact EDI
- Host: GitHub
- URL: https://github.com/notpeter/edicat
- Owner: notpeter
- License: mit
- Created: 2017-10-26T16:36:46.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2024-08-04T01:01:06.000Z (5 months ago)
- Last Synced: 2024-10-04T20:46:28.668Z (3 months ago)
- Topics: edi, edifact, newline, x12
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 18
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Electronic-Interchange-Github-Resources - notpeter/edicat - Print and concatenate X12 and Edifact EDI (CLI utilities / Golang)
README
# edicat: Print and transform EDI
![pypi-version](https://img.shields.io/pypi/v/edicat.svg)
## Why?
EDI often does not include newlines which makes it incompatible with
normal UNIX tools that operate on a line-by-line basis. So we do some
simple detection of the segment terminator and append newlines as required.## Install
```
pip3 install -U edicat
```## Usage
```shell
$ edicat --help
usage: edicat [-n] [filenames [filenames ...]]Print and concatenate EDI.
positional arguments:
filenames Filename(s) or - for stdinoptional arguments:
-n, --lineno Number the output lines, starting at 1.
```## Examples
Simple cat:
```shell
$ cat edi850_sample.txt
ISA*00* *00* *01*0011223456 *01*999999999 *950120*0147*U*00300*000000005*0*P*^~GS*PO*0011223456*999999999*950120*0147*5*X*003040~ST*850*000000001~BEG*00*SA*95018017***950118~N1*SE*UNIVERSAL WIDGETS~N3*375 PLYMOUTH PARK*SUITE 205~N4*IRVING*TX*75061~N1*ST*JIT MANUFACTURING~N3*BUILDING 3B*2001 ENTERPRISE PARK~N4*JUAREZ*CH**MEX~N1*AK*JIT MANUFACTURING~N3*400 INDUSTRIAL PARKWAY~N4*INDUSTRIAL AIRPORT*KS*66030~N1*BT*JIT MANUFACTURING~N2*ACCOUNTS PAYABLE DEPARTMENT~N3*400 INDUSTRIAL PARKWAY~N4*INDUSTRIAL AIRPORT*KS*66030~PO1*001*4*EA*330*TE*IN*525*VN*X357-W2~PID*F****HIGH PERFORMANCE WIDGET~SCH*4*EA****002*950322~CTT*1*1~SE*20*000000001~GE*1*5~IEA*1*000000005~
```EDIcat:
```shell
$ edicat edi850_sample.txt
ISA*00* *00* *01*0011223456 *01*999999999 *950120*0147*U*00300*000000005*0*P*^~
GS*PO*0011223456*999999999*950120*0147*5*X*003040~
ST*850*000000001~
BEG*00*SA*95018017***950118~
N1*SE*UNIVERSAL WIDGETS~
N3*375 PLYMOUTH PARK*SUITE 205~
N4*IRVING*TX*75061~
N1*ST*JIT MANUFACTURING~
N3*BUILDING 3B*2001 ENTERPRISE PARK~
N4*JUAREZ*CH**MEX~
N1*AK*JIT MANUFACTURING~
N3*400 INDUSTRIAL PARKWAY~
N4*INDUSTRIAL AIRPORT*KS*66030~
N1*BT*JIT MANUFACTURING~
N2*ACCOUNTS PAYABLE DEPARTMENT~
N3*400 INDUSTRIAL PARKWAY~
N4*INDUSTRIAL AIRPORT*KS*66030~
PO1*001*4*EA*330*TE*IN*525*VN*X357-W2~
PID*F****HIGH PERFORMANCE WIDGET~
SCH*4*EA****002*950322~
CTT*1*1~
SE*20*000000001~
GE*1*5~
IEA*1*000000005~
```## Run tests
```
python3 -m unittest
```## Known Issues:
* `cat /path/* | edicat` won't work with documents that are mixed spec/separators (stdin has no hints as to file boundary).
* Workarounds:
* `edicat /path/*.edi`
* `find /path/ -name '*.edi' | xargs edicat`
* No TRADACOMS support
* No HL7 support