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.
Usage
Prerequisites
- Python 3.10 or later
- NodeJS (I like to install via a package manager)
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:
- Click "Create credentials"
- Click "OAuth client ID"
- Select "Desktop app"
- Type a name of your choice
- Click the download icon (when you hover it says "Download OAuth Client")
- 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.
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
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gsheets-plaid-0.0.2.tar.gz
.
File metadata
- Download URL: gsheets-plaid-0.0.2.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7581f444b1d49f8e08411dd029d9e7cc9745d0e7d502247e170d4970e48d6ca |
|
MD5 | 3fd1bf4026e108368d483a8be9dd8b7e |
|
BLAKE2b-256 | 13c6e805179944627baf432ddb0f4fac9810a7c60120145ffc2fa1c4b31f26b2 |
File details
Details for the file gsheets_plaid-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: gsheets_plaid-0.0.2-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a387b0b6d79b268b4e37ce605e112b2464618da7c675bf481bfe351503b6d04 |
|
MD5 | d4d6ff670854c1e0a372ed64a71e13cf |
|
BLAKE2b-256 | 7e54ca638421f83bf9d81717cea4b0d86e0f2725752a9c81634fd8c6c1b3ef89 |