Skip to content

waseemR02/seiri

Repository files navigation

Seiri

tests Codacy Badge Codacy Badge

Tool for csv<->xlsx conversions and validation checks

Installation

Create a virtual environment before installing dependencies

pip install .

Usage

This tool is written as library for future adaptation to gui

But each class file can be run as a separate script Transform

usage: transform.py [-h] [--cx CX] [-o OUTPUT] [--xc XC] [--log LOG] [-v]

options:
  -h, --help            show this help message and exit
  --cx CX               Convert csv to xlsx
  -o OUTPUT, --output OUTPUT
                        output file
  --xc XC               Convert xlsx to csv
  --log LOG             path to log file
  -v, --verbose

Validate

usage: validate.py [-h] [--against AGAINST] [--log LOG] in_xlsx

positional arguments:
  in_xlsx            path to xlsx to validate

options:
  -h, --help         show this help message and exit
  --against AGAINST  path to xlsx to validate against
  --log LOG          path to log file

Example:

python -m seiri.transform --cx tests/data/Sample.csv -o sample.xlsx --verbose

csv_to_xlsx

python -m seiri.validate tests/data/Delivered_correct.xlsx

validation

python -m seiri.transform --xc tests/data/Delivered_correct.xlsx -o sample.csv  --verbose

xlsx_to_csv

Testing

Install the testing dependencies

pip install .[test]

Run the following

pytest -v

pytest

Task

  • Convert csv to xlsx
  • Validating given Excel with rules
  • Converting Excel to csv again
  • Add Spell check on en column