Guile API

Alex Weiss alexweiss at theplate.com
Tue Nov 17 10:24:48 EST 2015


That's regrettable about the Guile API.  I have some sophisticate scripting that I would like to do to import data.  The Guile interface seem to have potential (although mostly undocumented).  Regrettably, I have no interest in learning Python, since my Guile skills a pretty seasoned. I'll wait and see if the patch to load an existing set of gnucash data is added to the Guile API.

Thanks for your help,

> Sent: Sunday, November 08, 2015 at 1:12 PM
> From: "John Ralls" <jralls at ceridwen.us>
> To: "Alex Weiss" <alexweiss at theplate.com>
> Cc: gnucash-user at gnucash.org
> Subject: Re: Guile API
>
> 
> > On Nov 7, 2015, at 2:21 PM, Alex Weiss <alexweiss at theplate.com> wrote:
> > 
> > Thanks for your help.  I saw that code.  However, I seem to be missing something.  While the c function qof_session_new is exposed as qof-session-new, the same is not true for qof_session_begin.  
> > 
> > In my guile file I include gnucash bindings as so....
> > 
> > (use-modules (gnucash gnc-module))
> > (gnc:module-system-init)
> > (gnc:module-load "gnucash/engine" 0)
> > 
> > But a call to (qof-session-begin (qof-session-new) "file://agnucashfile.gnucash" #t #f #t)) is considered a call to "Unbound variable: qof-session-begin).
> > 
> > Is qof-session-begin in a different module?
> 
> Ah, I’d forgotten that the python bindings have their own gnucash_core.i that %includes a bunch of headers not included in engine.i.
> 
> 
> > On Nov 8, 2015, at 8:43 AM, Alex Weiss <alexweiss at theplate.com> wrote:
> > 
> > I suspected I was going to have to make some sort of patch. Does anyone know if there are plans to expose "qof-session-load" in engine.i in a GnuCash release?   As far as I can see, without it, I have to use the Python API.
> 
> There aren’t any at present, but it wouldn’t be that big a change.
> 
> You led off saying that you wanted to script GnuCash, which implies that there’s a running GnuCash with a loaded session that you want to manipulate. If what you really want to do is to run a separate program that uses the API, Python is perhaps a better choice unless you need to access API written in Scheme, like the QIF importer.
> 
> Regards,
> John Ralls
> 
>



More information about the gnucash-user mailing list