FinTS (HBCI) to OFX export, for using with YNAB

I’ve started using YNAB for controlling my financials. So YNAB does have an file-based import feature for transactions.
It supports these file types:

  • QFX and OFX
  • QIF
  • CSV

My bank provides the transactions only as CSV export in the GUI and this CSV is not compatible with YNAB.

I have build a Python script which connects to the banks FinTS API for download the transactions and write them to a OFX file.


You will find the script in this GitHub repository:


Please use pip to install these Python-modules first:

pip install fints lxml 


The scripts config File (settings.yml) is in yaml Syntax. This parameters must be defined:

  blz: 76010085
  acc: 12345678
  username: 'xxxxxx'
  api: '' 
  • blz: bank code
  • acc: bank account number
  • username: bank login Name or Number
  • api: FinTS (HBCI) API URL

Run the Script

➜  fintsToOFX git:(master) ✗ python3
Transactions for the last x Days:2

The script first asks you for your banking password or PIN. The second input is how many days in the past you will request.

The script will save the OFX file on your Desktop. Maybe it’s necessary that you edit the Path on Lines 88-90.