[GNC] [GNC-dev] Finance Quote 1.50 release candidate 1 is available

Rainer Dorsch ml at bokomoko.de
Wed Mar 10 15:14:41 EST 2021


Am Mittwoch, 10. März 2021, 05:04:34 CET schrieb John Ralls:
> > On Mar 9, 2021, at 1:08 PM, Rainer Dorsch <ml at bokomoko.de> wrote:
> > 
> > Hi John,
> > 
> > it seems currency retrieval does not work with finance-quote 1.50rc1 in
> > gnucash. currency-lookup.pl works though. I understand it is using
> > alphavantage.
> > 
> > Can you have a quick look at
> > https://github.com/finance-quote/finance-quote/ issues/173 ?
> > 
> > Is that because of  lack of support for the alphavantage key? For stocks
> > this seem to work though
> > 
> > rd at h370:/usr/share/doc/libfinance-quote-perl/examples$  echo
> > '(alphavantage
> > "MSFT")' | gnc-fq-helper
> > (("MSFT" (symbol . "MSFT") (gnc:time-no-zone . "2021-03-08 12:00:00")
> > (last . #e227.3900) (currency . "USD")))
> > rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ gnc-fq-dump
> > alphavantage MSFT
> > 
> > Finance::Quote fields Gnucash uses:
> >    symbol: MSFT                 <=== required
> >    
> >      date: 03/08/2021           <=== recommended
> >  
> >  currency: USD                  <=== required
> >  
> >      last: 227.3900             <=\
> >      
> >       nav:                      <=== one of these
> >     
> >     price:                      <=/
> >  
> >  timezone:                      <=== optional
> > 
> > rd at h370:/usr/share/doc/libfinance-quote-perl/examples$
> 
> Ranier,
> 
> You need to set ALPHAVANTAGE_API_KEY in the shell in order to use
> gnc-fq-dump or gnc-fq-helper. To use it in GnuCash you set it in
> Preferences>Online Quotes.

Thanks for your quick response. I understood that I have to set 
ALPHAVANTAGE_API_KEY as an evironment variable on the command line. For some 
reason the command line works with stocks but not with currencies:

rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ export 
ALPHAVANTAGE_API_KEY=<MY_KEY>
rd at h370:/usr/share/doc/libfinance-quote-perl/examples$  echo '(alphavantage 
"MSFT")' | gnc-fq-helper
(("MSFT" (symbol . "MSFT") (gnc:time-no-zone . "2021-03-09 12:00:00") (last . 
#e233.7800) (currency . "USD")))
rd at h370:/usr/share/doc/libfinance-quote-perl/examples$  echo '(currency "USD" 
"EUR")' | gnc-fq-helper
(#f)
rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ 

even though 

rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ ~/tmp.nobackup/currency-
lookup.pl USD EUR
USD->EUR = 0.8384
rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ 

works (with the patch setting  ALPHAVANTAGE_API_KEY in currency-lookup.pl, as 
shown here https://github.com/finance-quote/finance-quote/issues/
173#issuecomment-793126311 ). This indicates that the information is correctly 
retrieved from Alphavantage, but the communication between finance-quote and 
gnc-fq-helper does not work properly.

Thanks
Rainer

-- 
Rainer Dorsch
http://bokomoko.de/




More information about the gnucash-user mailing list