Converting financial CSV data to OFX or QIF import files

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.

Update: 02/17/10
Added MS Money Rep and UBS support to csv2ofx

This entry was posted in Software and tagged , , , , , , . Bookmark the permalink.

17 Responses to Converting financial CSV data to OFX or QIF import files

  1. amanda says:

    Thanks!

    This is exactly what I was looking for. Unfortunately, I don’t have the wxPython module installed. Based on my reading of this:

    http://www.wxpython.org/download.php#prerequisites

    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.

  2. zioalex says:

    Hi dear, I’vnt understand how to skip n-lines ! Please can you explain me.
    Thankx for your tool. 🙂

  3. zioalex says:

    Have you an email where can I send my custom function and configuration for Fineco Bank ( an italian bank )?

  4. Dennis says:

    You can use the contact me link.

  5. bdp says:

    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.

  6. Dennis says:

    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.

  7. rme says:

    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
    csv2ofx_export(path,mapping,grid)
    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
    return xmlize(grid.GetValue(row,grid.GetColPos(col_name)))
    File “/Library/Python/2.6/site-packages/csv2ofx/csvutils.py”, line 44, in GetColPos
    return self.col_map[col_name]
    KeyError: ‘Split Type’

    Seems to import fine as I can see everything in place in the GUI. Any ideas?

    Many Thanks

  8. paolo says:

    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.

    Paolo

  9. reubano says:

    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!

    Reuben

    P.S. if anyone wants a copy of my custom mint mappings, let me know.

  10. Dennis says:

    Why don’t you post them to the wiki for csv2ofx on github:

  11. vybixa says:

    For a windows desktop utility to convert CSV and QIF to OFX try iCreateOFX Basic from
    http://icreateofx.co.uk/Convert-CSV-to-OFX

  12. Suresh says:

    Hi,

    Have you got the PHP based script, as i dont know how to use python.

    Thanks.

  13. randfb says:

    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 ?

    thanks
    Rand

  14. seletit says:

    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.

  15. theo says:

    this is probably a stupid question.
    I’m new to Python. I’ve installed wxPython, and used these command:
    setup.py install
    import csv2ofx
    They all seemed successful.
    But then what should I do? How should I execute/run the programme?
    Thanks a lot.

  16. jp says:

    Doesn’t seem to work at all and there is very little in the way of instructions. Kind of a waste of time really.

  17. Dennis says:

    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 😉

Comments are closed.