Generate PDF invoices, using custom fonts and a custom layout, from a Google Sheet with time tracking information. These scripts are customized for my own invoices, but please feel free to modify this code.
Set up a Python virtual environment somewhere appropriate and install the required Python libraries:
$ python3 -m venv env
$ pip install -r requirements.txt
- Download FOP
- Add Avenir to the fonts folder.
- Go to the Google API Console: https://console.developers.google.com/
- Click 'create a new project'.
- Give the project a memorable name.
- Click 'enable APIs and services'.
- G Suite, Google Drive API, Google Sheets API.
- Click 'create credentials'.
- Download the JSON service account key and put it in this folder.
- Look in the .json file for 'client_email'. Be sure to share the initial spreadsheet with that email address.
$ invoice <client> <yyyymm> <invoice_number>