Ofxstatement is a tool to convert proprietary bank statements to OFX format,
suitable for importing into personal accounting systems like GnuCash. This
package provides a command line tool to run:
ofxstatement -h for more help.
ofxstatement works under Python 3 and
is not compatible with Python 2.
Most internet banking systems are capable of exporting account transactions to some sort of computer readable format, but few support standard data formats, like OFX. On the other hand, personal accounting systems such as GnuCash support standard formats only, and will probably never support proprietary statement formats of online banking systems.
To bridge the gap between them, this ofxstatement tool was created.
Mode of Operation
ofxstatement tool is intended to be used in the following workflow:
- At the end of each month, use your online banking service to export statements from all of your bank accounts in a format known to ofxstatement.
ofxstatementon each exported file to convert it to OFX. Shell scripts or a Makefile may help to automate this routine.
- Import the generated OFX file into your personal accounting system.
Installation and Usage
ofxstatement, you have to install a plugin for your bank (or
write your own!). Plugins are installed as regular python eggs, with
easy_install or pip, for example:
$ pip3 install ofxstatement-lithuanian
Note that ofxstatement itself will be installed automatically this way. After
the installation, the
ofxstatement utility will be available.
Users of Ubuntu and Debian operating systems can install ofxstatement from official package repositories:
$ apt install ofxstatement ofxstatement-plugins
You can check that ofxstatement is working by running:
$ ofxstatement list-plugins
You should get a list of your installed plugins.
After installation, the usage is simple:
$ ofxstatement convert -t <plugin> bank_statement.csv statement.ofx
statement.ofx is then ready to be imported into a personal
Development / test
When you want to develop, first fork this repository to your GitHub environment and then:
$ git clone https://github.com/<your_account>/ofxstatement.git $ cd ofxstatement $ pip install -e .
Now you can install the test requirements:
$ pip install -r test_requirements.txt
And finally run your test:
When satisfied, you may create a pull request.
There are several user-developed plugins available:
|ofxstatement-lithuanian||Plugins for several banks, operating in Lithuania: Swedbank, Danske and common Lithuanian exchange format - LITAS-ESIS.|
|ofxstatement-czech||Plugin for Poštovní spořitelna
|ofxstatement-airbankcz||Plugin for Air Bank a.s. (Czech Republic)|
|ofxstatement-raiffeisencz||Plugin for Raiffeisenbank a.s. (Czech Republic)|
|ofxstatement-unicreditcz||Plugin for UniCredit Bank Czech Republic and Slovakia|
|ofxstatement-otp||Plugin for OTP Bank, operating in Hungary|
|ofxstatement-bubbas||Set of plugins, developed by @bubbas:
|banking.statements.osuuspankki||Finnish Osuuspankki bank|
|banking.statements.nordea||Nordea bank (at least Finnish branch of it)|
|ofxstatement-germany||Plugin for several german banks (1822direkt and Postbank at the moment)|
|ofxstatement-austrian||Plugins for several banks, operating in Austria: Easybank, ING-Diba, Livebank, Raiffeisenbank.|
|ofxstatement-postfinance||Swiss PostFinance (E-Finance Java text based bank/credit statements).|
|ofxstatement-simple||Simple (the bank, https://www.simple.com/) JSON financial statement format|
|ofxstatement-iso20022||Support for generic ISO-20022 format|
|ofxstatement-seb||SEB (Sweden), it parses Export.xlsx for private accounts|
|ofxstatement-alfabank||AlfaBank (Russia), it parses movementList.csv for private accounts|
|ofxstatement-paypal||PayPal, it parses *.csv for private accounts|
|ofxstatement-polish||Support for some Polish banks and financial institutions|
|ofxstatement-russian||Support for several Russian banks: Avangard, Tinkoff, Sberbank (debit).|
|ofxstatement-dab||DAB Bank (Germany)|
|ofxstatement-is-arionbanki||Arion bank in Iceland|
|ofxstatement-be-triodos||Belgian Triodos Bank CSV statements|
|ofxstatement-de-triodos||German Triodos Bank CSV statements (also works for GLS Bank)|
|ofxstatement-lansforsakringar||Länsförsäkringar (Sweden), it parses Kontoutdrag.xls for private accounts|
|ofxstatement-sp-freiburg||Sparkasse Freiburg-Nördlicher Breisgau (Germany)|
|ofxstatement-al_bank||Arbejdernes Landsbank (Denmark)|
|ofxstatement-intesasp||Intesa San Paolo (xlsx balance file)|
|ofxstatement-de-ing||Ing Diba Bank (Germany)|
|ofxstatement-us-first-republic||First Republic Bank (USA)|
|ofxstatement-cz-komercni||Komerční banka (Czech Republic)|
|ofxstatement-cd-tmb||Trust Merchant Bank (DRC)|
|ofxstatement-zm-stanbic||Stanbic Bank (Zambia)|
|ofxstatement-dutch||Dutch financial institutes like ICSCards and ING|
|ofxstatement-french||French financial institutes like BanquePopulaire|
|ofxstatement-mt940||All financial institutes providing Swift MT940 statements|
While ofxstatement can be used without any configuration, some plugins may
accept additional configuration parameters. These parameters can be specified
in a configuration file. The configuration file can be edited using the
command that opens your favorite editor (defined by environment variable
EDITOR or else the default for your platform) with the configuration file:
$ ofxstatement edit-config
The configuration file format is in the standard .ini format. The
configuration is divided into sections that correspond to the
command line parameter. Each section must provide a
plugin option that
points to one of the registered conversion plugins. Other parameters are
A sample configuration file:
[swedbank] plugin = swedbank [danske:usd] plugin = litas-esis charset = cp1257 currency = USD account = LT123456789012345678
Such a configuration will let ofxstatement know about two statement file
formats handled by the plugins
plugin will load statements using the
cp1257 charset and set a custom currency
and account number. This way, GnuCash will automatically associate the
generated .ofx file with a particular GnuCash account.
To convert the proprietary CSV file
danske.csv into the OFX file
$ ofxstatement -t danske:usd danske.csv danske.ofx
Note that configuration parameters are plugin specific. See the plugin documentation for more info.
Writing your own Plugin
If the plugin for your bank has not been developed yet (see Known plugins section above) you can easily write your own, provided you have some knowledge about the Python programming language. There is an ofxstatement-sample plugin project available that provides sample boilerplate and describes the plugin development process in detail.