Skip to content

Instantly share code, notes, and snippets.

@beettlle
Created October 15, 2017 19:56
Show Gist options
  • Save beettlle/b5684e5db48d8f50967c926450122079 to your computer and use it in GitHub Desktop.
Save beettlle/b5684e5db48d8f50967c926450122079 to your computer and use it in GitHub Desktop.
Convert Mint output to something useful to me
with open("./transactions.csv", 'rb') as csvfile:
with open("./transactions2.csv", 'wb') as csvfile2:
fileread = csv.reader(csvfile, delimiter=',', quotechar='"')
filewrite = csv.writer(csvfile2, delimiter=',', quotechar='"', quoting=csv.QUOTE_ALL)
for row in fileread :
if row[3] != 'Amount' :
row.append(row[3] if row[4] == 'credit' else str(float(row[3])*-1))
else:
row.append("Calculated Amount")
filewrite.writerow(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment