Almond is a companion application developed to integrate with the Cashew budgeting app. Built with C# and powered by GitHub Actions, Almond generates AppLinks from financial transaction emails, enabling quick and easy recording in Cashew.
Note
Almond operates on a GitHub workflow, running at regular intervals to automatically scan your emails for financial transaction messages based on personalized filters. It extracts key details using a customizable regex, then creates a Cashew AppLink. This AppLink is packaged as a notification and sent to your chosen destination. By default, Almond integrates with GMail for email scanning and Pushbullet for notifications.
- Go to the Google Cloud Console
- Click "Create Project"... name it Almond
- Navigate to "APIs & Services" > "Library"
- Search for "Gmail API" and enable it
- Go to "APIs & Services" > "OAuth consent screen"
- Choose User Type
- Fill in required information (app name, user support email, etc.)
- Add the Gmail API scope: https://www.googleapis.com/auth/gmail.modify
- Complete the OAuth consent screen setup
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" and select "OAuth client ID"
- Choose "Desktop app" as the application type
- Download the client configuration file
- Clone this repository.
- Update the
appsettings.json
file locally. - Build and run the solution.
- After authorizing with Google, save the retrieved token data.
- The token data will be displayed in the console output.
- Navigate to the Setting tab in the your repository
- Expand Secrets and Variables in the left panel
- Select Actions
- Select New Enviornment Secret
- Create a Production environment
- Add the required Secrets and Variables
{
"EMAIL_QUERY": "is:unread from:xxx@mybank.com subject:(credit card)",
"EMAIL_TOKEN": //left empty until initial authorization with Google,
"EMAIL_CLIENT_ID": "xxx-123.apps.googleusercontent.com",
"EMAIL_CLIENT_SECRET": "G-xxx",
"NOTIFICATION_TOKEN": "o.xxx",
"NOTIFICATION_DESTINATION": "personal@gmail.com",
"REGEX_PATTERN_TITLE": ".*?at\\s+(.+?)\\s+on",
"REGEX_PATTERN_AMOUNT": "(?:for |made.*?for )\\$(\\d+(?:\\.\\d{2})?)\\s+\\w+",
"REGEX_PATTERN_ACCOUNT": ".*?(?:Credit Card|card) \\*{3}(\\d+)",
"ACCOUNT_MAP": "{\"1234\": \"Chase\", \"5678\": \"VISA\", \"9999\": \"MasterCard\"}"
}
EMAIL_TOKEN: {"AccessToken":"xxx...","TokenType":"Bearer","ExpiresInSeconds":3599,"RefreshToken":"...","Scope":"https://www.googleapis.com/auth/gmail.modify",...}"
EMAIL_CLIENT_ID: xxx-123.apps.googleusercontent.com
EMAIL_CLIENT_SECRET: G-xxx
NOTIFICATION_TOKEN: o.xxx
NOTIFICATION_DESTINATION: personal@gmail.com
ACCOUNT_MAP: {"1234": "Chase", "5678": "VISA", "9999": "MasterCard"}
EMAIL_QUERY: is:unread from:xxx@mybank.com subject:(credit card)
REGEX_PATTERN_TITLE: .*?at\\s+(.+?)\\s+on
REGEX_PATTERN_AMOUNT: (?:for |made.*?for )\\$(\\d+(?:\\.\\d{2})?)\\s+\\w+
REGEX_PATTERN_ACCOUNT: .*?(?:Credit Card|card) \\*{3}(\\d+)