edicat: Print and transform EDI
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
$ edicat --help
usage: edicat [-n] [filenames [filenames ...]]
Print and concatenate EDI.
positional arguments:
filenames Filename(s) or - for stdin
optional arguments:
-n, --lineno Number the output lines, starting at 1.
Examples
Simple cat:
$ 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:
$ 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/* | edicatwon't work with documents that are mixed spec/separators (stdin has no hints as to file boundary).- Workarounds:
edicat /path/*.edifind /path/ -name '*.edi' | xargs edicat
- Workarounds:
- No TRADACOMS support
- No HL7 support
Metadata
Release files for edicat 2024.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| edicat-2024.8.2.tar.gz | 6.7 kB | Without provenance | Details for edicat-2024.8.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| edicat-2024.8.2-py3-none-any.whl | Python 3 | none | any | Details for edicat-2024.8.2-py3-none-any.whl |
Total release size: 13.0 kB
Release files / edicat-2024.8.2.tar.gz
| Download URL | edicat-2024.8.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
947b455d29de3d4a2c39d24864af19ae7908314170bf1e2635bc43e803a695af
|
|
BLAKE2b-256 checksum How to use checksums |
68ab993dcb38d3b79d7628870af5dea9bac179f24ec2c7f36af9da430a61f021
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / edicat-2024.8.2-py3-none-any.whl
| Download URL | edicat-2024.8.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f445952677399dbcf3af6c26d86bc47acde03e39162e5170f043c82b8491307
|
|
BLAKE2b-256 checksum How to use checksums |
ebbcd5f9a9cf298f275e6a5591f18fca83b04e5984b0e430898eba569ec5a83d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for edicat 2024.8.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.