Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement fetching account statements (HKKAU, HKEKA) #164

Closed
wants to merge 2 commits into from

Conversation

johan12345
Copy link
Contributor

@johan12345 johan12345 commented Apr 27, 2024

This adds support for listing and downloading account statements (Kontoauszüge, e.g., as PDF) using HKKAU and HKEKA segments.

Example:

from fints.client import FinTS3PinTanClient
from fints.formals import StatementFormat
from pathlib import Path

f = FinTS3PinTanClient(
    # ...
)
account = f.get_sepa_accounts()[0]
statements = f.get_statements(account)

for statement in statements:
    output_pdf = Path(f'statement_{statement.year}-{statement.statement_number:02d}.pdf')
    if not output_pdf.exists():
        resp = f.get_statement(account, statement.statement_number, statement.year, StatementFormat.PDF)
        with open(output_pdf, 'wb') as file:
            file.write(resp.data)

@raphaelm
Copy link
Owner

Merged manually in 62824ca and 4936e4a

@raphaelm raphaelm closed this Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants