Coder Social home page Coder Social logo

colbrac / ing-to-qif-converter-for-kmymoney Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 35 KB

Script that converts ING bank csv to QIF format ready for consumption by KMyMoney, including a simple recurring transaction classification function

License: MIT License

Python 100.00%
python3 kmymoney-plugin finance-management csv-converter

ing-to-qif-converter-for-kmymoney's Introduction

ING to QIF converter for KMyMoney

Script that converts ING bank csv to qif format ready for consumption by KMyMoney, including a simple recurring transaction classification function

The Dutch ING bank allows for downloading transactions in a csv file. I use this script to convert the csv file to a qif file to manually import the transactions into KMyMoney, the awesome open source Personal Finance software. Try it out!

Automatic labelling of transactions

Recurring transactions are recognised and automatically assigned a category based on a string which can be anywhere in the transaction. The list of strings and the accompanying Payee and Category for KMyMoney are listed in an .xlsx file for easy editing.

File handling

Processed csv's are moved from the Downloads folder to a (configurable) archive folder. csv and qif files are renamed for better sorting.

Run standalone

The easiest way to use this script is to edit ing2qif.py itself and run it standalone:

  • Edit the ing2qif.py file to fill in the ING IBAN number and the KMyMoney account name.
  • Optionally change the folder in which the script looks for csv files.
  • Optionally edit the locations where the csv files will be archived and the qif files created.
  • Edit the bankstatementmapping.xlsx file to automatically categorise transactions or set variable to False to skip the mapping.
  • Run the ing2qif.py file.
  • Import the resulting qif file in KMyMoney.

Run as library

When you have more than 1 ING account, you could create scripts per account that import ing2qif and change only the variables. Personally I created several sheets in the xlsx for the different accounts. The scripts 'proces-{myaccount}.py' then take the following form:

import ing2qif as iq

iq.ING_IBAN = 'NL@@INGB@@@@@@@@@@'
iq.MAP_SHEET = 'Different sheet name'
iq.KMYMONEYACCOUNT = 'Different account name'

iq.run()

Run script from start menu in Windows 10 with (mini)conda environment

In my personal usecase the csv file is downloaded to the downloads folder, I run the script and import the resulting qif manually in KMyMoney. To run the script I open a Conda-enabled shell, navigate to the script folder and run the script. To simplify running the script I added a .bat file to the folder with the script with the following content:

@echo off
CALL C:\Users\<username>\Miniconda3\Scripts\activate.bat
python proces-<myaccount>.py
conda deactivate

Then I made a copy of the 'Anaconda Prompt' shortcut in the Windows Start Menu folder which points to this .bat file instead of the activate.bat and changed the working folder field.

Rerun after updating the mapping file

To rerun the conversion of csv file to qif file, for example after updating the bankstatementmapping file, use the run_redo() function. This function assumes the csv is already moved and renamed and will search the csv archive folder for the latest file for this bankaccount. My script to use this function looks like:

import ing2qif as iq

iq.ING_IBAN = 'NL@@INGB@@@@@@@@@@'
iq.MAP_SHEET = 'Different sheet name'
iq.KMYMONEYACCOUNT = 'Different account name'

iq.run_redo()

License

This script is provided under the MIT License. Please see the license file for more details.

ing-to-qif-converter-for-kmymoney's People

Contributors

colbrac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.