python GnuCash interface to SQL backend

Sébastien de Menten sdementen at gmail.com
Tue Nov 11 16:10:25 EST 2014


Hello,

After trying multiple times to work with GnuCash from python (via xml, via
the python bindings, via sql), I finally had a try to use SQLAlchemy to
handle the GnuCash Books saved through the SQL backend (sqlite3 and
postgres).

I have a release on PyPI the package "pyscash" installable through 'pip
install pyscash' (see some raw documentation on
https://github.com/sdementen/pyscash). It is 'alpha' quality.

While it opens by default the Book in read only mode to be able to do
reporting or extract data from a GnuCash Book, I also succeeded in doing
more elaborate scripts that change a Book : creating new
accounts/sub-accounts, creating new transactions, uploading quotes for
stocks, etc.

I read that the SQL backend is just a backend to save the data and that
GnuCash is not a DB application and that the preferred way to program
GnuCash in python is through the python bindings. However, I found it much
easier to work with this pyscash package, at least as long as it is done
"offline" (i.e. not modifying a Book that is at the same time opened by
GnuCash).

I would be genuinely interested to have more specific documentation on the
risks of going the SQL way.

Sebastien


More information about the gnucash-devel mailing list