2017-11-12: Flatex offers some csv downloads by now so I haven’t needed this project in while. I might become more interested again though because there is still some information that Flatex only publishes via pdf.
Ok, I am writing this in English, but it’s probably only relevant for my fellow Germans because it’s very specific to German stock broker Flatex.
For whatever reason, they do not offer csv reports directly (I asked them when I started writing. If they ever do, please be so kind and send me an email telling me to stop writing this). Instead, you download pdf files and try to make the most of them. In the past, I would go through them by hand and insert the content to Excel. The calculations I did there however would even not update correctly when inserting new lines, etc. Briefly, I was fed up with the process.
So the overall goal is to have a simple portfolio tracker in Python. I am not quite sure if I will base it upon sqlite and use xls only as the output format (so I don’t have to write a GUI) or if everything will take place in Excel&Co.
Anyway, for now, I am in a very early stage and all that the program does is parsing a subfolder or rather a filepattern and adding all the individual reports there to an aggregated xls.
If you want to take a look at it, the corresponding mercurial repository is bitbucket/matthias_kauer/flatex_report_parser. I cleaned up the repository, added some comments and an example call. Try “sh example_call.sh”, to get started. Let me know if it helps you and of course if you have something to contribute.
My own wishlist for features is quite long already, but if you think you have something that I haven’t thought of, let me know as well 😉
It’s in a very early stage though and I have only tested it on Linux. It should run on Windows, but installing the required Python packages there could be a pain. If you must try, I suggest you start from python(x,y) which brings pandas after which you probably only need to pip pdfminer. If that just made no sense to you, I’m afraid it’s too early for you to get on board.
Finally a screenshot of the entire thing in action. Start by examining sell_parse.py, so you know where to put your reports (and double-check that I am not secretly uploading your data anywhere) and then call it (you need to use python2, but that should still be standard python on most systems) [the picture is a bit different, but the features didn’t change]