yfinance-cache icon indicating copy to clipboard operation
yfinance-cache copied to clipboard

KeyError when getting data for stocks listed on the BSE (Bombay Stock Exchange)

Open ishan-agarwal opened this issue 1 year ago • 0 comments

KeyError when getting data for stocks listed on the BSE (Bombay Stock Exchange)

>>> stock = yf.Ticker("500182.BO")
>>> data = stock.history(period="1mo",interval="1d")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ishan/Desktop/etreco/venv/lib/python3.12/site-packages/yfinance_cache/yfc_ticker.py", line 94, in history
    yfct.SetExchangeTzName(exchange, tz_name)
  File "/home/ishan/Desktop/etreco/venv/lib/python3.12/site-packages/yfinance_cache/yfc_time.py", line 36, in SetExchangeTzName
    exchange_lock = yfcd.exchange_locks[exchange]
                    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'YHD'

ishan-agarwal avatar Aug 22 '24 09:08 ishan-agarwal