Skip to content

Postprocessing of Mint personal finance data and monthly report generation

License

Notifications You must be signed in to change notification settings

pmclau04/mintfunctions

Repository files navigation

'mintfunctions' is a Python wrapper for the postprocessing finance data from your Mint account

Use

This set of functions makes postprocessing Mint personal finance data easy, and generates monthly reports for your spending.

Load Mint Transactions data as a dataFrame

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)

'''

Generate report

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']) '''

(back to top)

##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 image

Example Yearly & Monthly spending breakdown plots image

Prerequisites to run mintfunctions

These are the required packages for using mintfunctions.

  • seaborn
  • matplotlib
  • calendar
  • datetime
  • pandas
  • numpy

(back to top)

Installation

  1. Clone the repo
    git clone https://github.com/pmclau04/mintfunctions.git

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Link to mintfunctions

Project Link: https://github.com/pmclau04/mintfunctions

(back to top)

(back to top)

About

Postprocessing of Mint personal finance data and monthly report generation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published