should ALPHAVANTAGE_API_KEY be a system or user variable

Derek Atkins derek at ihtfp.com
Mon Nov 13 16:20:31 EST 2017


Geert,

On Mon, November 13, 2017 4:16 pm, Geert Janssens wrote:
> Op maandag 13 november 2017 21:59:49 CET schreef Erik Colson:
>> Hello,
>>
>> I'm also concerned by the declaration of an environment variable, but
>> more generally.  It feels wrong as it causes extra problems to common
>> users.
>>
>> Therfor I'm thinking of adding an option hash to F::Q which would
>> contain the APIkey.  Thus the APIkey can be an option _inside_ gnucash
>> or other apps and no environment variable would need to be set.
>>
>> Opinions are welcome.
>>
> Yes that would be good.
>
> I was already considering to provide a gnucash preference to set the
> APIkey. I
> would have made it so the key would be exported to the environment by
> GnuCash
> itself when needed. But I could just as well have gnucash set the option
> hash
> instead.
>
> I'd still have to figure out how our helper scripts would get the key
> though.
> These helper scripts are simple perl scripts that don't read the gnucash
> preferences.
>
> Ideally Finance::Quote would store the API key as a usersetting itself
> somewhere and provide a function to set/alter/delete it by the user. That
> way
> gnucash can just use these interface functions to retrieve the API key for
> display or set/modify based on user's input. From there on it would be
> available to F::Q itself and hence all of its clients.
>
> Is that a feasible solution ?

Why can't we just setenv() or putenv() the API Key prior to calling the
scripts?

> Geert

-derek

-- 
       Derek Atkins                 617-623-3745
       derek at ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant



More information about the gnucash-devel mailing list