backup is a great personal finance tool. I started using it once I made the switch to Linux at home. I used to use Quicken, but I really didn't want to configure WINE for that one application. Besides, Quicken is getting really crusty; it looks like it's still the same codebase from the Windows 95 days.

My only gripe with Mint is that your data is "in the cloud". I want a local copy! Mint has a handy link that you can use at the bottom of your transaction list to download a CSV copy. But I wanted to automate it...

Want to backup Here is a quick Python script to download your entire transaction history into a CSV file.

import os
import urllib
import urllib2
import cookielib
from optparse import OptionParser
import datetime

class mintlib():
    def __init__(self):
        self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor())  # need cookies for the JSESSION ID
    def login(self, username, password):
        request = urllib2.Request("",  urllib.urlencode(locals()))
        request.add_header("User-Agent", "Mozilla/5.0") # Mint kicks to a "Upgrade to IE 7.0" page without this
        response =
    def download(self, file):
        # write CSV file of all Mint transactions for this account to a file
        response ="") 
        open(file, "w").write(
    def logout(self):
        response ="")         

def getOptions():
    arguments = OptionParser()
    arguments.add_options(["--username", "--password", "--file"])
    arguments.set_default("file", "mint_backup_%s.csv" % str(
    return arguments.parse_args()[0] # options

if __name__ == '__main__':    
    options = getOptions()
    mint = mintlib()
    mint.login(options.username, options.password)
    print "Done"
The command to run it looks like:
python --username=foo --password=bar

I'm currently working at NerdWallet, a startup in San Francisco trying to bring clarity to all of life's financial decisions. We're hiring like crazy. Hit me up on Twitter, I would love to talk.

Follow @chase_seibert on Twitter