Querying GNUcash from external programs?

Ian Warford iwarford@home.com
Thu, 20 Sep 2001 20:45:07 -0400


I've begun the process of taking over the FreeCoins<->GNUCash conduit,
and I'm researching possible approaches.

My initial approach looks like it's frontend is going to be written in
Perl, and linked into pilot-manager, as well as having a command-line
frontend.   I'm after comments and thoughts on how best to go about the
backend of it.

I've gone through 3 different approaches in my mind right now :

(1) If GNUCash is modular enough, write a set of functions that act as a
'headless' GNUCash, loading the specified data file in, and keeping
it in memory.  Then use the Query API, and various other functions to
update the data back and forth between the Freecoins database, and then
save the file to the drive.  How this would interact with a running
GNUCash is really the question.

This seems to be the most appropriate way to do things.

(2) Parse the GNUCash data files from scratch.  This still leaves worrying
about interaction with a running GNUCash process.

(3) Use some form of IPC to talk to GNUCash while it's running.

The previous maintainer of what was to become the Freecoins<->GNUCash
conduit had written the bulk of his as a standalone program, roughly
doing (1).  However, since all of his code is really just what I'm trying
to write, but all in C++, it isn't doable to reuse what he did.

Any thoughts on the matter would be appreciated.

--
Ian Warford / iwarford@home.com

When I consider the small span of my life  absorbed in the eternity
of all time,  or the small part of  space which I  can touch or see
engulfed by the infinite  immensity of spaces  that I know  not and
that know me not, I am frightened and astonished to see myself here
instead of there... now instead of then.  -"-,_,-"-   Blaise Pascal