Originally I was using IEX Cloud to download fundamental data:
api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}/quote?token={IEX_CLOUD_API_TOKEN}'
data = requests.get(api_url).json()
data
pe_ratio = data['peRatio']
However, I'm now using Yahoo Finance and I've successfully imported the library and data.
import yahoo_fin.stock_info as si
si.get_stats_valuation("msft")
How do I assign the PE, PS ratio, EV, etc. to a variable?