From 138da17f65e764a0fa3a8f4fe4908706a122cb7a Mon Sep 17 00:00:00 2001 From: Gerwin van der Lugt Date: Mon, 18 May 2020 11:29:03 +0200 Subject: [PATCH] Changed Revolut expected CSV import format --- main.py | 5 ++++- revolut.py | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 0119c24..4050543 100644 --- a/main.py +++ b/main.py @@ -29,9 +29,12 @@ def main(): reader = RevolutCsvReader(args.input_file) with Mt940Writer(args.output_file, args.account_iban) as writer: - for transaction in reader.get_all_transactions(): + transactions = reader.get_all_transactions() + for transaction in transactions: writer.write_transaction(transaction) + print('Wrote {} transactions to file: {}.'.format(len(transaction), args.output_file)) + if __name__ == "__main__": main() \ No newline at end of file diff --git a/revolut.py b/revolut.py index 6c2f6fe..07dbde8 100644 --- a/revolut.py +++ b/revolut.py @@ -8,12 +8,12 @@ from datetime import datetime, timedelta from data import Transaction EXCPECT_HEADERS = [ - 'Date started', 'Time started', 'Date completed', 'Time completed', - 'State', 'Type', 'Description', 'Reference', 'Payer', 'Card name', - 'Card number', 'Orig currency', 'Orig amount', 'Payment currency', - 'Amount', 'Fee', 'Balance', 'Account', 'Beneficiary account number', - 'Beneficiary sort code or routing number', 'Beneficiary IBAN', - 'Beneficiary BIC' + 'Date started (UTC)', 'Time started (UTC)', 'Date completed (UTC)', + 'Time completed (UTC)', 'State', 'Type', 'Description', 'Reference', + 'Payer', 'Card name', 'Card number', 'Orig currency', 'Orig amount', + 'Payment currency', 'Amount', 'Fee', 'Balance', 'Account', + 'Beneficiary account number', 'Beneficiary sort code or routing number', + 'Beneficiary IBAN', 'Beneficiary BIC' ] NAME_REMOVE_PREFIXES = [