Import stock price history from QIF?
John Ralls
jralls at ceridwen.us
Wed Sep 21 22:04:58 EDT 2011
On Sep 21, 2011, at 6:34 PM, prl wrote:
> 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/Gnucash.app/Contents/Resources/libexec/gnucash/overrides/gnucash-env 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?
>
Probably. In order to reasonably ship the python bindings I'd have to also provide a bundled Python to go with it, because
no two versions of OSX include the same version of Python. The bundle is already enormous (mostly because of WebKit), and few users are likely at this point to use the python bindings.
Of course, the Scheme bindings *are* included, because that's what makes reports work, so you could use that without having to build Gnucash yourself.
Regards,
John Ralls
More information about the gnucash-user
mailing list