A collection of scripts for downloading receipts from Gmail and combining them into bulk PDFs for submission for reimbursement. Initially, this focuses on food delivery services since that's my immediate use case, but it could be easily extended to other things.
-
Clone the repo
-
npm install
-
Click the
Enable the Gmail API
button here to create a Google Cloud Platform project and get an API key. Download the resultingcredentials.json
file and place it in the repo (don't worry, it's.gitignore
'd). -
npm run download
- The first run will provide instructions on how to get an initial OAuth token, after which it is stored in another file,
token.json
and you won't have to do that again.
- The first run will provide instructions on how to get an initial OAuth token, after which it is stored in another file,
-
Follow interactive prompts
There is also a script to collate multiple receipt PDFs into one giant PDF with a cover page showing a total for all of them. Below assumes you have already done the above.
- Look over
download_summary.json
and the downloaded receipts. Any that you don't want to be included, you can add a fieldexclude: true
in the JSON file. npm run collate
- Follow interactive prompts to select the directory where
download_summary.json
and previously downloaded PDFs are.