Files
OpenBB/openbb_terminal/etf/etf_helper.py
2023-01-16 14:56:47 -05:00

25 lines
450 B
Python

"""ETF Helper module."""
__docformat__ = "numpy"
import yfinance as yf
def get_quote_type(symbol: str) -> str:
"""Get the quote type of the symbol.
Parameters
----------
symbol : str
Ticker to check.
Returns
-------
str
Returns the quote type of the symbol.
"""
try:
quote_type = yf.Ticker(symbol).info["quoteType"]
return quote_type
except TypeError:
return "N/A"