[GNC] [GNC-dev] Finance Quote 1.50 release candidate 1 is available
John Ralls
jralls at ceridwen.us
Sun Mar 7 14:39:00 EST 2021
> On Mar 7, 2021, at 11:31 AM, Rainer Dorsch <ml at bokomoko.de> wrote:
>
> Am Sonntag, 7. März 2021, 19:12:35 CET schrieb John Ralls:
>>> On Mar 7, 2021, at 9:15 AM, Rainer Dorsch <ml at bokomoko.de> wrote:
>>>
>>> [ move this thread from gnucash-devel to gnucash-user, the original
>>> gnucash- devel thread is here
>>> https://lists.gnucash.org/pipermail/gnucash-devel/2021-March/045777.html
>>> ]>
>>> Am Sonntag, 7. März 2021, 17:51:19 CET schrieb John Ralls:
>>>> You're on the wrong list, please use gnucash-user for this sort of
>>>> question.
>>>>
>>>> GnuCash can't use the quotes because Fondsweb.pm doesn't make a field
>>>> "symbol" in its return array. You should raise an issue at
>>>> https://github.com/financequote/financequote.
>>>
>>> If I understand you right, the field "symbol" is that same symbol which
>>> gnucash supplied. I added this locally here.
>>>
>>> rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ gnc-fq-dump
>>> fondsweb
>>> LU0119891520 LU2027374805
>>>
>>> Finance::Quote fields Gnucash uses:
>>> symbol: LU0119891520 <=== required
>>>
>>> date: 03/05/2021 <=== recommended
>>>
>>> currency: EUR <=== required
>>>
>>> last: 708.99 <=\
>>>
>>> nav: 708.99 <=== one of these
>>>
>>> price: <=/
>>>
>>> timezone: <=== optional
>>>
>>> =====
>>>
>>> Finance::Quote fields Gnucash uses:
>>> symbol: LU2027374805 <=== required
>>>
>>> date: 03/05/2021 <=== recommended
>>>
>>> currency: USD <=== required
>>>
>>> last: 68.39 <=\
>>>
>>> nav: 68.39 <=== one of these
>>>
>>> price: <=/
>>>
>>> timezone: <=== optional
>>>
>>> rd at h370:/usr/share/doc/libfinance-quote-perl/examples$
>>>
>>> I also opened a bug report and cross-referenced it:
>>>
>>> https://github.com/finance-quote/finance-quote/issues/179
>>>
>>>> As for your complaint about duplicate prices, your pasted-in results
>>>> don't
>>>> show that.
>>>
>>> Many thanks for your quick reply, John. I move the discusion to
>>> gnucash-user.
>>>
>>> There are two things which I think are strange from the gnucash side:
>>>
>>> 1. gnc-fq-dump reports that stock quote cannot be used, but gnucash uses
>>> it
>>> 2. duplicate prices: I do not see them with gnc-fq-dump but gnucash shows
>>> them
>>>
>>> Ist gnucash using gnc-fq-dump in the same way I did?
>>
>> No. gnc-fq-dump is a user-convenience tool. GnuCash uses gnc-fq-helper,
>> which formats its results so that they can be fed directly to Scheme.
>> Instructions for using it by hand are in its POD.
>>
>> apparently there are others that don't pass a "symbol" element so if it
>> doesn't find the "symbol" entry in the F::Q results hash it uses the
>> user-supplied symbol instead. There's probably something about the
>> Fondweb.pm results hash that messes up retrieving the right entry.
>>
>> You can use .cpan/build/Finance-Quote-1.49-0/Examples/stockdump.pl (.cpan is
>> probably in your $HOME) to see exactly what F::Q is sending.
>
> I run stockdump.pl, but did not see anything wrong or unexpected in there:
>
> rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ ./stockdump.pl Fondsweb
> LU2027374805
> $VAR1 = {
> 'LU2027374805success' => 1,
> 'LU2027374805name' => 'Morgan Stanley INVF Global Endurance Fund
> (USD) Z',
> 'LU2027374805isin' => 'LU2027374805',
> 'LU2027374805isodate' => '2021-03-05',
> 'LU2027374805method' => 'fondsweb',
> 'LU2027374805nav' => '68.39',
> 'LU2027374805date' => '03/05/2021',
> 'LU2027374805type' => 'fund',
> 'LU2027374805currency' => 'USD',
> 'LU2027374805last' => '68.39',
> 'LU2027374805year_range' => '81.19 - 16.47',
> 'LU2027374805symbol' => 'LU2027374805'
> };
> rd at h370:/usr/share/doc/libfinance-quote-perl/examples$ ./stockdump.pl Fondsweb
> LU0119891520
> $VAR1 = {
> 'LU0119891520name' => 'MEDICAL BioHealth EUR',
> 'LU0119891520method' => 'fondsweb',
> 'LU0119891520isodate' => '2021-03-05',
> 'LU0119891520isin' => 'LU0119891520941135',
> 'LU0119891520success' => 1,
> 'LU0119891520year_range' => '807.77 - 414.77',
> 'LU0119891520currency' => 'EUR',
> 'LU0119891520last' => '708.99',
> 'LU0119891520type' => 'fund',
> 'LU0119891520nav' => '708.99',
> 'LU0119891520date' => '03/05/2021',
> 'LU0119891520symbol' => 'LU0119891520'
> };
> rd at h370:/usr/share/doc/libfinance-quote-perl/examples$
>
> The symbol part I added in Fondsweb.pm (see also
>
> https://github.com/finance-quote/finance-quote/issues/179
>
> )
>
> Do you see something unexpected or suspicious in there which can cause the
> mess up?
>
Not offhand, but it's quite possible that adding symbol fixes the problem. Did you try gnc-fq-helper, and if so what was its output?
Regards,
John Ralls
More information about the gnucash-user
mailing list