Giter Site home page Giter Site logo

sun-labs / ediclue Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 120 KB

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

Home Page: https://ediclue.sunlabs.se

License: MIT License

Python 98.44% Shell 1.56%
edifact edi json converter smtp ediel energy ediclue

ediclue's Introduction

EDI Command Line Interface Tools

Analytics Sun Labs

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 fits.

# 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.