Tool to convert proprietary bank statement to OFX format, suitable for importing to GnuCash
Project description
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. Run ofxstatement -h for more help. ofxstatement works under Python 3 and is not compatible with Python 2.
Rationale
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
The 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.
Run ofxstatement on 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
Before using ofxstatement, you have to install a plugin for your bank (or write your own!). Plugins are installed as regular python packages, 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
The resulting statement.ofx is then ready to be imported into a personal accounting system.
Known Plugins
There are several user-developed plugins available:
Plugin |
Description |
---|---|
Swift MT940 statements |
|
Generic ISO-20022 format |
|
PayPal, *.csv for private accounts |
|
Transferwise CSV (international) |
|
Plugins for several banks, operating in Lithuania: Swedbank, Danske and common Lithuanian exchange format - LITAS-ESIS. |
|
Plugin for Poštovní spořitelna (maxibps) and banks using GPC format (e.g., FIO banka, module gpc). |
|
Plugin for Air Bank a.s. (Czech Republic) |
|
Plugin for Raiffeisenbank a.s. (Czech Republic) |
|
Plugin for Skip Pay s.r.o. (Czech Republic) |
|
Plugin for UniCredit Bank Czech Republic and Slovakia |
|
Plugin for Equa Bank a.s. (Czech Republic) |
|
Komerční banka (Czech Republic) |
|
mBank S.A. (Czech Republic) |
|
Partners Banka, a.s. (Czech Republic) |
|
Plugin for OTP Bank, operating in Hungary |
|
Set of plugins, developed by @bubbas: dkb_cc and lbbamazon. |
|
Finnish Osuuspankki bank |
|
Nordea bank (at least Finnish branch of it) |
|
SEB (Sweden), it parses Export.xlsx for private accounts |
|
Länsförsäkringar (Sweden), it parses Kontoutdrag.xls for private accounts |
|
Belfius (Belgium) |
|
KeytradeBank (Belgium) |
|
ING (Belgium) |
|
KBC (Belgium) |
|
Argenta (Belgium) (by @woutbr) |
|
Argenta (Belgium, also supports french version) (fork by @Nick-DT) |
|
Crelan (Belgium) |
|
Belgian Triodos Bank CSV statements |
|
Belgian cooperative bank newB |
|
VDK (Belgium, French statements) |
|
Hello Bank (Belgium, French statements) |
|
Plugin for several german banks (1822direkt and Postbank at the moment) |
|
DAB Bank (Germany) |
|
Consorsbank (Germany) |
|
German Triodos Bank CSV statements (also works for GLS Bank) |
|
Sparkasse Freiburg-Nördlicher Breisgau (Germany) |
|
Ing Diba Bank (Germany) |
|
Mastercard PDF statements (Germany) |
|
Sparkasse PDF statements (Germany) |
|
Plugins for several banks, operating in Austria: Easybank, ING-Diba, Livebank, Raiffeisenbank. |
|
Swiss PostFinance (E-Finance Java text based bank/credit statements). |
|
FinecoBank (Italy) |
|
Intesa San Paolo xlsx balance file (Italy) |
|
CheBanca! xlsx format (Italy) |
|
N26 Bank (Italy) |
|
Widiba and Webank (Italy) |
|
BancoPosta - Poste Italiane (Italy) |
|
Hype - Banca Sella (Italy) |
|
Betterment (USA) |
|
First Republic Bank (USA) |
|
Simple (USA, defunct) JSON financial statement format |
|
MBank.sk (Slovakia) |
|
Latvian banks |
|
SEB (Estonia), parses proprietary csv file |
|
Swedbank (Estonia), parses proprietary csv file |
|
Support for some Polish banks and financial institutions |
|
Support for several Russian banks: Avangard, AlfaBank, Tinkoff, SberBank (both debit and csv), VTB. |
|
Arion bank (Iceland) |
|
Revolut Mastercard |
|
Arbejdernes Landsbank (Denmark) |
|
Trust Merchant Bank (DRC) |
|
Stanbic Bank (Zambia) |
|
Dutch financial institutes like ICSCards and ING |
|
French financial institutes like BanquePopulaire |
|
Charles Schwab investment history JSON export |
|
BBVA (Spain) |
|
Converts Quicken Interchange Format (QIF) formatted bank transaction files |
|
Converts Santander transaction files |
Advanced Configuration
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 edit-config 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 --type command line parameter. Each section must provide a plugin option that points to one of the registered conversion plugins. Other parameters are plugin specific.
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 swedbank and litas-esis. The litas-esis 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 danske.ofx, run:
$ ofxstatement -t danske:usd danske.csv danske.ofx
Note that configuration parameters are plugin specific. See the plugin documentation for more info.
To use a custom configuration file, pass the -c / --config option:
$ ofxstatement convert -t pluginname -c /path/to/myconfig.ini input.csv output.ofx
Development / Testing
ofxstatemnt uses pipenv to manage the development environment and dependencies:
$ pip install pipenv $ git clone https://github.com/<your_account>/ofxstatement.git $ cd ofxstatement $ pipenv sync --dev
And finally run the test suite:
$ pipenv shell $ pytest
When satisfied, you may create a pull request.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ofxstatement-0.9.2.tar.gz
.
File metadata
- Download URL: ofxstatement-0.9.2.tar.gz
- Upload date:
- Size: 81.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c1b7b85b7d7bc2397ab0523aec0e702a27ae574ebd550743d951ffed4117152 |
|
MD5 | cf862460e9c6c2146dcf23af8024c34b |
|
BLAKE2b-256 | bae90ae99bc25e887cd25010b08b183acb34421fad38449bce42b43b73288be3 |
File details
Details for the file ofxstatement-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: ofxstatement-0.9.2-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a90c5406b3cd07f7f06d4645ce7e1b574d09531de25cb9c0f4d6819eff55b01 |
|
MD5 | c1b5947ff91daffb48c674b7403afbf2 |
|
BLAKE2b-256 | 909bd0e6df9be799456b1665cac72e9d00d05fad252d6d8a403f3bde8ead413b |