Skip to content

This app reads a .csv file that contains trx information, send a formatted email with this content and load the information into a Mongodb cluster

Notifications You must be signed in to change notification settings

RomiBareiro/Transaction-reader

Repository files navigation

Transaction reader

Brief intro

  • This app read a .csv file that contains trx information, send a formatted email with this content and load the information into a Mongodb cluster.
  • Info will be stored this way (in a json file) :
    {"_id":{"$oid":"631f4bdfb01fc30b3d3345ae"},"user_name":"TESTING","trx_qtty":[0,0,0,0,0,0,2,2,0,0,0,0],"debit":[0,0,0,0,0,0,-10.3,-20.46,0,0,0,0],"credit":[0,0,0,0,0,0,60.5,10.0,0,0,0,0],"email_date":"12/09/2022 15:10:23"}

Tech

  • Mongodb
  • Docker
  • Docker compose
  • Python 3.8.10
  • Poetry

Download docker container from DockerHub:

https://hub.docker.com/repository/docker/romibareiro/stori01

Or

Get package from Pypi

pip install trx-reader-demo

Or

Clone repository and install:

pip3 install -r requirements.txt

Load env variables:

Create an .env file with this content:

CSV_PATH=CSV_PATH
SENDER_EMAIL=SENDER_EMAIL
DEST_EMAIL=DEST_EMAIL
EMAIL_PWD=EMAIL_PWD
USER_NAME=USER_NAME
MONGODB_CONNSTRING=MONGODB_CONNSTRING

And then run:

python3 main.py

Note: if your email sender is a gmal account, you must get app password from gmail settings. If you want to build the docker image, you need to change the flags values in .env ( PATH_TO_CSV, EMAIL_SENDER, EMAIL_DESTINATION,EMAIL_SENDER_PWD,USER_NAME)

You will receive an email like this:

image

About

This app reads a .csv file that contains trx information, send a formatted email with this content and load the information into a Mongodb cluster

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published