[GNC] Yahoo JSON - throwing unauthorized error

Bruce Schuck bschuck at asgard-systems.com
Mon May 8 12:34:59 EDT 2023


On 5/8/23 13:05 +0300, David T. wrote:

> It's a wiki, so you could put it in. You'd get to decide where that 
> would best live, too.

Perhaps sometime during the week I'll add something. With the obvious
warnings about making backups and the possibility of making a mess for
one's self.

> FWIW, my method for doing this is to save the file as an SQLite
> file, open the result in a DB reader, locate the appropriate table
> there, and execute the change globally. Then I reopen the file in
> GnuCash and save it back to xml.

> It feels easier to me to do it this way and it doesn't take much 
> time.

SQLite queries may be a bit more than some users are willing to try. But 
I can see where it would be easy for those comfortable with it. Same 
reason xmlstarlet would be simple for those familiar with it.

If I unpacked the .gnucash file to foobar.gnucash, this command would 
change the quote source globally.

xmlstarlet ed --inplace -u 
'/gnc-v2/gnc:book/gnc:commodity/cmdty:quote_source["yahoo_json"]' -v 
'alphavantage' foobar.gnucash

One can also selectively change the quote source for a specific 
namespace. This command would change the quote source for just the 
NASDAQ securities.

xmlstarlet ed --inplace -u 
'/gnc-v2/gnc:book/gnc:commodity[cmdty:space="NASDAQ"]/cmdty:quote_source["yahoo_json"]' 
-v 'alphavantage' foobar.gnucash

- Bruce S.


More information about the gnucash-user mailing list