Parsing Lexware Qif files with Python (and pandas)
Python has a few packages to parse Quicken files, among them:
- https://github.com/giacomos/qifparse
- https://github.com/blais/qifparse, forked from the first one
However both packages generated errors when I used them with the file from Lexware Financial Manager 2019. Also as a programming exercise I decided to write my own parser, available under https://github.com/UweZiegenhagen/PyQIF-Parser.
As of today the code parses Quicken files and generates an Excel file with the accounts, classifications, categories and transactions it finds in the file. It supports (German) online accounts, investment accounts are not (yet) supported. I do not use my portfolio with Quicken so I probably will not implement this, feel free ask for it (with example files) or send pull requests.
Some code example is provided:
from PyQifParser import PyQifParser P = PyQifParser(r'C:\Users\Uwe\Nextcloud\QIF-Parser\Quicken_h.QIF') P.parse() P.to_excel('r:/export.xlsx') |
I plan to extend the code with repect to a) visualisation, b) sanity checks and c) statistical analyses