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

get_summary_data() freezes the application with a delisted stock symbol #187

Open alphaveneno opened 2 months ago

alphaveneno commented 2 months ago

sample code: try: financials = yf(symbol) summary = financials.get_summary_data(reformat=True) print('summary is present:',summary is not None) stock_summary[the_date] = summary[symbol] with open(path+'summary/'+stock+'.json', mode='w',encoding='utf-8') as write_file: json.dump(stock_summary, write_file) print('summary data written') write_file.close() except (KeyError, ConnectionError, RuntimeError, Exception): print('unable to add to',symbol) finally: index += 1 print('index is:',index,'\n')

The line:

summary = financials.get_summary_data(reformat=True)

freezes the app if a delisted stock symbol is used in yf() to derive financials.

Adding or removing arguments (i.e; reformat=True , reformat=False) does not make any difference.

It does not kick-out an exception, just freezes