First try use --no-cache with bean-price. I used to get those KeyErrors all the time and just using --no-cache would fix them. I never bothered to look into why. It could be that Yahoo still works but your cache is messed up, so try that.
I switched away from yahoo years ago due to getting fed up with it breaking every year or two. I use my broker to get ticker prices[1] but, yes, it does mean not having easy access to ticker history. [1]: they provide an API and I use a fork of https://tariochbctools.readthedocs.io/en/latest/price_fetchers.html On Saturday, November 1, 2025 at 1:43:16 AM UTC+10:30 Oon-Ee Ng wrote: > Haven't kept up to date, but my bean-price stopped working (for getting my > ETF prices) roughly in May, and now that I'm looking into it... > > Firstly it seems curl_cffi is now needed if using the yahoo source, so I > got that installed, but I keep getting variants of this error:- > > Traceback (most recent call last): > File "/usr/lib/python3.13/site-packages/beanprice/price.py", line 511, > in fetch_cached_price > timestamp_created, result_naive = _CACHE[key] > ~~~~~~^^^^^ > File "/usr/lib/python3.13/site-packages/diskcache/core.py", line 1234, > in __getitem__ > raise KeyError(key) > KeyError: '1b8bfc85ef72b8165072e7e2a6ea5175' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/bin/bean-price", line 33, in <module> > sys.exit(load_entry_point('beanprice==2.1.0', 'console_scripts', > 'bean-price')()) > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ > File "/usr/lib/python3.13/site-packages/beanprice/price.py", line 975, > in main > price_entries = sorted(price_entries, key=lambda e: e.currency) > File "/usr/lib/python3.13/concurrent/futures/_base.py", line 619, in > result_iterator > yield _result_or_cancel(fs.pop()) > ~~~~~~~~~~~~~~~~~^^^^^^^^^^ > File "/usr/lib/python3.13/concurrent/futures/_base.py", line 317, in > _result_or_cancel > return fut.result(timeout) > ~~~~~~~~~~^^^^^^^^^ > File "/usr/lib/python3.13/concurrent/futures/_base.py", line 456, in > result > return self.__get_result() > ~~~~~~~~~~~~~~~~~^^ > File "/usr/lib/python3.13/concurrent/futures/_base.py", line 401, in > __get_result > raise self._exception > File "/usr/lib/python3.13/concurrent/futures/thread.py", line 59, in run > result = self.fn(*self.args, **self.kwargs) > File "/usr/lib/python3.13/site-packages/beanprice/price.py", line 604, > in fetch_price > srcprice = fetch_cached_price(source, psource.symbol, dprice.date) > File "/usr/lib/python3.13/site-packages/beanprice/price.py", line 529, > in fetch_cached_price > source.get_latest_price(symbol) > ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ > File "/usr/lib/python3.13/site-packages/beanprice/sources/yahoo.py", > line 163, in get_latest_price > result = parse_response(response) > File "/usr/lib/python3.13/site-packages/beanprice/sources/yahoo.py", > line 40, in parse_response > json = response.json(parse_float=Decimal) > File "/usr/lib/python3.13/site-packages/curl_cffi/requests/models.py", > line 226, in json > return loads(self.content, **kw) > TypeError: orjson.loads() takes no keyword arguments > > Exploring other data sources led me to alphavantage which works but > doesn't give historical prices. Is there anything else I can do to obtain > pricing for equities/ETFs? Is alphavantage the best currently (but with no > history)? > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/beancount/14e72f9c-5afd-48f2-8453-9f53b27ed6c7n%40googlegroups.com.
