summaryrefslogtreecommitdiff
path: root/schools-cc-importer.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
committerluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
commitab987e10f154f5536bb8fd936ae0966e909fa969 (patch)
tree9de5076f38b71ececb1bc94f8d9d19170898d603 /schools-cc-importer.py
added all my scriptssynced/master
Diffstat (limited to 'schools-cc-importer.py')
-rw-r--r--schools-cc-importer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/schools-cc-importer.py b/schools-cc-importer.py
new file mode 100644
index 0000000..0741d3b
--- /dev/null
+++ b/schools-cc-importer.py
@@ -0,0 +1,12 @@
+import csv
+from datetime import datetime
+with open('transactions.CSV', newline='') as csvfile:
+ with open("temp-trans-out.txt", "w") as output:
+ trans = csv.reader(csvfile, delimiter=',', quotechar='|')
+ for t in trans:
+ dt = datetime.strptime(t[0], '%m/%d/%Y')
+ dt = dt.strftime("%Y-%m-%d")
+ line = '%s * "%s"\n Liabilities:SchoolsFirst:Card -%s USD\n Expenses:Misc:Amazon %s USD\n\n' % (dt, t[1], t[5], t[5])
+ output.write(line)
+ output.close()
+ csvfile.close()