Skip to content

Reads transactions from Nordea, OP and other banks and imports them into Google Sheets.

License

Notifications You must be signed in to change notification settings

laurilarjo/expense-tracking-gsheet-importer

Repository files navigation

Expense Tracking - Google Sheets importer

Parse different banks' transaction files and import data to Google Sheets.

Bank parser support:

  • NordeaFinland, Old side (tsv-format)
  • OP (csv)
  • Bank Norwegian Credit Card (xlsx)
  • Binance Credit Card (xslx)
  • NordeaSweden (xls) with currency conversion
  • Handelsbanken Sweden (xls-html) with currency conversion

Demo

Requirements

  • Install Node
  • Install Git

Setup and 1st time use

  1. Clone this project to your machine. Run npm install.

  2. Make a copy of this sample sheet to your own account and use it as a base (header rows come from it): https://docs.google.com/spreadsheets/d/1F78PxLNPdAFrcS8XjPI_hTAyh4knTVqq8kd-8ilmDSA/.

  3. Create and name the data sheets like this: If your name is Aurelius and your bank is OP, name the sheet Aurelius OP. You'll setup this in sheet-config next.

  4. Copy sheet-config.json.sample to sheet-config.json, and replace values with your own.

  5. Copy .env.sample to .env. You don't need to set any vars yet.

  6. Go here and complete the "prerequisites" section: https://developers.google.com/sheets/api/quickstart/nodejs.

    1. Create a project in Google Cloud Platform
    2. Go to "APIs and Services" and enable the Google Sheets API for it
    3. Go to Credentials -section under the APIs and Services, and create OAuth 2 client ID credentials for a desktop app. Download the resulting json file, rename it to credentials.json and put to root of this project.
    4. Go to OAuth Consent Screen -section under the APIs and Services, and add your gmail-account to a test user list.
    5. Run the app with npm start. Select Nothing, then your user, and whatever bank. Last select LoginToSheets.
    6. This should trigger OAuth flow. Follow instructions, and you end up with a token.json in your root folder. After this you can start using the app.
  7. OPTIONAL. If you need exchange rates, create a free account to https://exchangeratesapi.io/ and add access-key to .env.

Using the app

  1. Get an export xls, csv, txt file from your bank, and drop it to the root of this project.
  2. Run app with npm start.
  3. First select the file you want to import, then your user, then your bank.
  4. Last select Import if you want to add transactions to GSheets. You can also dry-run by reading the sheet's current content, or read the file's content without making changes.

TODO

  • Basic Read sheets
  • Basic write transactions to sheets
  • Read sheets and filter transactions based on it, so we don't add duplicate data
  • Write data by appending to end of file
  • Add support to read OP
  • Add support to read Nordea Sweden
  • Add support to read Handelsbanken Sweden
  • Add support to read Norwegian (Finland)
  • Bank detection from files won't work. Change to interactive console instead.
  • Do not add Handelsbankens if message has a prefix "Prel "
  • Do not add Norwegian's "Katevaraus" type
  • Add support to read Binance Card
  • Turn this into a hosted service which can be triggered with a Telegram bot.

Nice to do

  • Change currency exchange library to something newer. Current has dependencies to deprecated libs.

About

Reads transactions from Nordea, OP and other banks and imports them into Google Sheets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published