# 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 stdin
optional 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
Raw data
{
"_id": null,
"home_page": null,
"name": "edicat",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "ansix12, edi, edicat, edifact",
"author": null,
"author_email": "Peter Tripp <peter.tripp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/68/ab/993dcb38d3b79d7628870af5dea9bac179f24ec2c7f36af9da430a61f021/edicat-2024.8.2.tar.gz",
"platform": null,
"description": "# edicat: Print and transform EDI\n\n![pypi-version](https://img.shields.io/pypi/v/edicat.svg)\n\n## Why?\n\nEDI often does not include newlines which makes it incompatible with\nnormal UNIX tools that operate on a line-by-line basis. So we do some\nsimple detection of the segment terminator and append newlines as required.\n\n## Install\n\n```\npip3 install -U edicat\n```\n\n## Usage\n\n```shell\n$ edicat --help\nusage: edicat [-n] [filenames [filenames ...]]\n\nPrint and concatenate EDI.\n\npositional arguments:\n filenames Filename(s) or - for stdin\n\noptional arguments:\n -n, --lineno Number the output lines, starting at 1.\n```\n\n## Examples\nSimple cat:\n```shell\n$ cat edi850_sample.txt\nISA*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~\n```\n\nEDIcat:\n```shell\n$ edicat edi850_sample.txt\nISA*00* *00* *01*0011223456 *01*999999999 *950120*0147*U*00300*000000005*0*P*^~\nGS*PO*0011223456*999999999*950120*0147*5*X*003040~\nST*850*000000001~\nBEG*00*SA*95018017***950118~\nN1*SE*UNIVERSAL WIDGETS~\nN3*375 PLYMOUTH PARK*SUITE 205~\nN4*IRVING*TX*75061~\nN1*ST*JIT MANUFACTURING~\nN3*BUILDING 3B*2001 ENTERPRISE PARK~\nN4*JUAREZ*CH**MEX~\nN1*AK*JIT MANUFACTURING~\nN3*400 INDUSTRIAL PARKWAY~\nN4*INDUSTRIAL AIRPORT*KS*66030~\nN1*BT*JIT MANUFACTURING~\nN2*ACCOUNTS PAYABLE DEPARTMENT~\nN3*400 INDUSTRIAL PARKWAY~\nN4*INDUSTRIAL AIRPORT*KS*66030~\nPO1*001*4*EA*330*TE*IN*525*VN*X357-W2~\nPID*F****HIGH PERFORMANCE WIDGET~\nSCH*4*EA****002*950322~\nCTT*1*1~\nSE*20*000000001~\nGE*1*5~\nIEA*1*000000005~\n```\n\n## Run tests\n\n```\npython3 -m unittest\n```\n\n## Known Issues:\n\n* `cat /path/* | edicat` won't work with documents that are mixed spec/separators (stdin has no hints as to file boundary).\n * Workarounds:\n * `edicat /path/*.edi`\n * `find /path/ -name '*.edi' | xargs edicat`\n* No TRADACOMS support\n* No HL7 support\n",
"bugtrack_url": null,
"license": null,
"summary": "Print and concatenate EDI files",
"version": "2024.8.2",
"project_urls": {
"Homepage": "https://github.com/notpeter/edicat",
"Repository": "https://github.com/notpeter/edicat.git"
},
"split_keywords": [
"ansix12",
" edi",
" edicat",
" edifact"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ebbcd5f9a9cf298f275e6a5591f18fca83b04e5984b0e430898eba569ec5a83d",
"md5": "c94d703716a712e23aec9b025cb4d6a8",
"sha256": "9f445952677399dbcf3af6c26d86bc47acde03e39162e5170f043c82b8491307"
},
"downloads": -1,
"filename": "edicat-2024.8.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c94d703716a712e23aec9b025cb4d6a8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6271,
"upload_time": "2024-08-04T00:59:39",
"upload_time_iso_8601": "2024-08-04T00:59:39.554335Z",
"url": "https://files.pythonhosted.org/packages/eb/bc/d5f9a9cf298f275e6a5591f18fca83b04e5984b0e430898eba569ec5a83d/edicat-2024.8.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "68ab993dcb38d3b79d7628870af5dea9bac179f24ec2c7f36af9da430a61f021",
"md5": "35679be7a76c0f9112e96c89c76fd227",
"sha256": "947b455d29de3d4a2c39d24864af19ae7908314170bf1e2635bc43e803a695af"
},
"downloads": -1,
"filename": "edicat-2024.8.2.tar.gz",
"has_sig": false,
"md5_digest": "35679be7a76c0f9112e96c89c76fd227",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6713,
"upload_time": "2024-08-04T00:59:40",
"upload_time_iso_8601": "2024-08-04T00:59:40.836662Z",
"url": "https://files.pythonhosted.org/packages/68/ab/993dcb38d3b79d7628870af5dea9bac179f24ec2c7f36af9da430a61f021/edicat-2024.8.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-04 00:59:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "notpeter",
"github_project": "edicat",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "nose",
"specs": [
[
"==",
"1.3.7"
]
]
}
],
"lcname": "edicat"
}