Created
April 13, 2019 19:29
-
-
Save connerbrooks/d671b7b282e8d21db65aa27773ae0f6f to your computer and use it in GitHub Desktop.
Script to read chase statement CSV and show running sum. Ignores payments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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