|
@@ -1,24 +1,29 @@
|
|
#!/usr/bin/python3
|
|
#!/usr/bin/python3
|
|
#
|
|
#
|
|
-# Copyright (c) Daniel Sheffield 2021 - 2023
|
|
|
|
|
|
+# Copyright (c) Daniel Sheffield 2021 - 2024
|
|
|
|
+# Copyright (c) Shannon Sheffield 2021 - 2024
|
|
#
|
|
#
|
|
# All rights reserved
|
|
# All rights reserved
|
|
#
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY
|
|
# THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY
|
|
#
|
|
#
|
|
-# usage: ./reconcile.py ~/gnucash/merged.gnucash 2021-11-01 2021-12-10 1
|
|
|
|
-# Alcohol Sundries CatFood Cleaning
|
|
|
|
-#
|
|
|
|
|
|
+import sys
|
|
|
|
+if sys.argv[1] == '-h':
|
|
|
|
+ print("""
|
|
|
|
+ usage: ./reconcile.py ~/gnucash/merged.gnucash 2021-11-01 2021-12-10 1 Alcohol Sundries CatFood Cleaning
|
|
|
|
+""")
|
|
|
|
+ sys.exit(0)
|
|
|
|
+
|
|
from datetime import datetime, timedelta
|
|
from datetime import datetime, timedelta
|
|
from dateutil.parser import parse as parse_time
|
|
from dateutil.parser import parse as parse_time
|
|
import itertools
|
|
import itertools
|
|
import gnucash
|
|
import gnucash
|
|
-import sys
|
|
|
|
import os
|
|
import os
|
|
import psycopg
|
|
import psycopg
|
|
from app.data.QueryManager import cursor_as_dict
|
|
from app.data.QueryManager import cursor_as_dict
|
|
from app.data.TransactionView import get_session_transactions_statement as get_statement
|
|
from app.data.TransactionView import get_session_transactions_statement as get_statement
|
|
|
|
|
|
|
|
+
|
|
try:
|
|
try:
|
|
from db_credentials import HOST, PASSWORD
|
|
from db_credentials import HOST, PASSWORD
|
|
host = f'host={HOST}'
|
|
host = f'host={HOST}'
|