Recently, I opened a new online account at a new institution. Unfortunately, they do not provide a direct online access using a protocol such as HBCI or OFX which are already integrated into KMyMoney, but only a web frontend. So what, I thought, I won’t use it on a daily basis and can probably live with manually entering the transactions into the ledger.

After I used the account for some test transactions, I found out that the institution provides a CSV download for transactions.

Bank’s Web Interface with the download button (EXPORTIEREN)

Well, KMyMoney has a CSV importer which has recently been overhauled but which I never used. So I gave it a try and was able to import the transactions after I had downloaded the file from the bank’s server to my local disc. Now it would be nice to just click on the download button of the web page, instruct the browser to open the file using KMyMoney and see the data being imported into my financial records without the detour of the local file.

Web-Connect to the rescue.

Up in Randa I added a bunch of comments to the ToDo port to KF5 markers in the code to get more information which feature is still not ported.  One of them was Web-Connect. We had that feature in the KDE4 release for a long time and it is used by the people downloading their data using the above mentioned method.

Since it was not yet ported to KF5, I finally took some time and rewrote the mechanism in a hopefully more portable fashion to support more platforms. Time will tell, if that is the case, as I don’t have access to MS-Windows nore MacOS. The original implementation was based on D-BUS communication which is known not to be supported on those systems.

The challenge I was facing, is to get the information (filename) about the downloaded file into an already running KMyMoney instance.

Once that was solved, I had to find out, that the overhauled CSV importer does not provide the interface needed by the existing logic. After I had an idea how the CSV importer works internally, I additionally derived the new CSVImporterPlugin from the existing KMyMoneyPlugin::ImporterPlugin interface class, implemented the necessary methods and after a few tweaks in the CSV importer itself and fixing some obvious bugs on the side, I had it working.

Now it is as simple as clicking the download button on the bank’s web-site and instruct e.g. Firefox

The standard Firefox download dialog

to process the downloaded file using KMyMoney and simply land in KMyMoney’s CSV importer dialog with the filename preloaded. Voilà! BTW: this also works for OFX files.

Things left

Regarding a KF5 based release the list of things that will be missing in the first round (compared to the current stable KDE4 version) is now shorter by one item and looks as follows:

  • Direct network file access using KIO::NetAccess. Accessing your distant data files through mounted volumes is still possible
  • WebAccess, a function that allows importing your data files directly from a web-site by clicking on a link in the browser
  • Support for parenthesis around numbers representing negative values. Support for this has been lost while moving from KLocale to QLocale.
  • The payeeidentifier plugin required for directly entering bank transfers

 

KMyMoney’s WebConnect