> On May 19, 2024, at 09:42, Bruce Schuck <bsch...@asgard-systems.com> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 5/18/24 21:03, John Ralls wrote:
> 
> > It wouldn’t be hard to add more keys to the GnuCash preferences page
> > to collect API keys and set them as environment variables when
> > querying F::Q, but is that the right way to do it? Can’t the key be
> > passed in the query JSON? Same question for FQ_CURRENCY: Can that be
> > passed in JSON instead of the environment?
> I had thought that was how the AlphaVantage key set in GC's preferences was 
> handled. API keys and the desired currency rate module can be passed when 
> invoking F::Q. However, that could mean that multiple api keys may need to be 
> passed when using a quote source such as 'nyse' since multiple modules (and 
> more than one with an API key required) can satisfy the quote requests.
> 
> Bruce S

Bruce,

No, the Alphavantage API Key preference sets ALPHAVANATGE_API_KEY in the 
environment. That’s why it would be easy to make more preferences with 
corresponding environment variables.

Using environment variables seems clumsy to me, but having GnuCash include the 
keys in queries by hardcoding the source/key combinations  couples versions of 
GnuCash and F::Q even more tightly than the hard-coded source lists do. At 
least with environment variables users can take advantage of new modules with 
API keys without having to wait for them to be incorporated into GnuCash as 
long as they learn how to set environment variables.

Regards,
John Ralls





_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to