python GnuCash interface to SQL backend

Sébastien de Menten sdementen at
Fri Nov 14 07:42:42 EST 2014

On Fri, Nov 14, 2014 at 3:33 AM, Derek Atkins <warlord at> wrote:

> John Ralls <jralls at> writes:
> > What’s your goal here? I don’t think that reimplementing GnuCash in
> > Python with GnuCash’s SQL schema is a particularly good approach: It’s
> > not exactly the most efficient design. Rather, it’s designed to mirror
> > the XML schema. You’ll have a better design if you relegate GnuCash
> > SQL to import/export.
> I agree wholeheartedly.  Don't do it this way.  Use the GnuCash Python
> bindings.  If you don't like the current structure of them, then fix
> that.  This way your apps will always work because the bindings will
> stay in lockstep with any changes that get made.
> Hello Derek,

The GnuCash python bindings are C/SWIG based. This causes some issues on
windows, and requires deep knowledge of C, SWIG and the GnuCash C api to
contribute to.

The piecash python bindings are a pure python package ("pip install
piecash" and you're up and running) and works on the SQL tables through the
SQL Alchemy library. It is only 500 SLOC today (and may grow in the future
but not by an order of magnitude). As it is short and in python, it is
rather easy to contribute/hack/extend.

More information about the gnucash-devel mailing list