Files:
Must exist: (Don't delete)
- template.xlsx - the template for the invoice.xlsx
- scraped.csv - scraped data is saved into this file along with the scraped time
Scripts arguments:
- -v : verbose mode
- -l : log output in the log file
- --run-mode : email or print. print - runs once a day and prints out jobs.xlsx sheet, email - runs every x minute and send an email if new assignments found or any assignment has been changed.
- --test : to run in the test mode; in this mode when run together with --run-mode email, an email is sent out to: test_email: from label.conf
Run script:
- configure a daily schedule task with the following arguments:
python run.py --run-mode print -l
- configure a schedule task that runs every x minute with the following arguments:
python run.py --run-mode email -l
To test:
the best way to test it is to:
- delete all entries in scraped.csv file except for the headings
- run
run.py --run-mode print
- it should create a new job file jobs.xlsx and print it out, jobs should be saved into the invoice sheet - remove a couple of jobs from scraped.csv and run
run.py --run-mode print --test
. the script should collect all jobs once again and since we deleted some from the scraped.csv, an email should be sent out the test_email: with the new assignments.
Technicians:
In label.conf file, fill data each technician:
name_1::Si*** Ti****
username_1::s*******
pass_1::*
email_1::
Install:
pip install emails
pip install -U selenium
pip install openpyxl