[GNC-dev] Finance::Quote approaching 1.50 release - some API changes for GnuCash to consider
Vincent Lucarelli
vincent.lucarelli at gmail.com
Mon Nov 2 21:36:44 EST 2020
Dear GnuCash Developers,
It has been a slow effort, but we are finally approaching a 1.50 Finance::Quote release.
First, the intent is to maintain backwards compatibility, so if nothing changes in GnuCash, users should still be able to fetch quotes.
There are two new features that GnuCash could expose to users:
1. Module specific options
2. Multiple sources for currency conversion rates
Both features are documented in the README at https://github.com/finance-quote/finance-quote <https://github.com/finance-quote/finance-quote>
Instead of adding a new environment variable for each module that requires an API key, Finance::Quote->new now takes a configuration hash:
$q = Finance::Quote->new('IEXCloud’, iexcloud => {API_KEY => ‘pk_0...'});
%quotes = $q->iexcloud(@symbols);
AlphaVantage will still use an environment variable, but the intent going forward is to limit environment variables.
Previously, currency conversion was handled only by AlphaVantage and required an API key. We have added the European Central Bank as one key-free source (but it is limited) and several other sources with API keys that avoid the AlphaVantage throttling.
$q = Finance::Quote->new('currency_rates' => {order => ['ECB', 'Fixer'],
fixer => {API_KEY => ‘0…'}});
I thought a bit about how GnuCash might expose this to users, but we haven’t finalized 1.50 yet so there is still time for change.
Best,
Vince
More information about the gnucash-devel
mailing list