JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
896 stars 214 forks source link

None works #107

Closed promexio closed 1 year ago

promexio commented 1 year ago

Hi, I use this more than a year. Until now everything worked fine, though, since some days I have troubles ---even on the examples given:

yahoo_financials = YahooFinancials('AAPL')
print(yahoo_financials.get_financial_stmts('annual', 'balance'))

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yahoofinancials/init.py", line 595, in get_financial_stmts data = self._run_financial_stmt(statement_type, report_num, reformat) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yahoofinancials/init.py", line 585, in _run_financial_stmt raw_data = self.get_stock_data(statement_type, report_name=report_name) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yahoofinancials/init.py", line 476, in get_stock_data dict_ent = self._create_dict_ent(self.ticker, statement_type, tech_type, report_name, hist_obj) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yahoofinancials/init.py", line 402, in _create_dict_ent re_data = self._scrape_data(YAHOO_URL, tech_type, statement_type) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yahoofinancials/init.py", line 167, in _scrape_data stores = data["context"]["dispatcher"]["stores"]["QuoteSummaryStore"] TypeError: string indices must be integers

sedwards2000 commented 1 year ago

See this issue https://github.com/JECSand/yahoofinancials/issues/105

JECSand commented 1 year ago

@promexio We just released v1.7, which includes a fix for this courtesy of @sedwards2000