As a side project, I created a CSV to OFX converter that applies custom mappings to CSV data to export them to QIF or OFX files. This morning, I added the ability to override the built-in mappings with custom mappings that suite your needs.
Basically, you can take financial data from any institution and modify one of the existing mappings to provide the information needed for each export format. Once you’ve done that for your bank, you can import CSV data and export OFX or QIF for import into whichever financial software you prefer.
csv2ofx requires wxPython. You can retrieve the latest source with git:
> git clone git://github.com/mulicheng/csv2ofx.git > cd csv2ofx > # use csv2ofx from the source directory > ./csv2ofx > # or install it site-wide > python setup.py install > # csv2ofx installed in path
You may also download a zip or tar archive from github if you prefer to grab a copy but don’t want to track the source repository. Go to the source repository for csv2ofx and click the download link.
There are directions in src/mappings.py and the README file for modifying mappings to suite your needs.
Contributions are welcome. Enjoy.
Added MS Money Rep and UBS support to csv2ofx
This is exactly what I was looking for. Unfortunately, I don’t have the wxPython module installed. Based on my reading of this:
I searched my repos for “python-wxgtk” — which I wouldn’t have come up with on my own — and installed python-wxgtk2.8
Also, for what it is worth, I couldn’t get wesabe to load the OFX but the QIF worked.
Hi dear, I’vnt understand how to skip n-lines ! Please can you explain me.
Thankx for your tool. 🙂
Have you an email where can I send my custom function and configuration for Fineco Bank ( an italian bank )?
You can use the contact me link.
Very nice. Can you recommend any documentation on how OFX works or how I should be approaching the mapping? I’m struggling to use what you’ve provided as a template and create a custom mapping for my Fidelity Investment accounts.
I continue to run into this error:
KeyError: ‘Split Type’
But if I comment out the split line or get around that error another way I seem to just stir up more trouble.
The README file and the mappings.py file both contain documentation on the format of the OFX and QIF mapping requirements. I’d like to also start a wiki page on the github site where people can add custom mappings for additional banks. Part of the reason this tool is written the way it is is because it seems almost every bank has their own csv format.
You can also send me a sample csv directly (using the contact me link above.) if you can’t quite get a mapping to work.
Getting this error with Yodlee generated csv when the script trys to save the file:
Traceback (most recent call last):
File “/Library/Python/2.6/site-packages/csv2ofx/__init__.py”, line 210, in OnExport
File “/Library/Python/2.6/site-packages/csv2ofx/ofx.py”, line 16, in export
if mapping[‘skip’](row,grid): continue
File “/Library/Python/2.6/site-packages/csv2ofx/mappings.py”, line 99, in
‘skip’:lambda row,grid: fromCSVCol(row,grid,’Split Type’) == ‘Split’,
File “/Library/Python/2.6/site-packages/csv2ofx/csvutils.py”, line 60, in fromCSVCol
File “/Library/Python/2.6/site-packages/csv2ofx/csvutils.py”, line 44, in GetColPos
KeyError: ‘Split Type’
Seems to import fine as I can see everything in place in the GUI. Any ideas?
You can try also my online converter at http://qifer.seasidehosting.st , only QIF target is supported but the user can choose freely the columns to convert.
Thanks for the script. I was able to use it to generate an OFX file perfectly. However, I wish to automate the process in a php script that will download a csv file from mint and then process it with csv2ofx. How can I call csv2ofx from within a php script so that I don’t have to use the gui? Thanks!
P.S. if anyone wants a copy of my custom mint mappings, let me know.
Why don’t you post them to the wiki for csv2ofx on github:
For a windows desktop utility to convert CSV and QIF to OFX try iCreateOFX Basic from
Have you got the PHP based script, as i dont know how to use python.
I am trying to figure out to start the gui.
I have tried a few ways to open the xrc file.
Can you supply a script to start the gui ?
there is a desktop application (for Windows) to convert CSV to QIF. It’s called CSV2QIF at http://www.csv2qif.com
As long as a CSV file has a header with common sense column names, CSV2QIF will figure out by itself the mapping and convert.
this is probably a stupid question.
I’m new to Python. I’ve installed wxPython, and used these command:
They all seemed successful.
But then what should I do? How should I execute/run the programme?
Thanks a lot.
Doesn’t seem to work at all and there is very little in the way of instructions. Kind of a waste of time really.
Unmaintained software. Sorry. After 7 years I wouldn’t be surprised if it no longer works at all. It’s open source though. Feel free to update it to current standards and software SDKs 😉