This was created as a personal project to see how easy/hard it would be to parse transactional emails and have them appear in my Monzo banking app as a Receipt.
Currently supports .txt emails and works for parsing the following:
- Asos
- Myprotein
- Gymshark
- Bulk powders
- eBay
- Uber
It should be fairly simple (hopefully) to add support for further emails.
This project is built in python and to be ran with python 3.
This has been built to parse .txt emails as I found this much easier to work with over HTML emails. I've been manually saving my emails as .txt and pasting them into the emails
directory, this could be automated in the future.
Currently only a few merchant emails are supported but there's room to expand and add more easily enough. I initially tried to make the email parsing as generic as possible but found that by making it specific per brand (e.g. Asos) it was much quicker to write a regex expression to find the important data, i.e Total & line items.
This project handles all the Monzo authentication needed so just fill in with your Monzo creds which you can get over at their API. Monzo developer.
The access token and potentially a few other methods I've used have been for speedy development and are not the most secure, but this is not a commercial project.
This is how I've been working on the project so it may be helpful
- Python 3
- Install using a virtual env wrapper
- External packages are in the requirements.txt file
- Create a developer account over at Monzo and get your creds
- Convert your order email to .txt (Mac OSX mail: Selected email > File > Save as > Plain text)
- Drop a few .txt emails into the emails directory to begin
- Run the parse_email.py file in a terminal and follow the instructions for Auth'ing with Monzo!
Enjoy!