support historic banking data retrieval

This commit is contained in:
Kasownik 2021-03-07 22:57:04 +01:00
parent 990536f887
commit f5343ebd08

View file

@ -354,6 +354,8 @@ parser.add_argument('-n', '--no-action', action="store_true", help='do not commi
parser.add_argument('-c', '--cached', action="store_true", help='use cached data (test)')
parser.add_argument('-l', '--load', action='append', help='process specified files (test)')
parser.add_argument('-t', '--token', help='use authentication token')
parser.add_argument('--start', type=lambda s: datetime.strptime(s, '%Y-%m-%d').date(), help='start date (YYYY-MM-DD)')
parser.add_argument('--end', type=lambda s: datetime.strptime(s, '%Y-%m-%d').date(), help='end date (YYYY-MM-DD)')
parser.add_argument('--no-lock', action='store_true', help='don\'t use lockfile (test)')
parser.add_argument('--print-schema', action="store_true", help='print table schema and quit')
@ -426,7 +428,7 @@ if __name__ == "__main__":
for account_number, account in wallet["accounts"].items():
logging.debug("Fetching history for account {} ({})".format(
account_number, account["id"]))
history = fetcher.fetch_account_history(account["id"])
history = fetcher.fetch_account_history(account["id"], start=args.start, end=args.end)
history_logs[account_number] = history
with open(CACHE_DIR + "/" + account_number, 'w') as fd: