ValueRaider / yfinance-cache

Caching wrapper for yfinance module. Intelligent caching, not dumb caching of web requests.
MIT License
22 stars 9 forks source link

TypeError: get_calendar() got an unexpected keyword argument 'cache' #30

Closed mikemsq closed 1 year ago

mikemsq commented 1 year ago

exchange_calendars package doesn't support parameter 'cache'

Error: Traceback (most recent call last): File "/Users/mike/Projects/eiten/test_yfc.py", line 3, in hist = msft.history(period="max") File "/Users/mike/Projects/eiten/venv/lib/python3.9/site-packages/yfinance_cache/yfc_ticker.py", line 178, in history sched = yfct.GetExchangeSchedule(exchange, d_now-(7*td_1d), d_now+td_1d) File "/Users/mike/Projects/eiten/venv/lib/python3.9/site-packages/yfinance_cache/yfc_time.py", line 180, in GetExchangeSchedule cal = GetCalendar(exchange) File "/Users/mike/Projects/eiten/venv/lib/python3.9/site-packages/yfinance_cache/yfc_time.py", line 126, in GetCalendar cal = xcal.get_calendar(cal_name, start=start, cache=True) TypeError: get_calendar() got an unexpected keyword argument 'cache'

Sample code: import yfinance_cache as yf msft = yf.Ticker("MSFT") hist = msft.history(period="max") print(hist)

ValueRaider commented 1 year ago

I've pushed a fix.

I have a PR pending with exchange_calendars module to improve startup time. Until it's merged, the first ticker access in a script will be laggy.

mikemsq commented 1 year ago

Fixed! Thanks a lot