def sync(db): print "Sync Transactions:" for bank in db.get_accounts(): print "\t Syncing %s" % bank["acct_id"] data = mymint.ofx_server.get_data(bank) ts = mymint.ofx_import.xml(data) db.add_transaction(ts) print "Database now contains %d transactions" % len(db.get_transactions())
def import_ofx(db,ofx_file): # Read data from OFX file f = open(filename,"r") data=f.read() f.close() # Parse as XML t = mymint.ofx_import.xml(data) # Add Transactions to DB db.add_transaction(t) print "Transaction imported from %s" % ofx_file print "Database now contains %d transactions" % len(db.get_transactions())