documentation for python bindings

Mark Jenkins mark at
Thu Jul 24 01:50:52 EDT 2008

> Is this correct?  Manipulation of the gnucash file from the python
> bindings is possible (rw)?


> What I am trying to do is open a gnucash file, find the account
> identified by code 1234 and mark it as tax relevant.  Would you be so
> kind to help me with that?

Yes, attached.

> The steps outlined in
> produce
> an error initially, importing __init__ a second time runs fine.  Is that
> a bug?  I am still very inexperienced with this.  All I can say is that
> setting the PYTHONPATH and then running your example scripts with
> "python $script" on hardy produces a very similarly looking error about
> "could not locate gnucash/engine interface v.0".

If I was to document anything, I should of at least documented this, not
only do you need the right stuff in your PYTHONPATH (or for it to be in
python's automatic search path), but you need to run python with
/gnucash-env/ in front of it.

So, you should be able to set your PYTHONPATH and run the attachment as
$ gnucash-env ./
$ gnucash-env python

> (process:11900): GLib-CRITICAL **: g_hash_table_lookup: assertion
> `hash_table != NULL' failed

I get assertions like this too. Though I haven't investigated them, I
can say that things still work despite them.

Also, I don't really see much point in importing gnucash.__init__ . It's
there so you can do things like

>>> from gnucash import Session

instead of

>>> from gnucash.gnucash_core import Session

-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-python
Size: 955 bytes
Desc: not available
Url : 

More information about the gnucash-devel mailing list