Convert Bank Transactions XLS to CSV in Python
I’ve written previously on importing transactions to hledger/ledger from KBC bank in JavaScript and PTSB bank in Python. I took different approaches to each:
- For KBC, you needed to log in and run Javascript which scrape the transaction table and download it formatted as CSV
- For PTSB, the script automatted logging in, get the transaction table and save locally as CSV
Both approaches are valid - but suffer from the same issues: any change the bank makes to it website needs to be updated in the code. The KBC/JavaScript approach was a bit more robust in that it would just search for rows on a website and download as CSV.