Generic importer:QIF

Chintan Agarwal chintan.agarwal at gmail.com
Sun Jun 24 14:22:44 EDT 2007


Thanks for that information. I could not find the declaration of Transaction
structure(or its un-typedefed form) per say but from the functions in the
file, could gather the variable types present.

I think that for QIF importer, we could have a simpler structure, akin OFX
importer wherein the function void gnc_file_ofx_import (void) (in
/src/import-export/ofx/gnc-ofx-import.c)is the top-level function. In such a
top-level function there are basically three steps:-
1) Creating a context for the input data(done by QIF context)
2) Parsing the data(done by QIF parser written in /src/import-export/qif)
3) Integrating the parsed data into the Gnucash accounts, actions like
matching, mapping etc.(as pointed out earlier, this is done simply by using
functions in import-main-matcher.h, specifically the function
gnc_gen_trans_list_add_trans(...)).
As for the frontend, it would be there only in step 1 as after that the
parsing process( in the backend) starts and completes.

Some questions:-
1) Do the above three steps miss out something vital for QIF import?
2) The top-level function that would be made should be by what name? In
other words, which function call results in the QIF import process being
trigerred?
3) Does GNUCash use the standard GNU indentation format?
Thanks.
-Chintan

On 6/23/07, warlord at mit.edu <warlord at mit.edu> wrote:
>
> src/engine/Transaction.*
>
> -derek
>
> Quoting Chintan Agarwal <chintan.agarwal at gmail.com>:
>
> > The OFX importer is proving very useful in understanding how to write a
> qif
> > importer with the  given requirements. There was another question I had.
> > This pertains to the variable type Transaction which is required by the
> > gnc_gen_trans_list_add_trans function in import-main-matcher.h. Due to
> the
> > frequent occurrence of the word Transaction, I could not successfully
> find
> > the definition of the data-type(=>Transaction data-type). If you could
> point
> > me to the file that contains the same, I would figure out exactly what
> > values in the datatype are relevant to QIF.
> > Thanks.
> > -Chintan
> >
> > On 6/22/07, Christian Stimming <stimming at tuhh.de> wrote:
> >>
> >> Hi Chintan,
> >>
> >> please remember to CC gnucash-devel on all replies.
> >>
> >> Quoting Chintan Agarwal <chintan.agarwal at gmail.com>:
> >> > Thanks for the prompt reply. So importing from any format now
> >> essentially
> >> > involves parsing it and passing on the parsed object to the generic
> >> > importer.
> >>
> >> Yes, exactly.
> >>
> >> > The front-end, of course has to be taken care of separately. I
> >> > actually got confused when I saw import-parse.c in
> /src/import-export.
> >> Does
> >> > this actually parse all the formats(as it has to be generic)? I
> >> understand
> >> > the post parsing part, as all the formats are then on a common
> footing
> >> and
> >> > the same code can be used for mapping etc. However, I could not
> >> understand
> >> > the generic parser part.
> >>
> >> I don't think the functions of import-parse.h are used anywhere at
> >> all. Basically you can ignore that file. The mainly interesting parts
> >> of the "generic importer" is in import-main-matcher.h; you probably
> >> don't need much else than that.
> >>
> >> > Also, if we have all the code generic( i.e. deals
> >> > with all the various formats), what would be the difference between
> >> various
> >> > branches(OFX, HBCI, QIF etc.)?
> >>
> >> Again, import-parse.h is currently unused. The different
> >> sub-directories all create a Transaction* and pass it to the functions
> >> in import-main-matcher.h.
> >>
> >> > PS: I just hope I code enough to have bugs in them ;)
> >>
> >> Heheh.
> >>
> >> Christian
> >>
> >> >
> >> > On 6/22/07, Christian Stimming < stimming at tuhh.de> wrote:
> >> >>
> >> >> Quoting Chintan Agarwal < chintan.agarwal at gmail.com>:
> >> >>
> >> >>> Can the code in /src/import-export/import-backend.c and other files
> in
> >> >> the
> >> >>> same folder be used for mapping a parsed qif file? As far as I
> >> >> understand,
> >> >>> this is the generic framework that we want to use for all imports.
> Is
> >> my
> >> >>> understanding right?
> >> >>
> >> >> Yes, this is completely right.
> >> >>
> >> >> Also not that there are still a few bugs in the "generic importer"
> >> >> (import-backend.c code)
> >> >>
> http://lists.gnucash.org/pipermail/gnucash-devel/2007-June/020669.html
> >> >> , but I'm quite confident those will get fixed over the next months.
> >>
> >>
> > _______________________________________________
> > gnucash-devel mailing list
> > gnucash-devel at gnucash.org
> > https://lists.gnucash.org/mailman/listinfo/gnucash-devel
> >
>
>
>


More information about the gnucash-devel mailing list