A Python Data Pipeline to Track Holiday Spending with Mint API, BigQuery and Tableau
2021 holiday spending is projected to reach over $1400 per household, meaning that understanding your personal finance data through an app like Mint could help you to retain a little bit of holiday cheer amid the chaos.
Since Mint lacks a formal API, we’ll rely on the unofficial version GitHub users mrooney and jaron-l created, MintAPI, which uses Selenium to scrape information across accounts, budgets, transactions and investments. Below, we’ll extract data from a Mint account, format the output as a Pandas dataframe, load it into BigQuery and visualize the final insights in Tableau.
Note: To follow this walkthrough, in addition to Python, you’ll need the Mint app, a Google Cloud account and Tableau desktop.
Extract
MintAPI’s ‘.Mint’ method contains all fields needed to make a request. Note that only email and password are required. However, you can choose a multi-factor authentication preference by specifying the ‘mfa_method’ parameter.
import pandas as pd
from google.cloud import bigquery
import mintapi as mintapi# Opens Mint in new browser window through Selenium webdriver. mint_auth = mintapi.Mint(
'email',
'password'…