Skip to main content

A Python package to strip non-standard text blocks from UN/EDIFACT messages.

Project description

ediclean

A Python package to strip non-standard text blocks from UN/EDIFACT messages.

CircleCI

About The Project

UN/EDIFACT files often contain headers and footers that are added by applications during their transport. Ediclean removes these non-standard blocks and formats the output to contain one segment per line.

Installation

pip3 install -U ediclean

Usage

$ ediclean -h
usage: ediclean [-h] [filename]

Strip non-standard text blocks from UN/EDIFACT messages.

positional arguments:
  filename    File containing UN/EDIFACT PAXLST message

optional arguments:
  -h, --help  show this help message and exit

Examples

Original file

$ cat ediclean/tests/testfiles/original/A.txt
CICA	 

.HDQCRA9 130631
UNA:+.? 'UNB+UNOA:4+CICA-A9:A9+ABCAPIS:ZZ+210713:0631+2107130631
++APIS'UNG+PAXLST+CICA-A9:ZZ+ABCAPIS:ZZ+210713:0631+1+UN+D:05B'U
NH+PAX001+PAXLST:D:05B:UN:IATA+A92707/210713/1200+02'BGM+745'NAD
+MS+++CICA HELP DESK'COM+231384 373 2:TE+1 232 3234 4:FX'TDT+20+
A92707'LOC+125+VIE'DTM+189:2107131100:201'LOC+87+VIE'DTM+232:210
7131200:201'NAD+FL+++DJEMFISJER:REDJAE'ATT+2++M'DTM+329:930408'M
EA+CT++:0'FTX+BAG+++NULL'LOC+22+VIE'LOC+178+TBS'LOC+179+VIE'NAT+
2+ABC'RFF+AVF:ABC123'RFF+SEA:9F'DOC+P:110:111+3DEJ2ED3E'DTM+36:28
0907'LOC+91+LIM'CNT+42:4
7'UNT+159+PAX001'UNE+1+1'UNZ+1+2107130631'



Email secured by UN Antivirus

Cleaned file

$ ediclean ediclean/tests/testfiles/original/A.txt 
UNA:+.? '
UNB+UNOA:4+CICA-A9:A9+ABCAPIS:ZZ+210713:0631+2107130631++APIS'
UNG+PAXLST+CICA-A9:ZZ+ABCAPIS:ZZ+210713:0631+1+UN+D:05B'
UNH+PAX001+PAXLST:D:05B:UN:IATA+A92707/210713/1200+02'
BGM+745'
NAD+MS+++CICA HELP DESK'
COM+231384 373 2:TE+1 232 3234 4:FX'
TDT+20+A92707'
LOC+125+VIE'
DTM+189:2107131100:201'
LOC+87+VIE'
DTM+232:2107131200:201'
NAD+FL+++DJEMFISJER:REDJAE'
ATT+2++M'
DTM+329:930408'
MEA+CT++:0'
FTX+BAG+++NULL'
LOC+22+VIE'
LOC+178+TBS'
LOC+179+VIE'
NAT+2+ABC'
RFF+AVF:ABC123'
RFF+SEA:9F'
DOC+P:110:111+3DEJ2ED3E'
DTM+36:280907'
LOC+91+LIM'
CNT+42:47'
UNT+159+PAX001'
UNE+1+1'
UNZ+1+2107130631'

Currently supported message types

License

Distributed under the MIT License. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ediclean-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ediclean-0.1.3-py3.8.egg (8.0 kB view details)

Uploaded Egg

ediclean-0.1.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ediclean-0.1.3.tar.gz.

File metadata

  • Download URL: ediclean-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for ediclean-0.1.3.tar.gz
Algorithm Hash digest
SHA256 aa839fb3962c049883b115a9a853a2a5632727948a15c18147999e2f79cd97d6
MD5 429350e7e1fbccec44c652f1e60f5b8d
BLAKE2b-256 3583e87ad86be2be3a77204c38f07d02720a1af0fb6c804257982bd371a4559a

See more details on using hashes here.

File details

Details for the file ediclean-0.1.3-py3.8.egg.

File metadata

  • Download URL: ediclean-0.1.3-py3.8.egg
  • Upload date:
  • Size: 8.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for ediclean-0.1.3-py3.8.egg
Algorithm Hash digest
SHA256 6e8e1a3aea8af79b0f88fa8325292f7d6ac4e3d88c893d62c71b998baed315da
MD5 8f02d1edad4af9e78809cf781e8f1e5f
BLAKE2b-256 19b174dff0a4ea9a1329635eead1631665c229f23a28579d0abe478824b9d103

See more details on using hashes here.

File details

Details for the file ediclean-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ediclean-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for ediclean-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8bd3e8ba276ec9ca2cd646387c7d45fefec9033ea713dca4685747d5ff813bb
MD5 d693341073dd4d8f37a5da999dcc9b50
BLAKE2b-256 4c3d87ba8caba6b5fc04ee8808ee837ee3bb26fff926cb715cc76bef17cac8cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page