Skip to content

EDIFACT to JSON. Generate APERAK from EDI messages. IMAP & SMTP support.

License

Notifications You must be signed in to change notification settings

sun-labs/ediclue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EDICLUE, ribbon-like form in the background

Command Line Tools for EDI Communication. Generate APERAK and CONTRL without having to sell your firstborn

Badge with text 'Made by Sun Labs'

Features

  • Convert EDI to JSON
  • Generate APERAK and CONTRL for EDI messages
  • Support for SMTP and IMAP
  • Made for EDIEL

Requirements

  • Python 3

Setup

Install python dependencies

pip install -r requirements.txt

Make a copy of config/config.sample.sh to config/config.sh and set variables as needed

# has to be done every time you run the cli.py script
source config/config.sh

Examples

Send APERAK to unanswered UTILTS messages

# make sure config/config.sh is correctly set
cd bin/
./send-aperak-utilts.sh

Get emails with certain subject

python cli.py com --username [email protected] --password secret --server imap.domain.com --imap-search-query "SUBJECT UTILTS NOT (SUBJECT spam)"
# returns list of mail ids

Get emails with certain subject and store in folder

python cli.py com --username [email protected] --password secret --server imap.domain.com --imap-search-query "SUBJECT UTILTS NOT (SUBJECT spam)" --output-dir "./saved-emails"
# stores as "email-id.eml"

Get emails and grab edi-content and parse to json format and then store

python cli.py com --username [email protected] --password secret --server imap.domain.com --imap-search-query "SUBJECT UTILTS NOT (SUBJECT spam)" --output-dir "./saved-emails" && python cli.py parse --from mail --to json --output-dir "./edi-messages-json" --input-dir "./saved-emails"
# stored as email-id.eml.json

Get emails and grab edi-content and parse edi and generate aperak message, convert to email and send back to the sender.

source ../config/config.sh &&
python cli.py com --imap-search-query "SUBJECT UTILTS NOT (SUBJECT spam)" --output-dir "./saved-emails" && \
python cli.py parse --from mail --to mail --aperak --output-dir "./edi-aperak-mails" --input-dir "./saved-emails" && \
python cli.py com --send --input-dir "./edi-aperak-mails"
# returns a list of email ids
# every message sent will be stored in the "sent" folder of the mail account.

Set specific emails to answered

python cli.py com --username [email protected] --password secret --server imap.domain.com --imap-search-query "BEFORE 14-Apr-2019" --imap-store-query \"+FLAGS\" "\\Answered \\Seen"
# returns list of email ids that was updated

Parser

Create EDI messages and convert to different formats

Communicator

Manage e-mails via SMTP and/or IMAP


With ⚡️ from Uppsala

About

EDIFACT to JSON. Generate APERAK from EDI messages. IMAP & SMTP support.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •