Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
/ biyete Public archive

A small Google Script that parses Google email and save the results to Google Spreadsheets

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
COPYING
GPL-3.0
LICENSE.adoc
Notifications You must be signed in to change notification settings

NinjasCL/biyete

Repository files navigation

💵 Biyete 🏦

Perrito Limpio con Signo de Dinero

A simple Google Apps Script to parse Gmail messages related to Bank Notifications, Payment Bills, Deposits and other related areas. Then save those data to a Google Spreadsheet that you could use to track your finances.

Ninjas.cl GPL v3 Commitizen Friendly StandardJS

🚀 Environment setup

Quick Installation

Step 1 - Configure Gmail

  1. Configure your Gmail inbox with filters for each Parser, that would assign specific labels.

  2. Ensure that you have some unread emails with the assigned label.

Each parser will have a designated label that you must configure first in your Gmail account This is the way to determine which Parser will be used to extract the data.

It’s recommended to use a parent label named biyete to organize better your emails and labels related to biyete. Labels must follow specific format in order to work.

See each parser Labels.js file to know how to name your labels.

Gmail Labels

Important: Be sure to create a good filter. Unwanted email may cause clutter.

Pro Tip

If you want to create filters more easily you can use the plus sign + to create an unique email address for each entity.

For example if you got a Netflix account, you can use example+netflix@gmail.com as your account email address. Its the same as writting example@gmail.com. Gmail ommits everything after the +. For Netflix it will be a valid and unique email address. For you, it means that now you can filter all emails that went to example+netflix@gmail.com they all will be from Netflix.

Step 2 - Create Spreadsheet

You can use the following Example Sheet.

  1. Clone it to your Google Drive.

  2. Remove sample data.

  3. Replace the url inside biyete.gs. ("sheetURL" constant).

Step 3 - Configure Google Apps Script

  1. Create a new project in Google Apps Script.

  2. Upload the (already configured) code inside biyete.gs.

  3. Enable Advanced Services (Gmail and Spreadsheets).

  4. Save and run (Need to give permissions first).

  5. Configure a Time-driven trigger to execute your custom script periodically.

(Optional) Script Config
  1. Configure parsers and actions (Select custom behaviours).

  2. Compile a custom version.

  3. Upload following step 3.

Selecting Parsers and Actions

For creating your custom selection of Parsers and Actions you just need to configure Parsers and Actions. import the ones you will need and recompile the script.

👩‍💻 Project explanation

This project was inspired by Bennedetto and the lack of proper apps and technologies in Chilean banking systems. Also to automate financial tracking, and helping people organize their finances better.

Following Bart Wronski’s advice we look for simpler solutions and try to achieve the goals with the least technical weight. Normally a solution would be a huge app with lots of endpoints, ETLs and so on.

We tried to minimize using the available tools:

  • Banks normally do not have open endpoints to fetch data. But they send emails every time you purchase something or when you receive a deposit. These emails could be parsed with simple regex and sent to another place. Also other entities ("Netflix", "Spotify", etc) send a billing email that could also be parsed.

  • Gmail has Google Apps Scripts that let you read, program and control emails and interact with different services.

  • Google Spreadsheets is a wonderful place to store data and create custom dashboards. Also has Google Apps Scripts.

  • Finances need to be secure and transparent. So using Gmail and Spreadsheets we can have an easy to use, easy to configure, low cost and secure environment to execute this script and let you have total control over your personal data (No hidden nasties).

How does it work?

This script will fetch all the unread emails within a specific label. Will search for the special keywords and process their data. Then for every item found it will trigger actions. The default action is to store the results inside a specific SpreadSheet. Although you could configure new actions (Like sending the data to a REST API or similar). Finally the email will be marked as read.

Normally will process 30 threads of messages per execution. (Google Apps Scripts max time is 6 minutes).

Main Sequence Diagram

🤩 Credits

Dog Icon made by Flat Icons from www.flaticon.com

Made with by Ninjas.cl .

About

A small Google Script that parses Google email and save the results to Google Spreadsheets

Topics

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
COPYING
GPL-3.0
LICENSE.adoc

Stars

Watchers

Forks

Releases

No releases published