Invoice API

Don Quixote de la Mancha quixote at dulcineatech.com
Tue Mar 2 11:38:37 EST 2010


On Tue, Mar 2, 2010 at 8:29 AM, Derek Atkins <warlord at mit.edu> wrote:
> Don Quixote de la Mancha <quixote at dulcineatech.com> writes:
>> As long as you're careful not to edit the file while GnuCash has it
>> open, it ought to be possible to write some code that would insert the
>> proper XML for an invoice right into the file.
>
> Bas advice.  We neither advise nor support direct modifications to the
> datafile.  All data should go through the GnuCash API.

I was pretty sure someone would say that.  And of course you're
completely correct - but if the required API didn't exist at all,
editing the XML would work provided one took care to do it right.

Funny thing though, a while back I asked about whether one could keep
one's GnuCash XML in Subversion, so that it would be possible to roll
back to any previous state of the file, as well as provide an audit
trail.  And someone on this very list replied that they do just that,
and that it works just fine.

My other reason for wanting to do that was to allow my business
partners to quickly and easily look at our books.  In principle they
all could edit the file then check it in to Subversion, but if there
was ever a commit conflict, of course all Hell would break loose.  My
objective was to enable read-only access for the others, and not at
all multi-user access.  I'd be the only one writing into the file.

There are Python bindings for GnuCash:

   http://wiki.gnucash.org/wiki/Python_Bindings

Perhaps someone could provide a Python binding that addressed the
invoice creation API.  If someone could supply just the needed shared
library to call from Python into the C API, it would become
straightforward to write a Python script to do the job.

I know Python pretty well, and could do that myself.  But I've tried
to build GnuCash from source several times.  I've been a coder for
twenty-two years, so long that there is no longer any kind of code
that frightens me - with the exception of GnuCash.

Not that it's poorly written, not by any means.  It's just that there
are so very many dependencies; a single broken dependency is enough to
break the entire build.

Don Quixote
-- 
Don Quixote de la Mancha
quixote at dulcineatech.com
http://www.dulcineatech.com

   Dulcinea Technologies Corporation: Software of Elegance and Beauty.


More information about the gnucash-user mailing list