manual OFX creation

Adam Monsen haircut at gmail.com
Mon Nov 20 02:00:21 EST 2006


So, I wrote a little python filter to convert CSV financial data to QIF
which works nicely, and GnuCash even allows it to be imported. Whee!

Only problem is, there doesn't seem to be any of that extremely handy
automatic transaction description-to-GnuCash account matching that occurs
when I do an OFX import. Well, there's something, but it doesn't seem to be
as smart as whatever happens for OFX. It is definitely a different user
interface; it only seems to match the transaction to the correct account
when the description is a verbatim match.

1. Is there some way to use the OFX import matching goodness when importing
a QIF file?

2. Why is the QIF import UI different than the OFX import UI?

3. Is there perhaps an easy way to convert QIF to OFX so I can sidestep the
QIF importer?

4. When I do have to manually pick the category, it takes for fricking ever
to use the mouse to do it. It would be way cooler to be able to use
keystrokes like "A:L:C" for "Accounts:Liquid:Cash in Wallet"

I did some searching in the documentation and on the mailing list, but I
couldn't find the answer(s) I am looking for.

Here's the filter, in case anyone is curious:
-----------------------------------8<-----------------------------------
import cStringIO
import csv
from datetime import datetime

input_data = '''
11/1,"Lunch at Jai Thai","-$8.50"
11/2,"Bus Ticket","-$3.00"
'''

fd = cStringIO.StringIO(input_data)

print '''!Account
NAssets:Liquid:Cash in Wallet
TCash
^'''

for row in csv.reader(fd):
    if len(row) < 3: continue

    trans_date = row[0]
    year = datetime.now().year
    trans_date += '/%s' % year

    print 'D%s' % trans_date
    print 'M%s' % row[1]
    print 'T%s' % row[2]
    print '^'
----------------------------------->8-----------------------------------

Sample output:
-----------------------------------8<-----------------------------------
!Account
NAssets:Liquid:Cash in Wallet
TCash
^
D11/1/2006
MLunch at Jai Thai
T-$8.50
^
D11/2/2006
MBus Ticket
T-$3.00
^
----------------------------------->8-----------------------------------

Note to self 1: Mark J. Cox's "2ofx.pl" might be helpful in learning how to
author OFX.
http://www.awe.com/mark/financial/2ofx.pl

Note to self 2: OFX looks quite complex to author. It seems to need some
kind of running total/current balance information that I don't know how to
provide.

Note to self 3: Right now my choices are looking like:
a. Just be happy with the QIF importer
b. try to figure out OFX
c. try to hack GnuCash

-- 
Adam Monsen


More information about the gnucash-user mailing list