Skip to content

Instantly share code, notes, and snippets.

@connerbrooks
Created April 13, 2019 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save connerbrooks/d671b7b282e8d21db65aa27773ae0f6f to your computer and use it in GitHub Desktop.
Save connerbrooks/d671b7b282e8d21db65aa27773ae0f6f to your computer and use it in GitHub Desktop.
Script to read chase statement CSV and show running sum. Ignores payments.
#!/usr/bin/env python
import sys
import csv
if len(sys.argv) != 2:
print "Usage: chase_running_sum <chase_csv>"
exit()
with open(sys.argv[1], 'rb') as csvfile:
reader = csv.reader(csvfile)
sum = 0
for row in reader:
if 'Transaction Date' == row[0]:
continue
tx_date = row[0]
post_date = row[1]
title = row[2]
row_credit = float(row[5])
if row_credit > 0:
continue
sum -= row_credit
#print row[5] + '\t' + str(sum)
print("{: <20} {: <40} {: <10} {: >10}".format(tx_date, title, str(row_credit), str(sum)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment