is a gnucash API available?

Geert Janssens janssens-geert at telenet.be
Sun Mar 10 09:52:18 EDT 2013


Op 10-03-13 14:11, Chris Peachment schreef:
> I haven't tried it but there is an sqlite database option for
> storing the data. Once stored there you can use the regular
> sqlite api and/or command line query tool (sqlite3).
>
> Of course, that assumes you know SQL and can make sense of the
> gnucash database schema.
>
> On Sun, 2013-03-10 at 13:54 +0100, Guus Bonnema wrote:
>> Hi all,
>>
>> I have been using GNUCash for a while now. Having a few years of financial
>> history in GNUCash makes me want to look at the data in different ways. So what
>> I would like to do is take the data (accounts & transactions) and re-organise
>> it in my own specific ways.
>>
>> What I am looking for is a way to get my hands on the transactions and
>> their connection to accounts.
>>
>> As far as I can see, there is no export that gives me all the data. There is a
>> report where I can "cut and paste", but I dont get clean data that way.
>>
>> So, I have thougth of 2 solutions:
>>
>> 1. Maybe I missed an export of transactions and accounts in one file, like a
>> cvs file? I couldnt find any.
>>
>> 2. Is there an interface, like an API that I could use from say C++ or even
>> java?
>>
>> Just to be complete: I run Ubuntu/KDE with GNUCash on files.
>>
>> Guus Bonnema.
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
There are a couple of ways to access the data programmatically:
- we have bindings for guile (scheme) and python
- the core data is accessible via an API in C

The python bindings are optional, so you will probably have to recompile 
GnuCash with python bindings enabled if you want to use this.

The C api is mostly documented here: 
http://svn.gnucash.org/docs/HEAD/modules.html
Particularly the GnuCash Engine part will show you how you can access 
accounts and transactions via a C interface.

The same page also has a few links regarding the python bindings, but 
these are much less documented. The examples in the source tree may be 
more useful.

I hope this can help you.

Geert


More information about the gnucash-user mailing list