Skip to main content

Tool for syncing bank transaction data to Google Sheets with Plaid.

Project description

GSheets-Plaid

A spring break project to get my bank transaction data in Google Sheets without using Google Apps Script.

gsheets-plaid is a tool for getting your raw bank transaction data into a Google Sheets spreadsheet, to enable you to make your own formulas and charts for tracking spending, making goals, etc. This app is 100% free (assuming you don't already have a bunch of Google Cloud projects), but there is a bit of one-time setting up to do to get your Google and Plaid credentials in place. This README contains all the instructions to get you from a fresh install of the package to bank transactions in a Google Sheets file.

Please open an issue if something isn't working or if the documentation isn't clear.

Usage

Prerequisites

  • Python 3.10 or later

Installation

Using a virtualenv is a good idea.

python3 -m pip install gsheets-plaid

Create a Google Cloud project and enable the Google Sheets API

Follow this tutorial

Be sure to enable the "Google Sheets API"

Create access credentials for Google

Follow this tutorial for creating OAuth client ID credentials for your Google account.

  • Choose "Desktop app" in the tutorial

OAuth consent screen

Before Google Cloud Platform will let you create OAuth client ID credentials, it will make you complete the OAuth consent screen. Fill out the required fields with your personal email, and choose an arbitrary application name. Since we aren't planning on publishing this app, it doesn't really matter.

On the "Scopes" step, add the following scope: https://www.googleapis.com/auth/drive.file. You can use the search feature and look up drive.file to quickly find the right scope.

On the "Test users" page, add the google account email that corresponds with the account you want to have the finance tracker saved on.

Back to creating OAuth credentials

Here is a summary of how to create the credentials:

  1. Click "Create credentials"
  2. Click "OAuth client ID"
  3. Select "Desktop app"
  4. Type a name of your choice
  5. Click the download icon (when you hover it says "Download OAuth Client")
  6. Click "Download JSON"

Create a Plaid Developer account

Create a Plaid developer account here.

After you have created an account, go to Team Settings > Keys. You should see your client_id, as well as Development and Sandbox secrets.

Register the redirect URI in the Plaid Dashboard

Add the redirect URI to the list of allowed redirect URIs in the Plaid Dashboard. By default, the redirect URI is https://localhost:8080/oauth. In the next step (when you run the init command), you'll have the option to change the redirect URI from the default to something else. If you change the redirect URI, you must register the new one or else Plaid will reject your requests.

Configure gsheets_plaid

To configure gsheets_plaid with all of these credentials we just created, run the following command:

python3 -m gsheets_plaid init

You will be given the opportunity to enter all the credentials necessary for syncing with Plaid and Google Sheets. Note that you only need to supply the Plaid secret corresponding to the Plaid environment that gsheets_plaid runs in. In other words, you can just submit the Plaid sandbox secret and leave the development and production ones blank to start out. You can always come back and rerun init to update the config.

When it asks for the Google credentials JSON file, supply the absolute filepath to the JSON file we downloaded previously. Once you see that it is successfully saved, you can safely delete the copy of the credentials file from your downloads folder (or wherever you saved it).

Link a bank account

We are finally getting to the exciting part!

If everything is configured correctly, running the following command will open a new browser tab with a small local web server you can use to connect a bank account.

python3 -m gsheets_plaid link

If you are using the sandbox environment, note that the credentials are provided at the bottom of the screen. If you are using the development environment, use your actual bank account credentials. Note that you are only given 5 tokens to use in the development environment, but if you submit a ticket on Plaid Dashboard, you can get it bumped up to 100 tokens, which should be more than plenty for personal usage.

Once you have added all the bank accounts you want, close the browser tab and enter CTRL+C in the terminal you started the link command in to kill the web server process.

Sync transaction data with Google Sheets

To sync your transactions from the banks you signed in with, run this command in the terminal

python3 -m gsheets_plaid sync

If this is the first time you're running the command, you'll see a new browser tab open and be asked to give this developer application permission to use Google Sheets. You should only have to do this once. A new finance tracker spreadsheet will be created and the transaction data will be synced to Sheet1. Subsequent runs of this command will reuse the same spreadsheet.

That's it! Hopefully you're inspired to write some cool formulas and make neat charts using this raw transaction data.


Publishing new releases

(for maintainers)

  1. Tag the main branch
git tag v[insert-version-here]
  1. Push latest commits with tags
git push origin --tags
  1. Build repo
python -m build
  1. Upload distribution archives to PyPi
python -m twine upload dist/*
  1. Create new release on GitHub

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsheets-plaid-0.0.5.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

gsheets_plaid-0.0.5-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file gsheets-plaid-0.0.5.tar.gz.

File metadata

  • Download URL: gsheets-plaid-0.0.5.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.3

File hashes

Hashes for gsheets-plaid-0.0.5.tar.gz
Algorithm Hash digest
SHA256 6276944a126781a1b015ccf6041f237f43736ad472a10da88341004a0e3e9326
MD5 f7cde447016465c7da168fd411832e67
BLAKE2b-256 e037f9d3900d8c833458fe58305715e1f0402a2769da17872d61ce0762b27f58

See more details on using hashes here.

File details

Details for the file gsheets_plaid-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for gsheets_plaid-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5853b8153704e37923e47e3aa08c3964c76b9bba16ed7f5edcb260a6cf1cdd19
MD5 d34f4ef1d43c346f842611465a505805
BLAKE2b-256 8f7ce7892d239262c33856049e6899e926107f41ed53192349062b2dbb067c5e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page