This is a Python utility to
- Export emails from Gmail
- Parse emails from
- DBS PayLah! (Singapore)
- Fave (Singapore)
- Grab (Singapore)
- Extract the transaction details and save to a CSV/JSON file.
- Your DBS PayLah! / Fave / Grab account is linked to your Gmail account. Usually, you will receive an email receipt for each transaction.
- You are able to enable the Gmail API on your Google account. (Instructions below)
Follow the instructions here to enable the Gmail API on your Google account. Follow the steps, including:
- Enable the API
- Configure the OAuth consent screen
- Authorize credentials for a desktop application
- Download the credentials file and save it as
credentials.jsonat the root of this project.
During the steps above, you may need to fill in the scopes for the Gmail API. Due to the nature of the project, the script only requires read-only access to your Gmail account. The only scope required by this project is:
| Scope | Description |
|---|---|
https://www.googleapis.com/auth/gmail.readonly |
Read all resources and their metadata—no write operations. |
# Create a virtual environment
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtpython main.pyThe default outputs are located in the output folder.
You can further analyze the CSV/JSON files using Excel, Google Sheets, or write your own Python scripts.
Example code to analyze the Grab transactions:
python analyze_grab.pyExample code to analyze the PayLah! transactions:
python analyze_paylah.pyUnderstand the script before running it. Use at your own risk.