@@ -103,7 +103,8 @@ the problem.
103103 " Fetch holdings" ,
104104 " Fetch scheduled debits" ,
105105 " Fetch status protocol" ,
106- " Make a simple transfer"
106+ " Make a simple transfer" ,
107+ " Fetch statements as PDF" ,
107108 ]
108109
109110 print (" Choose an operation" )
@@ -173,5 +174,19 @@ the problem.
173174
174175 while isinstance (res, NeedTANResponse):
175176 res = ask_for_tan(res)
177+ elif choice == 11 :
178+ print (" Select statement" )
179+ statements = f.get_statements(account)
180+ for i, statement in enumerate (statements):
181+ print (i, f " Statement { statement.statement_number} / { statement.year} " )
182+ choice = int (input (" Choice: " ).strip())
183+ statement = statements[choice]
184+ output_pdf = ' statement.pdf'
185+ res = f.get_statement(account, statement.statement_number, statement.year, StatementFormat.PDF )
186+ while isinstance (res, NeedTANResponse):
187+ res = ask_for_tan(res)
188+ with open (output_pdf, ' wb' ) as file :
189+ file .write(res.data)
190+ print (" Written to" , output_pdf)
176191 except FinTSUnsupportedOperation as e:
177192 print (" This operation is not supported by this bank:" , e)
0 commit comments