'mintfunctions' is a Python wrapper for the postprocessing finance data from your Mint account
This set of functions makes postprocessing Mint personal finance data easy, and generates monthly reports for your spending.
First, download your spending data from mint. Then, load the transaction data as a a dataframe and run 'process_mintcsv' to prep the dataframe for report generation. For example:
'''python #Load historical data df = pd.read_csv(r'./data/transactions.csv',index_col='Date',encoding='latin-1',infer_datetime_format=True) df.index = pd.to_datetime(df.index) df = mintfunctions.process_mintcsv(df)
'''
Once the transaction data is pre-processed, you can run the 'mintfunctions.gerate_pdf' function to visualize your spending data and create a monthly report. Required and optional inputs are as follows:
Required df = dataframe of spending and income data Optional
- pdfdir = string, path to save monthly report pdf. Default = '',
- figdir = string, path to save figures. Default = r'./figures',
- yearly_exclude_category = string, optional input that excludes a single category from your yearly spending amounts. For example, user can specify 'Home Improvement' to exclude all home improvment expenses from plot. Default = None
- spending_drop_categories = list of strings, overall categories to exclude from spending dataframe. Default = ['Income', 'Transfer','Reimbursement','Credit Card Payment','Loans']
Example python input to generate report: '''python mintfunctions.generate_pdf(df, pdfdir = '', figdir = r'./figures', yearly_exclude_category = None, spending_drop_categories = ['Income', 'Transfer','Reimbursement','Credit Card Payment','Loans']) '''
##Output Code will output monthly report pdf, the following figures are an example of the yearly spending breakdown, and the categorical spending breakdown. Example figures below for each, taken from dummy monthly report.Example Categorical plots generated in pdf
Example Yearly & Monthly spending breakdown plots
These are the required packages for using mintfunctions.
- seaborn
- matplotlib
- calendar
- datetime
- pandas
- numpy
- Clone the repo
git clone https://github.com/pmclau04/mintfunctions.git
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/pmclau04/mintfunctions