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

Confirmation required when caching data

Open xawotihs opened this issue 1 year ago • 1 comments

Hello,

I've been using yfinance-cache 0.6.7 in a small stock screener dashboard I'm working on (https://github.com/xawotihs/stockscreener). When I'm using it on the list of the top 600 largest companies (https://github.com/xawotihs/stockscreener/blob/main/vt600.txt), I get the following confirmation request:

"Failed to map these Yahoo intervals to xcal: (tkr=2308.TW, exchange=TAI, xcal=XTAI). Normally happens when 'exchange_calendars' is wrong so inform developers. Close Volume Dividends Stock Splits 2024-09-16 00:00:00+08:00 385.5 3624545 0.0 0.0 Accept into cache anyway? [y/N]:"

I need to confirm for the following tickers: 2330.TW, HDFCBANK.NS, RELIANCE.NS, 2317.TW, INFY.NS, 2454.TW, TCS.NS, BHARTIARTL.NS, ICICIBANK.NS, 1120.SR, BBCA.JK, M&M.NS, 2222.SR, AXISBANK.NS, LT.NS, 1180.SR, HINDUNILVR.NS, 2308.TW, NTPC.NS.

So, as I'd like to deploy this dashboard in some server, it would be good to either have an option to auto-confirm or implement some other workaround to remove these confirmation ?

xawotihs avatar Oct 10 '24 15:10 xawotihs

No problem, I'll add a setting to options (see README)

Immediate workaround is modifying code to always accept.

ValueRaider avatar Oct 10 '24 21:10 ValueRaider

I'm testing this now. Does this make sense?

import yfinance_cache as yfc
yfc.options.calendar.accept_unexpected_Yahoo_intervals = [True|False]

ValueRaider avatar Oct 17 '24 18:10 ValueRaider

I think that would be perfect for my use case.

xawotihs avatar Oct 18 '24 05:10 xawotihs