/cell-reim

Quick & dirty python script that submits my monthly cell phone reimbursement request to my boss.

Primary LanguagePythonMIT LicenseMIT

cell-reim

Quick & dirty python script that submits my monthly cell phone reimbursement request to my boss. It creates a PDF expense report, attaches it to an email and sends it to a specified email address.

It uses pyfpdf to generate an expense report in PDF format which is then attached to an email and send to my boss. I schedule it with cron.

It relies on pyfpdf's write_html function which I found difficult to use well and very limited. If I ever update this I'll use a different method/software to generate the PDF.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This program requires Python 3 and the following libraries from PyPi: retrying and fpdf2

I had trouble installing fpdf2 on one of my computers. Installing libjpeg-dev using apt install and pillow from PyPi first allowed it to install properly.

Installing

Install the prerequisite libraries. In cellreim.py, change the server address, from email address and to email address to appropriate values.

I realize having that information in the source code isn't good practice or ideal, but as mentioned, this was "quick and dirty".

You may also want to change the logo.png image to something more appropriate.

Deployment

Use the cellreim.sh script to schedule the program using cron. For example, my crontab entry looks like this:

45 7 1 * * /home/pi/CellReim/cellreim.sh

This results in the program running on the first day of every month at 7:45am.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments