Import stock price history from QIF?

David T. sunfish62 at
Wed Sep 21 22:15:06 EDT 2011

Unfortunately, as far as I know, the Python Bindings are not included in the Mac OS X binaries. In order to get them, you would have to compile the package from source with the bindings included. 

Aside: I assume that the reason for not including the Python bindings in the default build for Gnucash is partly that they are a recent addition to the codebase, and partly due to the added overhead of securing a Python platform to support the code. I would love to hear from the developers about whether including Python bindings is something they foresee happening. Myself, I would love to get access to those same historical quotes scripts...

John Ralls is the OS X Force To Be Reckoned With and I am sure he can get you further along the path of compilation. But look at:


From: prl <prl at>
To: "gnucash-user at" <gnucash-user at>
Cc: Derek Atkins <warlord at>
Sent: Wednesday, September 21, 2011 6:34 PM
Subject: Re: Import stock price history from QIF?

On 10/09/11 21:39, Derek Atkins wrote:
> Hi,
> On Fri, September 9, 2011 10:46 pm, prl wrote:
>> On 10/09/11 11:51, prl wrote:
>>> ...
>>> I'm planning on writing a Perl script to translate QIF closing prices
>>> into GnuCash "last" prices
>>> ...
> [snip]
> Also note that editing the XML from outside GnuCash is "not supported". To do what you want you should really use the Scheme or Python bindings to write an application to load your historical quotes into GnuCash. Or you could write something in C, of course! This way you can use the GnuCash API.

I've had a look at the examples of using the Gnucash Python bindings to add stock prices to a Gnucash XML file, and I think I can fairly readily modify them to allow me to import my exported QIF stock prices.

Just one minor hurdle: my Googling hasn't found any description of how to install the Python bindings without doing a full build from source. On OS X 10.6.8 and the OS X binary distribution of Gnucash 2.4.7, if that makes any difference.

I've seen the posts about prefixing the python command with /Volumes/Cambyses/Applications/ to ensure that LD_LIBRARY_PATH, DYLD_LIBRARY_PATH and so on are set correctly.

Section 17 of the GnuCash Tutorial and Concepts Guide doesn't exactly fill me with confidence that what I want to do is possible without rebuilding from source: "To be able to use Python scripts, GnuCash must have been compiled with this option enabled, otherwise all what follows won’t work. At present this option is not enabled by default, so if you need this, you may have to compile GnuCash from source yourself. "

Do I just need to bite the bullet and build GnuCash for myself?

gnucash-user mailing list
gnucash-user at
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

More information about the gnucash-user mailing list