diff --git a/openbb_platform/openbb/package/stocks.py b/openbb_platform/openbb/package/stocks.py deleted file mode 100644 index c99fccd93df1..000000000000 --- a/openbb_platform/openbb/package/stocks.py +++ /dev/null @@ -1,1629 +0,0 @@ -### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - -import datetime -from typing import List, Literal, Union - -import typing_extensions -from annotated_types import Ge -from openbb_core.app.model.custom_parameter import OpenBBCustomParameter -from openbb_core.app.model.obbject import OBBject -from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate -from openbb_core.app.static.filters import filter_inputs -from openbb_provider.abstract.data import Data - - -class ROUTER_stocks(Container): - """/stocks - /ca - calendar_dividend - calendar_ipo - /disc - /dps - /fa - info - load - market_snapshots - multiples - nbbo - news - /options - price_performance - quote - search - """ - - def __repr__(self) -> str: - return self.__doc__ or "" - - @property - def ca(self): # route = "/stocks/ca" - from . import stocks_ca - - return stocks_ca.ROUTER_stocks_ca(command_runner=self._command_runner) - - @validate - def calendar_dividend( - self, - start_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="Start date of the data, in YYYY-MM-DD format." - ), - ] = None, - end_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="End date of the data, in YYYY-MM-DD format." - ), - ] = None, - provider: Union[Literal["fmp", "nasdaq"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Upcoming and Historical Dividend Calendar. - - Parameters - ---------- - start_date : Union[datetime.date, None] - Start date of the data, in YYYY-MM-DD format. - end_date : Union[datetime.date, None] - End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp', 'nasdaq'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[CalendarDividend]] - Serializable results. - provider : Union[Literal['fmp', 'nasdaq'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CalendarDividend - ---------------- - date : date - The date of the data. (Ex-Dividend) - symbol : str - Symbol representing the entity requested in the data. - name : Optional[Union[str]] - Name of the entity. - record_date : Optional[Union[date]] - The record date of ownership for eligibility. - payment_date : Optional[Union[date]] - The payment date of the dividend. - declaration_date : Optional[Union[date]] - Declaration date of the dividend. - amount : Optional[Union[float]] - Dividend amount, per-share. - adjusted_amount : Optional[Union[float]] - The adjusted-dividend amount. (provider: fmp) - label : Optional[Union[str]] - Ex-dividend date formatted for display. (provider: fmp) - annualized_amount : Optional[Union[float]] - The indicated annualized dividend amount. (provider: nasdaq) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.calendar_dividend() - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "start_date": start_date, - "end_date": end_date, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/calendar_dividend", - **inputs, - ) - - @validate - def calendar_ipo( - self, - symbol: typing_extensions.Annotated[ - Union[str, None, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ] = None, - start_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="Start date of the data, in YYYY-MM-DD format." - ), - ] = None, - end_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="End date of the data, in YYYY-MM-DD format." - ), - ] = None, - limit: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 100, - provider: Union[Literal["intrinio", "nasdaq"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Upcoming and Historical IPO Calendar. - - Parameters - ---------- - symbol : Union[str, None] - Symbol to get data for. - start_date : Union[datetime.date, None] - Start date of the data, in YYYY-MM-DD format. - end_date : Union[datetime.date, None] - End date of the data, in YYYY-MM-DD format. - limit : Union[int, None] - The number of data entries to return. - provider : Union[Literal['intrinio', 'nasdaq'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'intrinio' if there is - no default. - status : Optional[Union[Literal['upcoming', 'priced', 'withdrawn'], Literal['upcoming', 'priced', 'filed', 'withdrawn']]] - Status of the IPO. [upcoming, priced, or withdrawn] (provider: intrinio); The status of the IPO. (provider: nasdaq) - min_value : Optional[Union[int]] - Return IPOs with an offer dollar amount greater than the given amount. (provider: intrinio) - max_value : Optional[Union[int]] - Return IPOs with an offer dollar amount less than the given amount. (provider: intrinio) - is_spo : bool - If True, returns data for secondary public offerings (SPOs). (provider: nasdaq) - - Returns - ------- - OBBject - results : Union[List[CalendarIpo]] - Serializable results. - provider : Union[Literal['intrinio', 'nasdaq'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CalendarIpo - ----------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - ipo_date : Optional[Union[date]] - The date of the IPO, when the stock first trades on a major exchange. - status : Optional[Union[Literal['upcoming', 'priced', 'withdrawn']]] - - The status of the IPO. Upcoming IPOs have not taken place yet but are expected to. - Priced IPOs have taken place. - Withdrawn IPOs were expected to take place, but were subsequently withdrawn and did not take place - (provider: intrinio) - exchange : Optional[Union[str]] - - The acronym of the stock exchange that the company is going to trade publicly on. - Typically NYSE or NASDAQ. - (provider: intrinio) - offer_amount : Optional[Union[float]] - The total dollar amount of shares offered in the IPO. Typically this is share price * share count (provider: intrinio); The dollar value of the shares offered. (provider: nasdaq) - share_price : Optional[Union[float]] - The price per share at which the IPO was offered. (provider: intrinio) - share_price_lowest : Optional[Union[float]] - - The expected lowest price per share at which the IPO will be offered. - Before an IPO is priced, companies typically provide a range of prices per share at which - they expect to offer the IPO (typically available for upcoming IPOs). - (provider: intrinio) - share_price_highest : Optional[Union[float]] - - The expected highest price per share at which the IPO will be offered. - Before an IPO is priced, companies typically provide a range of prices per share at which - they expect to offer the IPO (typically available for upcoming IPOs). - (provider: intrinio) - share_count : Optional[Union[int]] - The number of shares offered in the IPO. (provider: intrinio, nasdaq) - share_count_lowest : Optional[Union[int]] - - The expected lowest number of shares that will be offered in the IPO. Before an IPO is priced, - companies typically provide a range of shares that they expect to offer in the IPO - (typically available for upcoming IPOs). - (provider: intrinio) - share_count_highest : Optional[Union[int]] - - The expected highest number of shares that will be offered in the IPO. Before an IPO is priced, - companies typically provide a range of shares that they expect to offer in the IPO - (typically available for upcoming IPOs). - (provider: intrinio) - announcement_url : Optional[Union[str]] - The URL to the company's announcement of the IPO (provider: intrinio) - sec_report_url : Optional[Union[str]] - - The URL to the company's S-1, S-1/A, F-1, or F-1/A SEC filing, - which is required to be filed before an IPO takes place. - (provider: intrinio) - open_price : Optional[Union[float]] - The opening price at the beginning of the first trading day (only available for priced IPOs). (provider: intrinio) - close_price : Optional[Union[float]] - The closing price at the end of the first trading day (only available for priced IPOs). (provider: intrinio) - volume : Optional[Union[int]] - The volume at the end of the first trading day (only available for priced IPOs). (provider: intrinio) - day_change : Optional[Union[float]] - - The percentage change between the open price and the close price on the first trading day - (only available for priced IPOs). - (provider: intrinio) - week_change : Optional[Union[float]] - - The percentage change between the open price on the first trading day and the close price approximately - a week after the first trading day (only available for priced IPOs). - (provider: intrinio) - month_change : Optional[Union[float]] - - The percentage change between the open price on the first trading day and the close price approximately - a month after the first trading day (only available for priced IPOs). - (provider: intrinio) - id : Optional[Union[str]] - The Intrinio ID of the IPO. (provider: intrinio) - company : Optional[Union[openbb_intrinio.utils.references.IntrinioCompany]] - The company that is going public via the IPO. (provider: intrinio) - security : Optional[Union[openbb_intrinio.utils.references.IntrinioSecurity]] - The primary Security for the Company that is going public via the IPO (provider: intrinio) - name : Optional[Union[str]] - The name of the company. (provider: nasdaq) - expected_price_date : Optional[Union[date]] - The date the pricing is expected. (provider: nasdaq) - filed_date : Optional[Union[date]] - The date the IPO was filed. (provider: nasdaq) - withdraw_date : Optional[Union[date]] - The date the IPO was withdrawn. (provider: nasdaq) - deal_status : Optional[Union[str]] - The status of the deal. (provider: nasdaq) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.calendar_ipo(limit=100) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "start_date": start_date, - "end_date": end_date, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/calendar_ipo", - **inputs, - ) - - @property - def disc(self): # route = "/stocks/disc" - from . import stocks_disc - - return stocks_disc.ROUTER_stocks_disc(command_runner=self._command_runner) - - @property - def dps(self): # route = "/stocks/dps" - from . import stocks_dps - - return stocks_dps.ROUTER_stocks_dps(command_runner=self._command_runner) - - @property - def fa(self): # route = "/stocks/fa" - from . import stocks_fa - - return stocks_fa.ROUTER_stocks_fa(command_runner=self._command_runner) - - @validate - def info( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["cboe"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Info. Get general price and performance metrics of a stock. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['cboe'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'cboe' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[StockInfo]] - Serializable results. - provider : Union[Literal['cboe'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockInfo - --------- - symbol : str - Symbol representing the entity requested in the data. - name : str - Name associated with the ticker symbol. - price : Optional[Union[float]] - Last transaction price. - open : Optional[Union[float]] - The open price of the symbol. - high : Optional[Union[float]] - The high price of the symbol. - low : Optional[Union[float]] - The low price of the symbol. - close : Optional[Union[float]] - The close price of the symbol. - change : Optional[Union[float]] - Change in price over the current trading period. - change_percent : Optional[Union[float]] - Percent change in price over the current trading period. - prev_close : Optional[Union[float]] - Previous closing price. - type : Optional[Union[str]] - Type of asset. (provider: cboe) - exchange_id : Optional[Union[int]] - The Exchange ID number. (provider: cboe) - tick : Optional[Union[str]] - Whether the last sale was an up or down tick. (provider: cboe) - bid : Optional[Union[float]] - Current bid price. (provider: cboe) - bid_size : Optional[Union[float]] - Bid lot size. (provider: cboe) - ask : Optional[Union[float]] - Current ask price. (provider: cboe) - ask_size : Optional[Union[float]] - Ask lot size. (provider: cboe) - volume : Optional[Union[float]] - Stock volume for the current trading day. (provider: cboe) - iv30 : Optional[Union[float]] - The 30-day implied volatility of the stock. (provider: cboe) - iv30_change : Optional[Union[float]] - Change in 30-day implied volatility of the stock. (provider: cboe) - last_trade_timestamp : Optional[Union[datetime]] - Last trade timestamp for the stock. (provider: cboe) - iv30_annual_high : Optional[Union[float]] - The 1-year high of implied volatility. (provider: cboe) - hv30_annual_high : Optional[Union[float]] - The 1-year high of realized volatility. (provider: cboe) - iv30_annual_low : Optional[Union[float]] - The 1-year low of implied volatility. (provider: cboe) - hv30_annual_low : Optional[Union[float]] - The 1-year low of realized volatility. (provider: cboe) - iv60_annual_high : Optional[Union[float]] - The 60-day high of implied volatility. (provider: cboe) - hv60_annual_high : Optional[Union[float]] - The 60-day high of realized volatility. (provider: cboe) - iv60_annual_low : Optional[Union[float]] - The 60-day low of implied volatility. (provider: cboe) - hv60_annual_low : Optional[Union[float]] - The 60-day low of realized volatility. (provider: cboe) - iv90_annual_high : Optional[Union[float]] - The 90-day high of implied volatility. (provider: cboe) - hv90_annual_high : Optional[Union[float]] - The 90-day high of realized volatility. (provider: cboe) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.info(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/info", - **inputs, - ) - - @validate - def load( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - interval: typing_extensions.Annotated[ - Union[str, None], - OpenBBCustomParameter(description="Time interval of the data to return."), - ] = "1d", - start_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="Start date of the data, in YYYY-MM-DD format." - ), - ] = None, - end_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="End date of the data, in YYYY-MM-DD format." - ), - ] = None, - chart: bool = False, - provider: Union[ - Literal["alpha_vantage", "cboe", "fmp", "intrinio", "polygon", "yfinance"], - None, - ] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Historical price. Load stock data for a specific ticker. - - Parameters - ---------- - symbol : str - Symbol to get data for. - interval : Union[str, None] - Time interval of the data to return. - start_date : Union[datetime.date, None] - Start date of the data, in YYYY-MM-DD format. - end_date : Union[datetime.date, None] - End date of the data, in YYYY-MM-DD format. - chart : bool - Whether to create a chart or not, by default False. - provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygo... - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'alpha_vantage' if there is - no default. - adjusted : Optional[Union[bool]] - Output time series is adjusted by historical split and dividend events. (provider: alpha_vantage, polygon); Adjust all OHLC data automatically. (provider: yfinance) - extended_hours : Optional[Union[bool]] - Extended trading hours during pre-market and after-hours.Only available for intraday data. (provider: alpha_vantage) - month : Optional[Union[str]] - Query a specific month in history (in YYYY-MM format). (provider: alpha_vantage) - output_size : Optional[Union[Literal['compact', 'full']]] - Compact returns only the latest 100 data points in the intraday time series; full returns trailing 30 days of the most recent intraday data if the month parameter is not specified, or the full intraday data for aspecific month in history if the month parameter is specified. (provider: alpha_vantage) - limit : Optional[Union[typing_extensions.Annotated[int, Ge(ge=0)], int]] - Number of days to look back (Only for interval 1d). (provider: fmp); The number of data entries to return. (provider: polygon) - start_time : Optional[Union[datetime.time]] - Return intervals starting at the specified time on the `start_date` formatted as 'HH:MM:SS'. (provider: intrinio) - end_time : Optional[Union[datetime.time]] - Return intervals stopping at the specified time on the `end_date` formatted as 'HH:MM:SS'. (provider: intrinio) - timezone : str - Timezone of the data, in the IANA format (Continent/City). (provider: intrinio) - source : Optional[Union[Literal['realtime', 'delayed', 'nasdaq_basic']]] - The source of the data. (provider: intrinio) - sort : Literal['asc', 'desc'] - Sort order of the data. (provider: polygon) - prepost : bool - Include Pre and Post market data. (provider: yfinance) - include : bool - Include Dividends and Stock Splits in results. (provider: yfinance) - back_adjust : bool - Attempt to adjust all the data automatically. (provider: yfinance) - ignore_tz : bool - When combining from different timezones, ignore that part of datetime. (provider: yfinance) - - Returns - ------- - OBBject - results : Union[List[StockHistorical]] - Serializable results. - provider : Union[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'yfinance'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockHistorical - --------------- - date : datetime - The date of the data. - open : float - The open price of the symbol. - high : float - The high price of the symbol. - low : float - The low price of the symbol. - close : float - The close price of the symbol. - volume : Union[float, int] - The volume of the symbol. - vwap : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)]]] - Volume Weighted Average Price of the symbol. - adj_close : Optional[Union[typing_extensions.Annotated[float, Gt(gt=0)], float]] - The adjusted close price of the symbol. (provider: alpha_vantage, fmp); Adjusted closing price during the period. (provider: intrinio) - dividend_amount : Optional[Union[typing_extensions.Annotated[float, Ge(ge=0)]]] - Dividend amount paid for the corresponding date. (provider: alpha_vantage) - split_coefficient : Optional[Union[typing_extensions.Annotated[float, Ge(ge=0)]]] - Split coefficient for the corresponding date. (provider: alpha_vantage) - calls_volume : Optional[Union[float]] - Number of calls traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe) - puts_volume : Optional[Union[float]] - Number of puts traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe) - total_options_volume : Optional[Union[float]] - Total number of options traded during the most recent trading period. Only valid if interval is 1m. (provider: cboe) - label : Optional[Union[str]] - Human readable format of the date. (provider: fmp) - unadjusted_volume : Optional[Union[float]] - Unadjusted volume of the symbol. (provider: fmp) - change : Optional[Union[float]] - Change in the price of the symbol from the previous day. (provider: fmp, intrinio) - change_percent : Optional[Union[float]] - Change % in the price of the symbol. (provider: fmp) - change_over_time : Optional[Union[float]] - Change % in the price of the symbol over a period of time. (provider: fmp) - close_time : Optional[Union[datetime]] - The timestamp that represents the end of the interval span. (provider: intrinio) - interval : Optional[Union[str]] - The data time frequency. (provider: intrinio) - average : Optional[Union[float]] - Average trade price of an individual stock during the interval. (provider: intrinio) - intra_period : Optional[Union[bool]] - If true, the stock price represents an unfinished period (be it day, week, quarter, month, or year), meaning that the close price is the latest price available, not the official close price for the period (provider: intrinio) - adj_open : Optional[Union[float]] - Adjusted open price during the period. (provider: intrinio) - adj_high : Optional[Union[float]] - Adjusted high price during the period. (provider: intrinio) - adj_low : Optional[Union[float]] - Adjusted low price during the period. (provider: intrinio) - adj_volume : Optional[Union[float]] - Adjusted volume during the period. (provider: intrinio) - factor : Optional[Union[float]] - factor by which to multiply stock prices before this date, in order to calculate historically-adjusted stock prices. (provider: intrinio) - split_ratio : Optional[Union[float]] - Ratio of the stock split, if a stock split occurred. (provider: intrinio) - dividend : Optional[Union[float]] - Dividend amount, if a dividend was paid. (provider: intrinio) - percent_change : Optional[Union[float]] - Percent change in the price of the symbol from the previous day. (provider: intrinio) - fifty_two_week_high : Optional[Union[float]] - 52 week high price for the symbol. (provider: intrinio) - fifty_two_week_low : Optional[Union[float]] - 52 week low price for the symbol. (provider: intrinio) - transactions : Optional[Union[typing_extensions.Annotated[int, Gt(gt=0)]]] - Number of transactions for the symbol in the time period. (provider: polygon) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.load(symbol="AAPL", interval="1d") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "interval": interval, - "start_date": start_date, - "end_date": end_date, - }, - extra_params=kwargs, - chart=chart, - ) - - return self._run( - "/stocks/load", - **inputs, - ) - - @validate - def market_snapshots( - self, provider: Union[Literal["fmp", "polygon"], None] = None, **kwargs - ) -> OBBject[List[Data]]: - """Get a current, complete, market snapshot. - - Parameters - ---------- - provider : Union[Literal['fmp', 'polygon'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - market : Literal['AMEX', 'AMS', 'ASE', 'ASX', 'ATH', 'BME', 'BRU', 'BUD', 'BUE', 'CAI', 'CNQ', 'CPH', 'DFM', 'DOH', 'DUS', 'ETF', 'EURONEXT', 'HEL', 'HKSE', 'ICE', 'IOB', 'IST', 'JKT', 'JNB', 'JPX', 'KLS', 'KOE', 'KSC', 'KUW', 'LSE', 'MEX', 'MIL', 'NASDAQ', 'NEO', 'NSE', 'NYSE', 'NZE', 'OSL', 'OTC', 'PNK', 'PRA', 'RIS', 'SAO', 'SAU', 'SES', 'SET', 'SGO', 'SHH', 'SHZ', 'SIX', 'STO', 'TAI', 'TLV', 'TSX', 'TWO', 'VIE', 'WSE', 'XETRA'] - The market to fetch data for. (provider: fmp) - - Returns - ------- - OBBject - results : Union[List[MarketSnapshots]] - Serializable results. - provider : Union[Literal['fmp', 'polygon'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - MarketSnapshots - --------------- - symbol : str - Symbol representing the entity requested in the data. - open : Optional[Union[float]] - The open price of the symbol. - high : Optional[Union[float]] - The high price of the symbol. - low : Optional[Union[float]] - The low price of the symbol. - close : Optional[Union[float]] - The close price of the symbol. - prev_close : Optional[Union[float]] - The previous closing price of the stock. - change : Optional[Union[float]] - The change in price. - change_percent : Optional[Union[float]] - The change, as a percent. - volume : Optional[Union[int]] - The volume of the symbol. - price : Optional[Union[float]] - The last price of the stock. (provider: fmp) - avg_volume : Optional[Union[int]] - Average volume of the stock. (provider: fmp) - ma50 : Optional[Union[float]] - The 50-day moving average. (provider: fmp) - ma200 : Optional[Union[float]] - The 200-day moving average. (provider: fmp) - year_high : Optional[Union[float]] - The 52-week high. (provider: fmp) - year_low : Optional[Union[float]] - The 52-week low. (provider: fmp) - market_cap : Optional[Union[float]] - Market cap of the stock. (provider: fmp) - shares_outstanding : Optional[Union[float]] - Number of shares outstanding. (provider: fmp) - eps : Optional[Union[float]] - Earnings per share. (provider: fmp) - pe : Optional[Union[float]] - Price to earnings ratio. (provider: fmp) - exchange : Optional[Union[str]] - The exchange of the stock. (provider: fmp) - timestamp : Optional[Union[int, float]] - The timestamp of the data. (provider: fmp) - earnings_announcement : Optional[Union[str]] - The earnings announcement of the stock. (provider: fmp) - name : Optional[Union[str]] - The name associated with the stock symbol. (provider: fmp) - vwap : Optional[float] - The volume weighted average price of the stock on the current trading day. (provider: polygon) - prev_open : Optional[float] - The previous trading session opening price. (provider: polygon) - prev_high : Optional[float] - The previous trading session high price. (provider: polygon) - prev_low : Optional[float] - The previous trading session low price. (provider: polygon) - prev_volume : Optional[float] - The previous trading session volume. (provider: polygon) - prev_vwap : Optional[float] - The previous trading session VWAP. (provider: polygon) - last_updated : Optional[Union[datetime]] - The last time the data was updated. (provider: polygon) - bid : Optional[Union[float]] - The current bid price. (provider: polygon) - bid_size : Optional[Union[int]] - The current bid size. (provider: polygon) - ask_size : Optional[Union[int]] - The current ask size. (provider: polygon) - ask : Optional[Union[float]] - The current ask price. (provider: polygon) - quote_timestamp : Optional[Union[datetime]] - The timestamp of the last quote. (provider: polygon) - last_trade_price : Optional[Union[float]] - The last trade price. (provider: polygon) - last_trade_size : Optional[Union[int]] - The last trade size. (provider: polygon) - last_trade_conditions : Optional[Union[List[int]]] - The last trade condition codes. (provider: polygon) - last_trade_exchange : Optional[Union[int]] - The last trade exchange ID code. (provider: polygon) - last_trade_timestamp : Optional[Union[datetime]] - The last trade timestamp. (provider: polygon) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.market_snapshots() - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={}, - extra_params=kwargs, - ) - - return self._run( - "/stocks/market_snapshots", - **inputs, - ) - - @validate - def multiples( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - limit: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 100, - chart: bool = False, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Multiples. Valuation multiples for a stock ticker. - - Parameters - ---------- - symbol : str - Symbol to get data for. - limit : Union[int, None] - The number of data entries to return. - chart : bool - Whether to create a chart or not, by default False. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[StockMultiples]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockMultiples - -------------- - revenue_per_share_ttm : Optional[Union[float]] - Revenue per share calculated as trailing twelve months. - net_income_per_share_ttm : Optional[Union[float]] - Net income per share calculated as trailing twelve months. - operating_cash_flow_per_share_ttm : Optional[Union[float]] - Operating cash flow per share calculated as trailing twelve months. - free_cash_flow_per_share_ttm : Optional[Union[float]] - Free cash flow per share calculated as trailing twelve months. - cash_per_share_ttm : Optional[Union[float]] - Cash per share calculated as trailing twelve months. - book_value_per_share_ttm : Optional[Union[float]] - Book value per share calculated as trailing twelve months. - tangible_book_value_per_share_ttm : Optional[Union[float]] - Tangible book value per share calculated as trailing twelve months. - shareholders_equity_per_share_ttm : Optional[Union[float]] - Shareholders equity per share calculated as trailing twelve months. - interest_debt_per_share_ttm : Optional[Union[float]] - Interest debt per share calculated as trailing twelve months. - market_cap_ttm : Optional[Union[float]] - Market capitalization calculated as trailing twelve months. - enterprise_value_ttm : Optional[Union[float]] - Enterprise value calculated as trailing twelve months. - pe_ratio_ttm : Optional[Union[float]] - Price-to-earnings ratio (P/E ratio) calculated as trailing twelve months. - price_to_sales_ratio_ttm : Optional[Union[float]] - Price-to-sales ratio calculated as trailing twelve months. - pocf_ratio_ttm : Optional[Union[float]] - Price-to-operating cash flow ratio calculated as trailing twelve months. - pfcf_ratio_ttm : Optional[Union[float]] - Price-to-free cash flow ratio calculated as trailing twelve months. - pb_ratio_ttm : Optional[Union[float]] - Price-to-book ratio calculated as trailing twelve months. - ptb_ratio_ttm : Optional[Union[float]] - Price-to-tangible book ratio calculated as trailing twelve months. - ev_to_sales_ttm : Optional[Union[float]] - Enterprise value-to-sales ratio calculated as trailing twelve months. - enterprise_value_over_ebitda_ttm : Optional[Union[float]] - Enterprise value-to-EBITDA ratio calculated as trailing twelve months. - ev_to_operating_cash_flow_ttm : Optional[Union[float]] - Enterprise value-to-operating cash flow ratio calculated as trailing twelve months. - ev_to_free_cash_flow_ttm : Optional[Union[float]] - Enterprise value-to-free cash flow ratio calculated as trailing twelve months. - earnings_yield_ttm : Optional[Union[float]] - Earnings yield calculated as trailing twelve months. - free_cash_flow_yield_ttm : Optional[Union[float]] - Free cash flow yield calculated as trailing twelve months. - debt_to_equity_ttm : Optional[Union[float]] - Debt-to-equity ratio calculated as trailing twelve months. - debt_to_assets_ttm : Optional[Union[float]] - Debt-to-assets ratio calculated as trailing twelve months. - net_debt_to_ebitda_ttm : Optional[Union[float]] - Net debt-to-EBITDA ratio calculated as trailing twelve months. - current_ratio_ttm : Optional[Union[float]] - Current ratio calculated as trailing twelve months. - interest_coverage_ttm : Optional[Union[float]] - Interest coverage calculated as trailing twelve months. - income_quality_ttm : Optional[Union[float]] - Income quality calculated as trailing twelve months. - dividend_yield_ttm : Optional[Union[float]] - Dividend yield calculated as trailing twelve months. - dividend_yield_percentage_ttm : Optional[Union[float]] - Dividend yield percentage calculated as trailing twelve months. - dividend_to_market_cap_ttm : Optional[Union[float]] - Dividend to market capitalization ratio calculated as trailing twelve months. - dividend_per_share_ttm : Optional[Union[float]] - Dividend per share calculated as trailing twelve months. - payout_ratio_ttm : Optional[Union[float]] - Payout ratio calculated as trailing twelve months. - sales_general_and_administrative_to_revenue_ttm : Optional[Union[float]] - Sales general and administrative expenses-to-revenue ratio calculated as trailing twelve months. - research_and_development_to_revenue_ttm : Optional[Union[float]] - Research and development expenses-to-revenue ratio calculated as trailing twelve months. - intangibles_to_total_assets_ttm : Optional[Union[float]] - Intangibles-to-total assets ratio calculated as trailing twelve months. - capex_to_operating_cash_flow_ttm : Optional[Union[float]] - Capital expenditures-to-operating cash flow ratio calculated as trailing twelve months. - capex_to_revenue_ttm : Optional[Union[float]] - Capital expenditures-to-revenue ratio calculated as trailing twelve months. - capex_to_depreciation_ttm : Optional[Union[float]] - Capital expenditures-to-depreciation ratio calculated as trailing twelve months. - stock_based_compensation_to_revenue_ttm : Optional[Union[float]] - Stock-based compensation-to-revenue ratio calculated as trailing twelve months. - graham_number_ttm : Optional[Union[float]] - Graham number calculated as trailing twelve months. - roic_ttm : Optional[Union[float]] - Return on invested capital calculated as trailing twelve months. - return_on_tangible_assets_ttm : Optional[Union[float]] - Return on tangible assets calculated as trailing twelve months. - graham_net_net_ttm : Optional[Union[float]] - Graham net-net working capital calculated as trailing twelve months. - working_capital_ttm : Optional[Union[float]] - Working capital calculated as trailing twelve months. - tangible_asset_value_ttm : Optional[Union[float]] - Tangible asset value calculated as trailing twelve months. - net_current_asset_value_ttm : Optional[Union[float]] - Net current asset value calculated as trailing twelve months. - invested_capital_ttm : Optional[Union[float]] - Invested capital calculated as trailing twelve months. - average_receivables_ttm : Optional[Union[float]] - Average receivables calculated as trailing twelve months. - average_payables_ttm : Optional[Union[float]] - Average payables calculated as trailing twelve months. - average_inventory_ttm : Optional[Union[float]] - Average inventory calculated as trailing twelve months. - days_sales_outstanding_ttm : Optional[Union[float]] - Days sales outstanding calculated as trailing twelve months. - days_payables_outstanding_ttm : Optional[Union[float]] - Days payables outstanding calculated as trailing twelve months. - days_of_inventory_on_hand_ttm : Optional[Union[float]] - Days of inventory on hand calculated as trailing twelve months. - receivables_turnover_ttm : Optional[Union[float]] - Receivables turnover calculated as trailing twelve months. - payables_turnover_ttm : Optional[Union[float]] - Payables turnover calculated as trailing twelve months. - inventory_turnover_ttm : Optional[Union[float]] - Inventory turnover calculated as trailing twelve months. - roe_ttm : Optional[Union[float]] - Return on equity calculated as trailing twelve months. - capex_per_share_ttm : Optional[Union[float]] - Capital expenditures per share calculated as trailing twelve months. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.multiples(symbol="AAPL", limit=100) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - }, - extra_params=kwargs, - chart=chart, - ) - - return self._run( - "/stocks/multiples", - **inputs, - ) - - @validate - def nbbo( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["polygon"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Quote. Load stock data for a specific ticker. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['polygon'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'polygon' if there is - no default. - limit : int - The number of data entries to return. Up to ten million records will be returned. Pagination occurs in groups of 50,000. Remaining limit values will always return 50,000 more records unless it is the last page. High volume tickers will require multiple max requests for a single day's NBBO records. Expect stocks, like SPY, to approach 1GB in size, per day, as a raw CSV. Splitting large requests into chunks is recommended for full-day requests of high-volume symbols. (provider: polygon) - date : Optional[Union[datetime.date]] - A specific date to get data for. Use bracketed the timestamp parameters to specify exact time ranges. (provider: polygon) - timestamp_lt : Optional[Union[datetime.datetime, str]] - - Query by datetime, less than. Either a date with the format YYYY-MM-DD or a TZ-aware timestamp string, - YYYY-MM-DDTH:M:S.000000000-04:00". Include all nanoseconds and the 'T' between the day and hour. - (provider: polygon) - timestamp_gt : Optional[Union[datetime.datetime, str]] - - Query by datetime, greater than. Either a date with the format YYYY-MM-DD or a TZ-aware timestamp string, - YYYY-MM-DDTH:M:S.000000000-04:00". Include all nanoseconds and the 'T' between the day and hour. - (provider: polygon) - timestamp_lte : Optional[Union[datetime.datetime, str]] - - Query by datetime, less than or equal to. - Either a date with the format YYYY-MM-DD or a TZ-aware timestamp string, - YYYY-MM-DDTH:M:S.000000000-04:00". Include all nanoseconds and the 'T' between the day and hour. - (provider: polygon) - timestamp_gte : Optional[Union[datetime.datetime, str]] - - Query by datetime, greater than or equal to. - Either a date with the format YYYY-MM-DD or a TZ-aware timestamp string, - YYYY-MM-DDTH:M:S.000000000-04:00". Include all nanoseconds and the 'T' between the day and hour. - (provider: polygon) - - Returns - ------- - OBBject - results : Union[List[StockNBBO]] - Serializable results. - provider : Union[Literal['polygon'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockNBBO - --------- - ask_exchange : str - The exchange ID for the ask. - ask : float - The last ask price. - ask_size : int - - The ask size. This represents the number of round lot orders at the given ask price. - The normal round lot size is 100 shares. - An ask size of 2 means there are 200 shares available to purchase at the given ask price. - - bid_size : int - The bid size in round lots. - bid : float - The last bid price. - bid_exchange : str - The exchange ID for the bid. - tape : Optional[Union[str]] - The exchange tape. (provider: polygon) - conditions : Optional[Union[str, List[int], List[str]]] - A list of condition codes. (provider: polygon) - indicators : Optional[Union[List]] - A list of indicator codes. (provider: polygon) - sequence_num : Optional[Union[int]] - - The sequence number represents the sequence in which message events happened. - These are increasing and unique per ticker symbol, but will not always be sequential - (e.g., 1, 2, 6, 9, 10, 11) - (provider: polygon) - participant_timestamp : Optional[Union[datetime]] - - The nanosecond accuracy Participant/Exchange Unix Timestamp. - This is the timestamp of when the quote was actually generated at the exchange. - (provider: polygon) - sip_timestamp : Optional[Union[datetime]] - - The nanosecond accuracy SIP Unix Timestamp. - This is the timestamp of when the SIP received this quote from the exchange which produced it. - (provider: polygon) - trf_timestamp : Optional[Union[datetime]] - - The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. - This is the timestamp of when the trade reporting facility received this quote. - (provider: polygon) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.nbbo(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/nbbo", - **inputs, - ) - - @validate - def news( - self, - symbols: typing_extensions.Annotated[ - str, - OpenBBCustomParameter( - description=" Here it is a separated list of symbols." - ), - ], - limit: typing_extensions.Annotated[ - Union[typing_extensions.Annotated[int, Ge(ge=0)], None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 20, - chart: bool = False, - provider: Union[ - Literal["benzinga", "fmp", "intrinio", "polygon", "ultima", "yfinance"], - None, - ] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Company News. Get news for one or more companies. - - Parameters - ---------- - symbols : str - Here it is a separated list of symbols. - limit : Union[typing_extensions.Annotated[int, Ge(ge=0)], None] - The number of data entries to return. - chart : bool - Whether to create a chart or not, by default False. - provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'ultima',... - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'benzinga' if there is - no default. - display : Literal['headline', 'abstract', 'full'] - Specify headline only (headline), headline + teaser (abstract), or headline + full body (full). (provider: benzinga) - date : Optional[Union[str]] - Date of the news to retrieve. (provider: benzinga) - start_date : Optional[Union[str]] - Start date of the news to retrieve. (provider: benzinga) - end_date : Optional[Union[str]] - End date of the news to retrieve. (provider: benzinga) - updated_since : Optional[Union[int]] - Number of seconds since the news was updated. (provider: benzinga) - published_since : Optional[Union[int]] - Number of seconds since the news was published. (provider: benzinga) - sort : Optional[Union[Literal['id', 'created', 'updated']]] - Key to sort the news by. (provider: benzinga) - order : Optional[Union[Literal['asc', 'desc']]] - Order to sort the news by. (provider: benzinga); Sort order of the articles. (provider: polygon) - isin : Optional[Union[str]] - The ISIN of the news to retrieve. (provider: benzinga) - cusip : Optional[Union[str]] - The CUSIP of the news to retrieve. (provider: benzinga) - channels : Optional[Union[str]] - Channels of the news to retrieve. (provider: benzinga) - topics : Optional[Union[str]] - Topics of the news to retrieve. (provider: benzinga) - authors : Optional[Union[str]] - Authors of the news to retrieve. (provider: benzinga) - content_types : Optional[Union[str]] - Content types of the news to retrieve. (provider: benzinga) - page : Optional[Union[int]] - Page number of the results. Use in combination with limit. (provider: fmp) - published_utc : Optional[Union[str]] - Date query to fetch articles. Supports operators <, <=, >, >= (provider: polygon) - - Returns - ------- - OBBject - results : Union[List[CompanyNews]] - Serializable results. - provider : Union[Literal['benzinga', 'fmp', 'intrinio', 'polygon', 'ultima', 'yfinance'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CompanyNews - ----------- - date : datetime - The date of the data. Here it is the date of the news. - title : str - Title of the news. - image : Optional[Union[str]] - Image URL of the news. - text : Optional[Union[str]] - Text/body of the news. - url : str - URL of the news. - id : Optional[Union[str]] - ID of the news. (provider: benzinga); Intrinio ID for the article. (provider: intrinio); Article ID. (provider: polygon) - author : Optional[Union[str]] - Author of the news. (provider: benzinga); Author of the article. (provider: polygon) - teaser : Optional[Union[str]] - Teaser of the news. (provider: benzinga) - images : Optional[Union[List[Dict[str, str]], List[str], str]] - Images associated with the news. (provider: benzinga); URL to the images of the news. (provider: fmp) - channels : Optional[Union[str]] - Channels associated with the news. (provider: benzinga) - stocks : Optional[Union[str]] - Stocks associated with the news. (provider: benzinga) - tags : Optional[Union[str]] - Tags associated with the news. (provider: benzinga) - updated : Optional[Union[datetime]] - Updated date of the news. (provider: benzinga) - symbol : Optional[Union[str]] - Ticker of the fetched news. (provider: fmp) - site : Optional[Union[str]] - Name of the news source. (provider: fmp) - amp_url : Optional[Union[str]] - AMP URL. (provider: polygon) - image_url : Optional[Union[str]] - Image URL. (provider: polygon) - keywords : Optional[Union[List[str]]] - Keywords in the article (provider: polygon) - publisher : Optional[Union[openbb_polygon.models.company_news.PolygonPublisher, str]] - Publisher of the article. (provider: polygon, ultima, yfinance) - tickers : Optional[Union[List[str]]] - Tickers covered in the article. (provider: polygon) - ticker : Optional[Union[str]] - Ticker associated with the news. (provider: ultima) - risk_category : Optional[Union[str]] - Risk category of the news. (provider: ultima) - uuid : Optional[Union[str]] - Unique identifier for the news article (provider: yfinance) - type : Optional[Union[str]] - Type of the news article (provider: yfinance) - thumbnail : Optional[Union[List]] - Thumbnail related data to the ticker news article. (provider: yfinance) - related_tickers : Optional[Union[str]] - Tickers related to the news article. (provider: yfinance) - - Example - ------- - >>> from openbb import obb - >>> obb.news.company(symbols="AAPL,MSFT", limit=20) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbols": symbols, - "limit": limit, - }, - extra_params=kwargs, - chart=chart, - ) - - return self._run( - "/stocks/news", - **inputs, - ) - - @property - def options(self): # route = "/stocks/options" - from . import stocks_options - - return stocks_options.ROUTER_stocks_options(command_runner=self._command_runner) - - @validate - def price_performance( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Price performance as a return, over different periods. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[PricePerformance]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - PricePerformance - ---------------- - one_day : Optional[Union[float]] - One-day return. - wtd : Optional[Union[float]] - Week to date return. - one_week : Optional[Union[float]] - One-week return. - mtd : Optional[Union[float]] - Month to date return. - one_month : Optional[Union[float]] - One-month return. - qtd : Optional[Union[float]] - Quarter to date return. - three_month : Optional[Union[float]] - Three-month return. - six_month : Optional[Union[float]] - Six-month return. - ytd : Optional[Union[float]] - Year to date return. - one_year : Optional[Union[float]] - One-year return. - three_year : Optional[Union[float]] - Three-year return. - five_year : Optional[Union[float]] - Five-year return. - ten_year : Optional[Union[float]] - Ten-year return. - max : Optional[Union[float]] - Return from the beginning of the time series. - symbol : Optional[Union[str]] - The ticker symbol. (provider: fmp) - - Example - ------- - >>> from openbb import obb - >>> obb.etf.price_performance(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/price_performance", - **inputs, - ) - - @validate - def quote( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter( - description="Symbol to get data for. In this case, the comma separated list of symbols." - ), - ], - provider: Union[Literal["fmp", "intrinio"], None] = None, - **kwargs - ) -> OBBject[Union[List[Data], Data]]: - """Stock Quote. Load stock data for a specific ticker. - - Parameters - ---------- - symbol : str - Symbol to get data for. In this case, the comma separated list of symbols. - provider : Union[Literal['fmp', 'intrinio'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - source : Literal['iex', 'bats', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'intrinio_mx', 'intrinio_mx_plus', 'delayed_sip'] - Source of the data. (provider: intrinio) - - Returns - ------- - OBBject - results : Union[List[StockQuote], StockQuote] - Serializable results. - provider : Union[Literal['fmp', 'intrinio'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockQuote - ---------- - day_low : Optional[Union[float]] - Lowest price of the stock in the current trading day. - day_high : Optional[Union[float]] - Highest price of the stock in the current trading day. - date : Optional[Union[datetime]] - The date of the data. - symbol : Optional[Union[str]] - Symbol of the company. (provider: fmp) - name : Optional[Union[str]] - Name of the company. (provider: fmp) - price : Optional[Union[float]] - Current trading price of the stock. (provider: fmp) - changes_percentage : Optional[Union[float]] - Change percentage of the stock price. (provider: fmp) - change : Optional[Union[float]] - Change in the stock price. (provider: fmp) - year_high : Optional[Union[float]] - Highest price of the stock in the last 52 weeks. (provider: fmp) - year_low : Optional[Union[float]] - Lowest price of the stock in the last 52 weeks. (provider: fmp) - market_cap : Optional[Union[float]] - Market cap of the company. (provider: fmp) - price_avg50 : Optional[Union[float]] - 50 days average price of the stock. (provider: fmp) - price_avg200 : Optional[int] - 200 days average price of the stock. (provider: fmp) - volume : Optional[int] - Volume of the stock in the current trading day. (provider: fmp) - avg_volume : Optional[int] - Average volume of the stock in the last 10 trading days. (provider: fmp) - exchange : Optional[Union[str]] - Exchange the stock is traded on. (provider: fmp) - open : Optional[Union[float]] - Opening price of the stock in the current trading day. (provider: fmp) - previous_close : Optional[Union[float]] - Previous closing price of the stock. (provider: fmp) - eps : Optional[Union[float]] - Earnings per share of the stock. (provider: fmp) - pe : Optional[Union[float]] - Price earnings ratio of the stock. (provider: fmp) - earnings_announcement : Optional[Union[str]] - Earnings announcement date of the stock. (provider: fmp) - shares_outstanding : Optional[int] - Number of shares outstanding of the stock. (provider: fmp) - last_price : Optional[Union[float]] - Price of the last trade. (provider: intrinio) - last_time : Optional[Union[datetime]] - Date and Time when the last trade occurred. (provider: intrinio) - last_size : Optional[Union[int]] - Size of the last trade. (provider: intrinio) - bid_price : Optional[Union[float]] - Price of the top bid order. (provider: intrinio) - bid_size : Optional[Union[int]] - Size of the top bid order. (provider: intrinio) - ask_price : Optional[Union[float]] - Price of the top ask order. (provider: intrinio) - ask_size : Optional[Union[int]] - Size of the top ask order. (provider: intrinio) - open_price : Optional[Union[float]] - Open price for the trading day. (provider: intrinio) - close_price : Optional[Union[float]] - Closing price for the trading day (IEX source only). (provider: intrinio) - high_price : Optional[Union[float]] - High Price for the trading day. (provider: intrinio) - low_price : Optional[Union[float]] - Low Price for the trading day. (provider: intrinio) - exchange_volume : Optional[Union[int]] - Number of shares exchanged during the trading day on the exchange. (provider: intrinio) - market_volume : Optional[Union[int]] - Number of shares exchanged during the trading day for the whole market. (provider: intrinio) - updated_on : Optional[Union[datetime]] - Date and Time when the data was last updated. (provider: intrinio) - source : Optional[Union[str]] - Source of the data. (provider: intrinio) - listing_venue : Optional[Union[str]] - Listing venue where the trade took place (SIP source only). (provider: intrinio) - sales_conditions : Optional[Union[str]] - Indicates any sales condition modifiers associated with the trade. (provider: intrinio) - quote_conditions : Optional[Union[str]] - Indicates any quote condition modifiers associated with the trade. (provider: intrinio) - market_center_code : Optional[Union[str]] - Market center character code. (provider: intrinio) - is_darkpool : Optional[Union[bool]] - Whether or not the current trade is from a darkpool. (provider: intrinio) - messages : Optional[Union[List[str]]] - Messages associated with the endpoint. (provider: intrinio) - security : Optional[Union[Dict[str, Any]]] - Security details related to the quote. (provider: intrinio) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.quote(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/quote", - **inputs, - ) - - @validate - def search( - self, - query: typing_extensions.Annotated[ - str, OpenBBCustomParameter(description="Search query.") - ] = "", - is_symbol: typing_extensions.Annotated[ - bool, - OpenBBCustomParameter(description="Whether to search by ticker symbol."), - ] = False, - provider: Union[Literal["cboe", "fmp", "sec"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Search. Search for a company or stock ticker. - - Parameters - ---------- - query : str - Search query. - is_symbol : bool - Whether to search by ticker symbol. - provider : Union[Literal['cboe', 'fmp', 'sec'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'cboe' if there is - no default. - mktcap_min : Optional[Union[int]] - Filter by market cap greater than this value. (provider: fmp) - mktcap_max : Optional[Union[int]] - Filter by market cap less than this value. (provider: fmp) - price_min : Optional[Union[float]] - Filter by price greater than this value. (provider: fmp) - price_max : Optional[Union[float]] - Filter by price less than this value. (provider: fmp) - beta_min : Optional[Union[float]] - Filter by a beta greater than this value. (provider: fmp) - beta_max : Optional[Union[float]] - Filter by a beta less than this value. (provider: fmp) - volume_min : Optional[Union[int]] - Filter by volume greater than this value. (provider: fmp) - volume_max : Optional[Union[int]] - Filter by volume less than this value. (provider: fmp) - dividend_min : Optional[Union[float]] - Filter by dividend amount greater than this value. (provider: fmp) - dividend_max : Optional[Union[float]] - Filter by dividend amount less than this value. (provider: fmp) - is_etf : Optional[Union[bool]] - If true, returns only ETFs. (provider: fmp) - is_active : Optional[Union[bool]] - If false, returns only inactive tickers. (provider: fmp) - sector : Optional[Union[Literal['Consumer Cyclical', 'Energy', 'Technology', 'Industrials', 'Financial Services', 'Basic Materials', 'Communication Services', 'Consumer Defensive', 'Healthcare', 'Real Estate', 'Utilities', 'Industrial Goods', 'Financial', 'Services', 'Conglomerates']]] - Filter by sector. (provider: fmp) - industry : Optional[Union[str]] - Filter by industry. (provider: fmp) - country : Optional[Union[str]] - Filter by country, as a two-letter country code. (provider: fmp) - exchange : Optional[Union[Literal['amex', 'ase', 'asx', 'ath', 'bme', 'bru', 'bud', 'bue', 'cai', 'cnq', 'cph', 'dfm', 'doh', 'etf', 'euronext', 'hel', 'hkse', 'ice', 'iob', 'ist', 'jkt', 'jnb', 'jpx', 'kls', 'koe', 'ksc', 'kuw', 'lse', 'mex', 'nasdaq', 'neo', 'nse', 'nyse', 'nze', 'osl', 'otc', 'pnk', 'pra', 'ris', 'sao', 'sau', 'set', 'sgo', 'shh', 'shz', 'six', 'sto', 'tai', 'tlv', 'tsx', 'two', 'vie', 'wse', 'xetra']]] - Filter by exchange. (provider: fmp) - limit : Optional[Union[int]] - Limit the number of results to return. (provider: fmp) - is_fund : bool - Whether to direct the search to the list of mutual funds and ETFs. (provider: sec) - use_cache : bool - Whether to use the cache or not. Company names, tickers, and CIKs are cached for seven days. (provider: sec) - - Returns - ------- - OBBject - results : Union[List[StockSearch]] - Serializable results. - provider : Union[Literal['cboe', 'fmp', 'sec'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockSearch - ----------- - symbol : str - Symbol representing the entity requested in the data. - name : str - Name of the company. - dpm_name : Optional[Union[str]] - Name of the primary market maker. (provider: cboe) - post_station : Optional[Union[str]] - Post and station location on the CBOE trading floor. (provider: cboe) - market_cap : Optional[Union[int]] - The market cap of ticker. (provider: fmp) - sector : Optional[Union[str]] - The sector the ticker belongs to. (provider: fmp) - industry : Optional[Union[str]] - The industry ticker belongs to. (provider: fmp) - beta : Optional[Union[float]] - The beta of the ETF. (provider: fmp) - price : Optional[Union[float]] - The current price. (provider: fmp) - last_annual_dividend : Optional[Union[float]] - The last annual amount dividend paid. (provider: fmp) - volume : Optional[Union[int]] - The current trading volume. (provider: fmp) - exchange : Optional[Union[str]] - The exchange code the asset trades on. (provider: fmp) - exchange_name : Optional[Union[str]] - The full name of the primary exchange. (provider: fmp) - country : Optional[Union[str]] - The two-letter country abbreviation where the head office is located. (provider: fmp) - is_etf : Optional[Union[Literal[True, False]]] - Whether the ticker is an ETF. (provider: fmp) - actively_trading : Optional[Union[Literal[True, False]]] - Whether the ETF is actively trading. (provider: fmp) - cik : Optional[Union[str]] - Central Index Key (provider: sec) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.search() - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "query": query, - "is_symbol": is_symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/search", - **inputs, - ) diff --git a/openbb_platform/openbb/package/stocks_ca.py b/openbb_platform/openbb/package/stocks_ca.py deleted file mode 100644 index 73bfdc83d399..000000000000 --- a/openbb_platform/openbb/package/stocks_ca.py +++ /dev/null @@ -1,81 +0,0 @@ -### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - -from typing import List, Literal, Union - -import typing_extensions -from openbb_core.app.model.custom_parameter import OpenBBCustomParameter -from openbb_core.app.model.obbject import OBBject -from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate -from openbb_core.app.static.filters import filter_inputs -from openbb_provider.abstract.data import Data - - -class ROUTER_stocks_ca(Container): - """/stocks/ca - peers - """ - - def __repr__(self) -> str: - return self.__doc__ or "" - - @validate - def peers( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[Data]: - """Stock Peers. Company peers. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[StockPeers] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockPeers - ---------- - peers_list : List[str] - A list of stock peers based on sector, exchange and market cap. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.ca.peers(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/ca/peers", - **inputs, - ) diff --git a/openbb_platform/openbb/package/stocks_fa.py b/openbb_platform/openbb/package/stocks_fa.py deleted file mode 100644 index 3093efe0bafa..000000000000 --- a/openbb_platform/openbb/package/stocks_fa.py +++ /dev/null @@ -1,3248 +0,0 @@ -### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - -import datetime -from typing import List, Literal, Union - -import typing_extensions -from annotated_types import Ge -from openbb_core.app.model.custom_parameter import OpenBBCustomParameter -from openbb_core.app.model.obbject import OBBject -from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate -from openbb_core.app.static.filters import filter_inputs -from openbb_provider.abstract.data import Data - - -class ROUTER_stocks_fa(Container): - """/stocks/fa - balance - balance_growth - cash - cash_growth - comp - comsplit - divs - earning - emp - est - filings - income - income_growth - ins - ins_own - metrics - mgmt - overview - own - pt - pta - ratios - revgeo - revseg - shrs - split - transcript - """ - - def __repr__(self) -> str: - return self.__doc__ or "" - - @validate - def balance( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Union[Literal["annual", "quarter"], None], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - Union[typing_extensions.Annotated[int, Ge(ge=0)], None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 5, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Balance Sheet. Balance sheet statement. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Union[Literal['annual', 'quarter'], None] - Time period of the data to return. - limit : Union[typing_extensions.Annotated[int, Ge(ge=0)], None] - The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - cik : Optional[Union[str]] - Central Index Key (CIK) of the company. (provider: fmp) - filing_date : Optional[Union[datetime.date]] - Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[Union[datetime.date]] - Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[Union[datetime.date]] - Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[Union[datetime.date]] - Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[Union[datetime.date]] - Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[Union[datetime.date]] - Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[Union[datetime.date]] - Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[Union[datetime.date]] - Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[Union[datetime.date]] - Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[Union[datetime.date]] - Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[Union[bool]] - Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Union[Literal['asc', 'desc']]] - Order of the financial statement. (provider: polygon) - sort : Optional[Union[Literal['filing_date', 'period_of_report_date']]] - Sort of the financial statement. (provider: polygon) - - Returns - ------- - OBBject - results : Union[List[BalanceSheet]] - Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - BalanceSheet - ------------ - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - cik : Optional[Union[str]] - Central Index Key (CIK) of the company. - currency : Optional[Union[str]] - Reporting currency. - filling_date : Optional[Union[date]] - Filling date. - accepted_date : Optional[Union[datetime]] - Accepted date. - period : Optional[Union[str]] - Reporting period of the statement. - cash_and_cash_equivalents : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Cash and cash equivalents - short_term_investments : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Short-term investments - long_term_investments : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Long-term investments - inventory : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Inventory - net_receivables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Receivables, net - marketable_securities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Marketable securities - property_plant_equipment_net : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Property, plant and equipment, net - goodwill : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Goodwill - assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total assets - current_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total current assets - other_current_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other current assets - intangible_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Intangible assets - tax_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accrued income taxes - non_current_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total non-current assets - other_non_current_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other non-current assets - account_payables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accounts payable - tax_payables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accrued income taxes - deferred_revenue : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accrued income taxes, other deferred revenue - other_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other assets - total_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total assets - long_term_debt : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Long-term debt, Operating lease obligations, Long-term finance lease obligations - short_term_debt : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Short-term borrowings, Long-term debt due within one year, Operating lease obligations due within one year, Finance lease obligations due within one year - liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total liabilities - other_current_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other current liabilities - current_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total current liabilities - total_liabilities_and_total_equity : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total liabilities and total equity - other_non_current_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other non-current liabilities - non_current_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total non-current liabilities - total_liabilities_and_stockholders_equity : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total liabilities and stockholders' equity - other_stockholder_equity : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other stockholders equity - total_stockholders_equity : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total stockholders' equity - other_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other liabilities - total_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total liabilities - common_stock : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Common stock - preferred_stock : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Preferred stock - accumulated_other_comprehensive_income_loss : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accumulated other comprehensive income (loss) - retained_earnings : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Retained earnings - minority_interest : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Minority interest - total_equity : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total equity - calendar_year : Optional[int] - Calendar Year (provider: fmp) - cash_and_short_term_investments : Optional[int] - Cash and Short Term Investments (provider: fmp) - goodwill_and_intangible_assets : Optional[int] - Goodwill and Intangible Assets (provider: fmp) - deferred_revenue_non_current : Optional[int] - Deferred Revenue Non Current (provider: fmp) - total_investments : Optional[int] - Total investments (provider: fmp) - capital_lease_obligations : Optional[int] - Capital lease obligations (provider: fmp) - deferred_tax_liabilities_non_current : Optional[int] - Deferred Tax Liabilities Non Current (provider: fmp) - total_debt : Optional[int] - Total Debt (provider: fmp) - net_debt : Optional[int] - Net Debt (provider: fmp) - link : Optional[Union[str]] - Link to the statement. (provider: fmp) - final_link : Optional[Union[str]] - Link to the final statement. (provider: fmp) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.balance(symbol="AAPL", period="annual", limit=5) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/balance", - **inputs, - ) - - @validate - def balance_growth( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 10, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Balance Sheet Statement Growth. Information about the growth of the company balance sheet. - - Parameters - ---------- - symbol : str - Symbol to get data for. - limit : int - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[BalanceSheetGrowth]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - BalanceSheetGrowth - ------------------ - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Reporting period. - growth_cash_and_cash_equivalents : float - Growth rate of cash and cash equivalents. - growth_short_term_investments : float - Growth rate of short-term investments. - growth_cash_and_short_term_investments : float - Growth rate of cash and short-term investments. - growth_net_receivables : float - Growth rate of net receivables. - growth_inventory : float - Growth rate of inventory. - growth_other_current_assets : float - Growth rate of other current assets. - growth_total_current_assets : float - Growth rate of total current assets. - growth_property_plant_equipment_net : float - Growth rate of net property, plant, and equipment. - growth_goodwill : float - Growth rate of goodwill. - growth_intangible_assets : float - Growth rate of intangible assets. - growth_goodwill_and_intangible_assets : float - Growth rate of goodwill and intangible assets. - growth_long_term_investments : float - Growth rate of long-term investments. - growth_tax_assets : float - Growth rate of tax assets. - growth_other_non_current_assets : float - Growth rate of other non-current assets. - growth_total_non_current_assets : float - Growth rate of total non-current assets. - growth_other_assets : float - Growth rate of other assets. - growth_total_assets : float - Growth rate of total assets. - growth_account_payables : float - Growth rate of accounts payable. - growth_short_term_debt : float - Growth rate of short-term debt. - growth_tax_payables : float - Growth rate of tax payables. - growth_deferred_revenue : float - Growth rate of deferred revenue. - growth_other_current_liabilities : float - Growth rate of other current liabilities. - growth_total_current_liabilities : float - Growth rate of total current liabilities. - growth_long_term_debt : float - Growth rate of long-term debt. - growth_deferred_revenue_non_current : float - Growth rate of non-current deferred revenue. - growth_deferrred_tax_liabilities_non_current : float - Growth rate of non-current deferred tax liabilities. - growth_other_non_current_liabilities : float - Growth rate of other non-current liabilities. - growth_total_non_current_liabilities : float - Growth rate of total non-current liabilities. - growth_other_liabilities : float - Growth rate of other liabilities. - growth_total_liabilities : float - Growth rate of total liabilities. - growth_common_stock : float - Growth rate of common stock. - growth_retained_earnings : float - Growth rate of retained earnings. - growth_accumulated_other_comprehensive_income_loss : float - Growth rate of accumulated other comprehensive income/loss. - growth_othertotal_stockholders_equity : float - Growth rate of other total stockholders' equity. - growth_total_stockholders_equity : float - Growth rate of total stockholders' equity. - growth_total_liabilities_and_stockholders_equity : float - Growth rate of total liabilities and stockholders' equity. - growth_total_investments : float - Growth rate of total investments. - growth_total_debt : float - Growth rate of total debt. - growth_net_debt : float - Growth rate of net debt. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.balance_growth(symbol="AAPL", limit=10) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/balance_growth", - **inputs, - ) - - @validate - def cash( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Union[Literal["annual", "quarter"], None], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - Union[typing_extensions.Annotated[int, Ge(ge=0)], None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 5, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Cash Flow Statement. Information about the cash flow statement. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Union[Literal['annual', 'quarter'], None] - Time period of the data to return. - limit : Union[typing_extensions.Annotated[int, Ge(ge=0)], None] - The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - cik : Optional[Union[str]] - Central Index Key (CIK) of the company. (provider: fmp) - filing_date : Optional[Union[datetime.date]] - Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[Union[datetime.date]] - Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[Union[datetime.date]] - Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[Union[datetime.date]] - Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[Union[datetime.date]] - Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[Union[datetime.date]] - Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[Union[datetime.date]] - Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[Union[datetime.date]] - Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[Union[datetime.date]] - Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[Union[datetime.date]] - Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[Union[bool]] - Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Union[Literal['asc', 'desc']]] - Order of the financial statement. (provider: polygon) - sort : Optional[Union[Literal['filing_date', 'period_of_report_date']]] - Sort of the financial statement. (provider: polygon) - - Returns - ------- - OBBject - results : Union[List[CashFlowStatement]] - Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CashFlowStatement - ----------------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : Optional[Union[str]] - Reporting period of the statement. - cik : Optional[Union[str]] - Central Index Key (CIK) of the company. - net_income : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net income. - depreciation_and_amortization : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Depreciation and amortization. - stock_based_compensation : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Stock based compensation. - deferred_income_tax : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Deferred income tax. - other_non_cash_items : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other non-cash items. - changes_in_operating_assets_and_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Changes in operating assets and liabilities. - accounts_receivables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accounts receivables. - inventory : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Inventory. - vendor_non_trade_receivables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Vendor non-trade receivables. - other_current_and_non_current_assets : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other current and non-current assets. - accounts_payables : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Accounts payables. - deferred_revenue : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Deferred revenue. - other_current_and_non_current_liabilities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other current and non-current liabilities. - net_cash_flow_from_operating_activities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net cash flow from operating activities. - purchases_of_marketable_securities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Purchases of investments. - sales_from_maturities_of_investments : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Sales and maturities of investments. - investments_in_property_plant_and_equipment : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Investments in property, plant, and equipment. - payments_from_acquisitions : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Acquisitions, net of cash acquired, and other - other_investing_activities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other investing activities - net_cash_flow_from_investing_activities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net cash used for investing activities. - taxes_paid_on_net_share_settlement : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Taxes paid on net share settlement of equity awards. - dividends_paid : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Payments for dividends and dividend equivalents - common_stock_repurchased : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Payments related to repurchase of common stock - debt_proceeds : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Proceeds from issuance of term debt - debt_repayment : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Payments of long-term debt - other_financing_activities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other financing activities, net - net_cash_flow_from_financing_activities : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net cash flow from financing activities. - net_change_in_cash : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net increase (decrease) in cash, cash equivalents, and restricted cash - reported_currency : Optional[Union[str]] - Reported currency in the statement. (provider: fmp) - filling_date : Optional[Union[date]] - Filling date. (provider: fmp) - accepted_date : Optional[Union[datetime]] - Accepted date. (provider: fmp) - calendar_year : Optional[int] - Calendar year. (provider: fmp) - change_in_working_capital : Optional[int] - Change in working capital. (provider: fmp) - other_working_capital : Optional[int] - Other working capital. (provider: fmp) - common_stock_issued : Optional[int] - Common stock issued. (provider: fmp) - effect_of_forex_changes_on_cash : Optional[int] - Effect of forex changes on cash. (provider: fmp) - cash_at_beginning_of_period : Optional[int] - Cash at beginning of period. (provider: fmp) - cash_at_end_of_period : Optional[int] - Cash, cash equivalents, and restricted cash at end of period (provider: fmp) - operating_cash_flow : Optional[int] - Operating cash flow. (provider: fmp) - capital_expenditure : Optional[int] - Capital expenditure. (provider: fmp) - free_cash_flow : Optional[int] - Free cash flow. (provider: fmp) - link : Optional[Union[str]] - Link to the statement. (provider: fmp) - final_link : Optional[Union[str]] - Link to the final statement. (provider: fmp) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.cash(symbol="AAPL", period="annual", limit=5) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/cash", - **inputs, - ) - - @validate - def cash_growth( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 10, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Cash Flow Statement Growth. Information about the growth of the company cash flow statement. - - Parameters - ---------- - symbol : str - Symbol to get data for. - limit : int - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[CashFlowStatementGrowth]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CashFlowStatementGrowth - ----------------------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Period the statement is returned for. - growth_net_income : float - Growth rate of net income. - growth_depreciation_and_amortization : float - Growth rate of depreciation and amortization. - growth_deferred_income_tax : float - Growth rate of deferred income tax. - growth_stock_based_compensation : float - Growth rate of stock-based compensation. - growth_change_in_working_capital : float - Growth rate of change in working capital. - growth_accounts_receivables : float - Growth rate of accounts receivables. - growth_inventory : float - Growth rate of inventory. - growth_accounts_payables : float - Growth rate of accounts payables. - growth_other_working_capital : float - Growth rate of other working capital. - growth_other_non_cash_items : float - Growth rate of other non-cash items. - growth_net_cash_provided_by_operating_activities : float - Growth rate of net cash provided by operating activities. - growth_investments_in_property_plant_and_equipment : float - Growth rate of investments in property, plant, and equipment. - growth_acquisitions_net : float - Growth rate of net acquisitions. - growth_purchases_of_investments : float - Growth rate of purchases of investments. - growth_sales_maturities_of_investments : float - Growth rate of sales maturities of investments. - growth_other_investing_activities : float - Growth rate of other investing activities. - growth_net_cash_used_for_investing_activities : float - Growth rate of net cash used for investing activities. - growth_debt_repayment : float - Growth rate of debt repayment. - growth_common_stock_issued : float - Growth rate of common stock issued. - growth_common_stock_repurchased : float - Growth rate of common stock repurchased. - growth_dividends_paid : float - Growth rate of dividends paid. - growth_other_financing_activities : float - Growth rate of other financing activities. - growth_net_cash_used_provided_by_financing_activities : float - Growth rate of net cash used/provided by financing activities. - growth_effect_of_forex_changes_on_cash : float - Growth rate of the effect of foreign exchange changes on cash. - growth_net_change_in_cash : float - Growth rate of net change in cash. - growth_cash_at_end_of_period : float - Growth rate of cash at the end of the period. - growth_cash_at_beginning_of_period : float - Growth rate of cash at the beginning of the period. - growth_operating_cash_flow : float - Growth rate of operating cash flow. - growth_capital_expenditure : float - Growth rate of capital expenditure. - growth_free_cash_flow : float - Growth rate of free cash flow. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.cash_growth(symbol="AAPL", limit=10) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/cash_growth", - **inputs, - ) - - @validate - def comp( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Executive Compensation. Information about the executive compensation for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[ExecutiveCompensation]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - ExecutiveCompensation - --------------------- - symbol : str - Symbol representing the entity requested in the data. - cik : Optional[Union[str]] - Central Index Key (CIK) of the company. - filing_date : date - Date of the filing. - accepted_date : datetime - Date the filing was accepted. - name_and_position : str - Name and position of the executive. - year : int - Year of the compensation. - salary : float - Salary of the executive. - bonus : float - Bonus of the executive. - stock_award : float - Stock award of the executive. - incentive_plan_compensation : float - Incentive plan compensation of the executive. - all_other_compensation : float - All other compensation of the executive. - total : float - Total compensation of the executive. - url : str - URL of the filing data. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.comp(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/comp", - **inputs, - ) - - @validate - def comsplit( - self, - start_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="Start date of the data, in YYYY-MM-DD format." - ), - ] = None, - end_date: typing_extensions.Annotated[ - Union[datetime.date, None, str], - OpenBBCustomParameter( - description="End date of the data, in YYYY-MM-DD format." - ), - ] = None, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Split Calendar. Show Stock Split Calendar. - - Parameters - ---------- - start_date : Union[datetime.date, None] - Start date of the data, in YYYY-MM-DD format. - end_date : Union[datetime.date, None] - End date of the data, in YYYY-MM-DD format. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[StockSplitCalendar]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockSplitCalendar - ------------------ - date : date - The date of the data. - label : str - Label of the stock splits. - symbol : str - Symbol representing the entity requested in the data. - numerator : float - Numerator of the stock splits. - denominator : float - Denominator of the stock splits. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.comsplit() - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "start_date": start_date, - "end_date": end_date, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/comsplit", - **inputs, - ) - - @validate - def divs( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Historical Dividends. Historical dividends data for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[HistoricalDividends]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - HistoricalDividends - ------------------- - date : date - The date of the data. - label : str - Label of the historical dividends. - adj_dividend : float - Adjusted dividend of the historical dividends. - dividend : float - Dividend of the historical dividends. - record_date : Optional[Union[date]] - Record date of the historical dividends. - payment_date : Optional[Union[date]] - Payment date of the historical dividends. - declaration_date : Optional[Union[date]] - Declaration date of the historical dividends. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.divs(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/divs", - **inputs, - ) - - @validate - def earning( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - limit: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 50, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Earnings Calendar. Earnings calendar for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - limit : Union[int, None] - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[EarningsCalendar]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - EarningsCalendar - ---------------- - symbol : str - Symbol representing the entity requested in the data. - date : date - The date of the data. - eps : Optional[Union[float]] - EPS of the earnings calendar. - eps_estimated : Optional[Union[float]] - Estimated EPS of the earnings calendar. - time : str - Time of the earnings calendar. - revenue : Optional[Union[float]] - Revenue of the earnings calendar. - revenue_estimated : Optional[Union[float]] - Estimated revenue of the earnings calendar. - updated_from_date : Optional[date] - Updated from date of the earnings calendar. - fiscal_date_ending : date - Fiscal date ending of the earnings calendar. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.earning(symbol="AAPL", limit=50) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/earning", - **inputs, - ) - - @validate - def emp( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Historical Employees. Historical number of employees. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[HistoricalEmployees]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - HistoricalEmployees - ------------------- - symbol : str - Symbol representing the entity requested in the data. - cik : int - CIK of the company to retrieve the historical employees of. - acceptance_time : datetime - Time of acceptance of the company employee. - period_of_report : date - Date of reporting of the company employee. - company_name : str - Registered name of the company to retrieve the historical employees of. - form_type : str - Form type of the company employee. - filing_date : date - Filing date of the company employee - employee_count : int - Count of employees of the company. - source : str - Source URL which retrieves this data for the company. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.emp(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/emp", - **inputs, - ) - - @validate - def est( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 30, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Analyst Estimates. Analyst stock recommendations. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Literal['quarter', 'annual'] - Time period of the data to return. - limit : int - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[AnalystEstimates]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - AnalystEstimates - ---------------- - symbol : str - Symbol representing the entity requested in the data. - date : date - The date of the data. - estimated_revenue_low : int - Estimated revenue low. - estimated_revenue_high : int - Estimated revenue high. - estimated_revenue_avg : int - Estimated revenue average. - estimated_ebitda_low : int - Estimated EBITDA low. - estimated_ebitda_high : int - Estimated EBITDA high. - estimated_ebitda_avg : int - Estimated EBITDA average. - estimated_ebit_low : int - Estimated EBIT low. - estimated_ebit_high : int - Estimated EBIT high. - estimated_ebit_avg : int - Estimated EBIT average. - estimated_net_income_low : int - Estimated net income low. - estimated_net_income_high : int - Estimated net income high. - estimated_net_income_avg : int - Estimated net income average. - estimated_sga_expense_low : int - Estimated SGA expense low. - estimated_sga_expense_high : int - Estimated SGA expense high. - estimated_sga_expense_avg : int - Estimated SGA expense average. - estimated_eps_avg : float - Estimated EPS average. - estimated_eps_high : float - Estimated EPS high. - estimated_eps_low : float - Estimated EPS low. - number_analyst_estimated_revenue : int - Number of analysts who estimated revenue. - number_analysts_estimated_eps : int - Number of analysts who estimated EPS. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.est(symbol="AAPL", period="annual", limit=30) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/est", - **inputs, - ) - - @validate - def filings( - self, - symbol: typing_extensions.Annotated[ - Union[str, None, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ] = None, - limit: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 300, - provider: Union[Literal["fmp", "sec"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Company Filings. Company filings data. - - Parameters - ---------- - symbol : Union[str, None] - Symbol to get data for. - limit : Union[int, None] - The number of data entries to return. - provider : Union[Literal['fmp', 'sec'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - type : Optional[Union[Literal['1', '1-A', '1-E', '1-K', '1-N', '1-SA', '1-U', '1-Z', '10', '10-D', '10-K', '10-M', '10-Q', '11-K', '12b-25', '13F', '13H', '144', '15', '15F', '17-H', '18', '18-K', '19b-4', '19b-4(e)', '19b-7', '2-E', '20-F', '24F-2', '25', '3', '4', '40-F', '5', '6-K', '7-M', '8-A', '8-K', '8-M', '9-M', 'ABS-15G', 'ABS-EE', 'ABS DD-15E', 'ADV', 'ADV-E', 'ADV-H', 'ADV-NR', 'ADV-W', 'ATS', 'ATS-N', 'ATS-R', 'BD', 'BD-N', 'BDW', 'C', 'CA-1', 'CB', 'CFPORTAL', 'CRS', 'CUSTODY', 'D', 'F-1', 'F-10', 'F-3', 'F-4', 'F-6', 'F-7', 'F-8', 'F-80', 'F-N', 'F-X', 'ID', 'MA', 'MA-I', 'MA-NR', 'MA-W', 'MSD', 'MSDW', 'N-14', 'N-17D-1', 'N-17f-1', 'N-17f-2', 'N-18f-1', 'N-1A', 'N-2', 'N-23c-3', 'N-27D-1', 'N-3', 'N-4', 'N-5', 'N-54A', 'N-54C', 'N-6', 'N-6EI-1', 'N-6F', 'N-8A', 'N-8B-2', 'N-8B-4', 'N-8F', 'N-CEN'], Literal['1', '1-A', '1-A POS', '1-A-W', '1-E', '1-E AD', '1-K', '1-SA', '1-U', '1-Z', '1-Z-W', '10-12B', '10-12G', '10-D', '10-K', '10-KT', '10-Q', '10-QT', '11-K', '11-KT', '13F-HR', '13F-NT', '13FCONP', '144', '15-12B', '15-12G', '15-15D', '15F-12B', '15F-12G', '15F-15D', '18-12B', '18-K', '19B-4E', '2-A', '2-AF', '2-E', '20-F', '20FR12B', '20FR12G', '24F-2NT', '25', '25-NSE', '253G1', '253G2', '253G3', '253G4', '3', '305B2', '34-12H', '4', '40-17F1', '40-17F2', '40-17G', '40-17GCS', '40-202A', '40-203A', '40-206A', '40-24B2', '40-33', '40-6B', '40-8B25', '40-8F-2', '40-APP', '40-F', '40-OIP', '40FR12B', '40FR12G', '424A', '424B1', '424B2', '424B3', '424B4', '424B5', '424B7', '424B8', '424H', '425', '485APOS', '485BPOS', '485BXT', '486APOS', '486BPOS', '486BXT', '487', '497', '497AD', '497H2', '497J', '497K', '497VPI', '497VPU', '5', '6-K', '6B NTC', '6B ORDR', '8-A12B', '8-A12G', '8-K', '8-K12B', '8-K12G3', '8-K15D5', '8-M', '8F-2 NTC', '8F-2 ORDR', '9-M', 'ABS-15G', 'ABS-EE', 'ADN-MTL', 'ADV-E', 'ADV-H-C', 'ADV-H-T', 'ADV-NR', 'ANNLRPT', 'APP NTC', 'APP ORDR', 'APP WD', 'APP WDG', 'ARS', 'ATS-N', 'ATS-N-C', 'ATS-N/UA', 'AW', 'AW WD', 'C', 'C-AR', 'C-AR-W', 'C-TR', 'C-TR-W', 'C-U', 'C-U-W', 'C-W', 'CB', 'CERT', 'CERTARCA', 'CERTBATS', 'CERTCBO', 'CERTNAS', 'CERTNYS', 'CERTPAC', 'CFPORTAL', 'CFPORTAL-W', 'CORRESP', 'CT ORDER', 'D', 'DEF 14A', 'DEF 14C', 'DEFA14A', 'DEFA14C', 'DEFC14A', 'DEFC14C', 'DEFM14A', 'DEFM14C', 'DEFN14A', 'DEFR14A', 'DEFR14C', 'DEL AM', 'DFAN14A', 'DFRN14A', 'DOS', 'DOSLTR', 'DRS', 'DRSLTR', 'DSTRBRPT', 'EFFECT', 'F-1', 'F-10', 'F-10EF', 'F-10POS', 'F-1MEF', 'F-3', 'F-3ASR', 'F-3D', 'F-3DPOS', 'F-3MEF', 'F-4', 'F-4 POS', 'F-4MEF', 'F-6', 'F-6 POS', 'F-6EF', 'F-7', 'F-7 POS', 'F-8', 'F-8 POS', 'F-80', 'F-80POS', 'F-9', 'F-9 POS', 'F-N', 'F-X', 'FOCUSN', 'FWP', 'G-405', 'G-405N', 'G-FIN', 'G-FINW', 'IRANNOTICE', 'MA', 'MA-A', 'MA-I', 'MA-W', 'MSD', 'MSDCO', 'MSDW', 'N-1', 'N-14', 'N-14 8C', 'N-14MEF', 'N-18F1', 'N-1A', 'N-2', 'N-2 POSASR', 'N-23C-2', 'N-23C3A', 'N-23C3B', 'N-23C3C', 'N-2ASR', 'N-2MEF', 'N-30B-2', 'N-30D', 'N-4', 'N-5', 'N-54A', 'N-54C', 'N-6', 'N-6F', 'N-8A', 'N-8B-2', 'N-8F', 'N-8F NTC', 'N-8F ORDR', 'N-CEN', 'N-CR', 'N-CSR', 'N-CSRS', 'N-MFP', 'N-MFP1', 'N-MFP2', 'N-PX', 'N-Q', 'N-VP', 'N-VPFS', 'NO ACT', 'NPORT-EX', 'NPORT-NP', 'NPORT-P', 'NRSRO-CE', 'NRSRO-UPD', 'NSAR-A', 'NSAR-AT', 'NSAR-B', 'NSAR-BT', 'NSAR-U', 'NT 10-D', 'NT 10-K', 'NT 10-Q', 'NT 11-K', 'NT 20-F', 'NT N-CEN', 'NT N-MFP', 'NT N-MFP1', 'NT N-MFP2', 'NT NPORT-EX', 'NT NPORT-P', 'NT-NCEN', 'NT-NCSR', 'NT-NSAR', 'NTFNCEN', 'NTFNCSR', 'NTFNSAR', 'NTN 10D', 'NTN 10K', 'NTN 10Q', 'NTN 20F', 'OIP NTC', 'OIP ORDR', 'POS 8C', 'POS AM', 'POS AMI', 'POS EX', 'POS462B', 'POS462C', 'POSASR', 'PRE 14A', 'PRE 14C', 'PREC14A', 'PREC14C', 'PREM14A', 'PREM14C', 'PREN14A', 'PRER14A', 'PRER14C', 'PRRN14A', 'PX14A6G', 'PX14A6N', 'QRTLYRPT', 'QUALIF', 'REG-NR', 'REVOKED', 'RW', 'RW WD', 'S-1', 'S-11', 'S-11MEF', 'S-1MEF', 'S-20', 'S-3', 'S-3ASR', 'S-3D', 'S-3DPOS', 'S-3MEF', 'S-4', 'S-4 POS', 'S-4EF', 'S-4MEF', 'S-6', 'S-8', 'S-8 POS', 'S-B', 'S-BMEF', 'SBSE', 'SBSE-A', 'SBSE-BD', 'SBSE-C', 'SBSE-W', 'SC 13D', 'SC 13E1', 'SC 13E3', 'SC 13G', 'SC 14D9', 'SC 14F1', 'SC 14N', 'SC TO-C', 'SC TO-I', 'SC TO-T', 'SC13E4F', 'SC14D1F', 'SC14D9C', 'SC14D9F', 'SD', 'SDR', 'SE', 'SEC ACTION', 'SEC STAFF ACTION', 'SEC STAFF LETTER', 'SF-1', 'SF-3', 'SL', 'SP 15D2', 'STOP ORDER', 'SUPPL', 'T-3', 'TA-1', 'TA-2', 'TA-W', 'TACO', 'TH', 'TTW', 'UNDER', 'UPLOAD', 'WDL-REQ', 'X-17A-5']]] - Type of the SEC filing form. (provider: fmp, sec) - page : Optional[Union[int]] - Page number of the results. (provider: fmp) - cik : Optional[Union[str, int]] - Lookup filings by Central Index Key (CIK) instead of by symbol. (provider: sec) - use_cache : bool - Whether or not to use cache. If True, cache will store for one day. (provider: sec) - - Returns - ------- - OBBject - results : Union[List[CompanyFilings]] - Serializable results. - provider : Union[Literal['fmp', 'sec'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CompanyFilings - -------------- - date : date - The date of the data. In this case, it is the date of the filing. - type : str - Type of document. - link : str - URL to the document. - symbol : Optional[Union[str]] - The ticker symbol of the company. (provider: fmp) - cik : Optional[Union[str]] - CIK of the SEC filing. (provider: fmp) - accepted_date : Optional[Union[datetime]] - Accepted date of the SEC filing. (provider: fmp, sec) - final_link : Optional[Union[str]] - Final link of the SEC filing. (provider: fmp) - report_date : Optional[Union[date]] - The date of the filing. (provider: sec) - act : Optional[Union[str, int]] - The SEC Act number. (provider: sec) - items : Optional[Union[str, float]] - The SEC Item numbers. (provider: sec) - primary_doc_description : Optional[Union[str]] - The description of the primary document. (provider: sec) - primary_doc : Optional[Union[str]] - The filename of the primary document. (provider: sec) - accession_number : Optional[Union[str, int]] - The accession number. (provider: sec) - file_number : Optional[Union[str, int]] - The file number. (provider: sec) - film_number : Optional[Union[str, int]] - The film number. (provider: sec) - is_inline_xbrl : Optional[Union[str, int]] - Whether the filing is an inline XBRL filing. (provider: sec) - is_xbrl : Optional[Union[str, int]] - Whether the filing is an XBRL filing. (provider: sec) - size : Optional[Union[str, int]] - The size of the filing. (provider: sec) - complete_submission_url : Optional[Union[str]] - The URL to the complete filing submission. (provider: sec) - filing_detail_url : Optional[Union[str]] - The URL to the filing details. (provider: sec) - xml : Optional[Union[str]] - The URL to the primary XML document. (provider: sec) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.filings(limit=300) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/filings", - **inputs, - ) - - @validate - def income( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Union[Literal["annual", "quarter"], None], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - Union[typing_extensions.Annotated[int, Ge(ge=0)], None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 5, - provider: Union[Literal["fmp", "intrinio", "polygon", "yfinance"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Income Statement. Report on a company's finanacial performance. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Union[Literal['annual', 'quarter'], None] - Time period of the data to return. - limit : Union[typing_extensions.Annotated[int, Ge(ge=0)], None] - The number of data entries to return. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - cik : Optional[Union[str]] - The CIK of the company if no symbol is provided. (provider: fmp) - filing_date : Optional[Union[datetime.date]] - Filing date of the financial statement. (provider: polygon) - filing_date_lt : Optional[Union[datetime.date]] - Filing date less than the given date. (provider: polygon) - filing_date_lte : Optional[Union[datetime.date]] - Filing date less than or equal to the given date. (provider: polygon) - filing_date_gt : Optional[Union[datetime.date]] - Filing date greater than the given date. (provider: polygon) - filing_date_gte : Optional[Union[datetime.date]] - Filing date greater than or equal to the given date. (provider: polygon) - period_of_report_date : Optional[Union[datetime.date]] - Period of report date of the financial statement. (provider: polygon) - period_of_report_date_lt : Optional[Union[datetime.date]] - Period of report date less than the given date. (provider: polygon) - period_of_report_date_lte : Optional[Union[datetime.date]] - Period of report date less than or equal to the given date. (provider: polygon) - period_of_report_date_gt : Optional[Union[datetime.date]] - Period of report date greater than the given date. (provider: polygon) - period_of_report_date_gte : Optional[Union[datetime.date]] - Period of report date greater than or equal to the given date. (provider: polygon) - include_sources : Optional[Union[bool]] - Whether to include the sources of the financial statement. (provider: polygon) - order : Optional[Union[Literal['asc', 'desc']]] - Order of the financial statement. (provider: polygon) - sort : Optional[Union[Literal['filing_date', 'period_of_report_date']]] - Sort of the financial statement. (provider: polygon) - - Returns - ------- - OBBject - results : Union[List[IncomeStatement]] - Serializable results. - provider : Union[Literal['fmp', 'intrinio', 'polygon', 'yfinance'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - IncomeStatement - --------------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. In this case, the date of the income statement. - period : Optional[Union[str]] - Period of the income statement. - cik : Optional[Union[str]] - Central Index Key. - revenue : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Revenue. - cost_of_revenue : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Cost of revenue. - gross_profit : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Gross profit. - cost_and_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Cost and expenses. - gross_profit_ratio : Optional[Union[float]] - Gross profit ratio. - research_and_development_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Research and development expenses. - general_and_administrative_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - General and administrative expenses. - selling_and_marketing_expenses : Optional[Union[float]] - Selling and marketing expenses. - selling_general_and_administrative_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Selling, general and administrative expenses. - other_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Other expenses. - operating_expenses : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Operating expenses. - depreciation_and_amortization : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Depreciation and amortization. - ebitda : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Earnings before interest, taxes, depreciation and amortization. - ebitda_ratio : Optional[Union[float]] - Earnings before interest, taxes, depreciation and amortization ratio. - operating_income : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Operating income. - operating_income_ratio : Optional[Union[float]] - Operating income ratio. - interest_income : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Interest income. - interest_expense : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Interest expense. - total_other_income_expenses_net : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Total other income expenses net. - income_before_tax : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Income before tax. - income_before_tax_ratio : Optional[Union[float]] - Income before tax ratio. - income_tax_expense : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Income tax expense. - net_income : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Net income. - net_income_ratio : Optional[Union[float]] - Net income ratio. - eps : Optional[Union[float]] - Earnings per share. - eps_diluted : Optional[Union[float]] - Earnings per share diluted. - weighted_average_shares_outstanding : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Weighted average shares outstanding. - weighted_average_shares_outstanding_dil : Optional[Union[typing_extensions.Annotated[float, Strict(strict=True)]]] - Weighted average shares outstanding diluted. - link : Optional[Union[str]] - Link to the income statement. - final_link : Optional[Union[str]] - Final link to the income statement. - reported_currency : Optional[Union[str]] - Reporting currency. (provider: fmp) - filling_date : Optional[Union[date]] - Filling date. (provider: fmp) - accepted_date : Optional[Union[datetime]] - Accepted date. (provider: fmp) - calendar_year : Optional[Union[int]] - Calendar year. (provider: fmp) - income_loss_from_continuing_operations_before_tax : Optional[Union[float]] - Income/Loss From Continuing Operations After Tax (provider: polygon) - income_loss_from_continuing_operations_after_tax : Optional[Union[float]] - Income (loss) from continuing operations after tax (provider: polygon) - benefits_costs_expenses : Optional[Union[float]] - Benefits, costs and expenses (provider: polygon) - net_income_loss_attributable_to_noncontrolling_interest : Optional[int] - Net income (loss) attributable to noncontrolling interest (provider: polygon) - net_income_loss_attributable_to_parent : Optional[Union[float]] - Net income (loss) attributable to parent (provider: polygon) - net_income_loss_available_to_common_stockholders_basic : Optional[Union[float]] - Net Income/Loss Available To Common Stockholders Basic (provider: polygon) - participating_securities_distributed_and_undistributed_earnings_loss_basic : Optional[Union[float]] - Participating Securities Distributed And Undistributed Earnings Loss Basic (provider: polygon) - nonoperating_income_loss : Optional[Union[float]] - Nonoperating Income Loss (provider: polygon) - preferred_stock_dividends_and_other_adjustments : Optional[Union[float]] - Preferred stock dividends and other adjustments (provider: polygon) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.income(symbol="AAPL", period="annual", limit=5) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/income", - **inputs, - ) - - @validate - def income_growth( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 10, - period: typing_extensions.Annotated[ - Literal["annual", "quarter"], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Income Statement Growth. Information about the growth of the company income statement. - - Parameters - ---------- - symbol : str - Symbol to get data for. - limit : int - The number of data entries to return. - period : Literal['annual', 'quarter'] - Time period of the data to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[IncomeStatementGrowth]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - IncomeStatementGrowth - --------------------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Period the statement is returned for. - growth_revenue : float - Growth rate of total revenue. - growth_cost_of_revenue : float - Growth rate of cost of goods sold. - growth_gross_profit : float - Growth rate of gross profit. - growth_gross_profit_ratio : float - Growth rate of gross profit as a percentage of revenue. - growth_research_and_development_expenses : float - Growth rate of expenses on research and development. - growth_general_and_administrative_expenses : float - Growth rate of general and administrative expenses. - growth_selling_and_marketing_expenses : float - Growth rate of expenses on selling and marketing activities. - growth_other_expenses : float - Growth rate of other operating expenses. - growth_operating_expenses : float - Growth rate of total operating expenses. - growth_cost_and_expenses : float - Growth rate of total costs and expenses. - growth_interest_expense : float - Growth rate of interest expenses. - growth_depreciation_and_amortization : float - Growth rate of depreciation and amortization expenses. - growth_ebitda : float - Growth rate of Earnings Before Interest, Taxes, Depreciation, and Amortization. - growth_ebitda_ratio : float - Growth rate of EBITDA as a percentage of revenue. - growth_operating_income : float - Growth rate of operating income. - growth_operating_income_ratio : float - Growth rate of operating income as a percentage of revenue. - growth_total_other_income_expenses_net : float - Growth rate of net total other income and expenses. - growth_income_before_tax : float - Growth rate of income before taxes. - growth_income_before_tax_ratio : float - Growth rate of income before taxes as a percentage of revenue. - growth_income_tax_expense : float - Growth rate of income tax expenses. - growth_net_income : float - Growth rate of net income. - growth_net_income_ratio : float - Growth rate of net income as a percentage of revenue. - growth_eps : float - Growth rate of Earnings Per Share (EPS). - growth_eps_diluted : float - Growth rate of diluted Earnings Per Share (EPS). - growth_weighted_average_shs_out : float - Growth rate of weighted average shares outstanding. - growth_weighted_average_shs_out_dil : float - Growth rate of diluted weighted average shares outstanding. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.income_growth(symbol="AAPL", limit=10, period="annual") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "limit": limit, - "period": period, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/income_growth", - **inputs, - ) - - @validate - def ins( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - transaction_type: typing_extensions.Annotated[ - Union[ - List[ - Literal[ - "A-Award", - "C-Conversion", - "D-Return", - "E-ExpireShort", - "F-InKind", - "G-Gift", - "H-ExpireLong", - "I-Discretionary", - "J-Other", - "L-Small", - "M-Exempt", - "O-OutOfTheMoney", - "P-Purchase", - "S-Sale", - "U-Tender", - "W-Will", - "X-InTheMoney", - "Z-Trust", - ] - ], - str, - None, - ], - OpenBBCustomParameter(description="Type of the transaction."), - ] = ["P-Purchase"], - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 100, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Insider Trading. Information about insider trading. - - Parameters - ---------- - symbol : str - Symbol to get data for. - transaction_type : Union[List[Literal['A-Award', 'C-Conversion', 'D-Return', ... - Type of the transaction. - limit : int - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[StockInsiderTrading]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockInsiderTrading - ------------------- - symbol : str - Symbol representing the entity requested in the data. - filing_date : datetime - Filing date of the stock insider trading. - transaction_date : date - Transaction date of the stock insider trading. - reporting_cik : int - Reporting CIK of the stock insider trading. - transaction_type : str - Transaction type of the stock insider trading. - securities_owned : int - Securities owned of the stock insider trading. - company_cik : int - Company CIK of the stock insider trading. - reporting_name : str - Reporting name of the stock insider trading. - type_of_owner : str - Type of owner of the stock insider trading. - acquisition_or_disposition : Optional[Union[str]] - Acquisition or disposition of the stock insider trading. - form_type : str - Form type of the stock insider trading. - securities_transacted : float - Securities transacted of the stock insider trading. - price : Optional[Union[float]] - Price of the stock insider trading. - security_name : str - Security name of the stock insider trading. - link : str - Link of the stock insider trading. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.ins(symbol="AAPL", transaction_type=['P-Purchase'], limit=100) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "transaction_type": transaction_type, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/ins", - **inputs, - ) - - @validate - def ins_own( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - include_current_quarter: typing_extensions.Annotated[ - Union[bool, None], - OpenBBCustomParameter(description="Include current quarter data."), - ] = False, - date: typing_extensions.Annotated[ - Union[datetime.date, None], - OpenBBCustomParameter(description="A specific date to get data for."), - ] = None, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Institutional Ownership. Institutional ownership data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - include_current_quarter : Union[bool, None] - Include current quarter data. - date : Union[datetime.date, None] - A specific date to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[InstitutionalOwnership]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - InstitutionalOwnership - ---------------------- - symbol : str - Symbol representing the entity requested in the data. - cik : Optional[Union[str]] - CIK of the company. - date : date - The date of the data. - investors_holding : int - Number of investors holding the stock. - last_investors_holding : int - Number of investors holding the stock in the last quarter. - investors_holding_change : int - Change in the number of investors holding the stock. - number_of_13f_shares : Optional[int] - Number of 13F shares. - last_number_of_13f_shares : Optional[int] - Number of 13F shares in the last quarter. - number_of_13f_shares_change : Optional[int] - Change in the number of 13F shares. - total_invested : float - Total amount invested. - last_total_invested : float - Total amount invested in the last quarter. - total_invested_change : float - Change in the total amount invested. - ownership_percent : float - Ownership percent. - last_ownership_percent : float - Ownership percent in the last quarter. - ownership_percent_change : float - Change in the ownership percent. - new_positions : int - Number of new positions. - last_new_positions : int - Number of new positions in the last quarter. - new_positions_change : int - Change in the number of new positions. - increased_positions : int - Number of increased positions. - last_increased_positions : int - Number of increased positions in the last quarter. - increased_positions_change : int - Change in the number of increased positions. - closed_positions : int - Number of closed positions. - last_closed_positions : int - Number of closed positions in the last quarter. - closed_positions_change : int - Change in the number of closed positions. - reduced_positions : int - Number of reduced positions. - last_reduced_positions : int - Number of reduced positions in the last quarter. - reduced_positions_change : int - Change in the number of reduced positions. - total_calls : int - Total number of call options contracts traded for Apple Inc. on the specified date. - last_total_calls : int - Total number of call options contracts traded for Apple Inc. on the previous reporting date. - total_calls_change : int - Change in the total number of call options contracts traded between the current and previous reporting dates. - total_puts : int - Total number of put options contracts traded for Apple Inc. on the specified date. - last_total_puts : int - Total number of put options contracts traded for Apple Inc. on the previous reporting date. - total_puts_change : int - Change in the total number of put options contracts traded between the current and previous reporting dates. - put_call_ratio : float - Put-call ratio, which is the ratio of the total number of put options to call options traded on the specified date. - last_put_call_ratio : float - Put-call ratio on the previous reporting date. - put_call_ratio_change : float - Change in the put-call ratio between the current and previous reporting dates. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.ins_own(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "include_current_quarter": include_current_quarter, - "date": date, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/ins_own", - **inputs, - ) - - @validate - def metrics( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Union[Literal["annual", "quarter"], None], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 100, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Key Metrics. Key metrics for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Union[Literal['annual', 'quarter'], None] - Time period of the data to return. - limit : Union[int, None] - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - with_ttm : Optional[Union[bool]] - Include trailing twelve months (TTM) data. (provider: fmp) - - Returns - ------- - OBBject - results : Union[List[KeyMetrics]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - KeyMetrics - ---------- - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. - date : date - The date of the data. - period : str - Period of the data. - revenue_per_share : Optional[Union[float]] - Revenue per share - net_income_per_share : Optional[Union[float]] - Net income per share - operating_cash_flow_per_share : Optional[Union[float]] - Operating cash flow per share - free_cash_flow_per_share : Optional[Union[float]] - Free cash flow per share - cash_per_share : Optional[Union[float]] - Cash per share - book_value_per_share : Optional[Union[float]] - Book value per share - tangible_book_value_per_share : Optional[Union[float]] - Tangible book value per share - shareholders_equity_per_share : Optional[Union[float]] - Shareholders equity per share - interest_debt_per_share : Optional[Union[float]] - Interest debt per share - market_cap : Optional[Union[float]] - Market capitalization - enterprise_value : Optional[Union[float]] - Enterprise value - pe_ratio : Optional[Union[float]] - Price-to-earnings ratio (P/E ratio) - price_to_sales_ratio : Optional[Union[float]] - Price-to-sales ratio - pocf_ratio : Optional[Union[float]] - Price-to-operating cash flow ratio - pfcf_ratio : Optional[Union[float]] - Price-to-free cash flow ratio - pb_ratio : Optional[Union[float]] - Price-to-book ratio - ptb_ratio : Optional[Union[float]] - Price-to-tangible book ratio - ev_to_sales : Optional[Union[float]] - Enterprise value-to-sales ratio - enterprise_value_over_ebitda : Optional[Union[float]] - Enterprise value-to-EBITDA ratio - ev_to_operating_cash_flow : Optional[Union[float]] - Enterprise value-to-operating cash flow ratio - ev_to_free_cash_flow : Optional[Union[float]] - Enterprise value-to-free cash flow ratio - earnings_yield : Optional[Union[float]] - Earnings yield - free_cash_flow_yield : Optional[Union[float]] - Free cash flow yield - debt_to_equity : Optional[Union[float]] - Debt-to-equity ratio - debt_to_assets : Optional[Union[float]] - Debt-to-assets ratio - net_debt_to_ebitda : Optional[Union[float]] - Net debt-to-EBITDA ratio - current_ratio : Optional[Union[float]] - Current ratio - interest_coverage : Optional[Union[float]] - Interest coverage - income_quality : Optional[Union[float]] - Income quality - dividend_yield : Optional[Union[float]] - Dividend yield - payout_ratio : Optional[Union[float]] - Payout ratio - sales_general_and_administrative_to_revenue : Optional[Union[float]] - Sales general and administrative expenses-to-revenue ratio - research_and_development_to_revenue : Optional[Union[float]] - Research and development expenses-to-revenue ratio - intangibles_to_total_assets : Optional[Union[float]] - Intangibles-to-total assets ratio - capex_to_operating_cash_flow : Optional[Union[float]] - Capital expenditures-to-operating cash flow ratio - capex_to_revenue : Optional[Union[float]] - Capital expenditures-to-revenue ratio - capex_to_depreciation : Optional[Union[float]] - Capital expenditures-to-depreciation ratio - stock_based_compensation_to_revenue : Optional[Union[float]] - Stock-based compensation-to-revenue ratio - graham_number : Optional[Union[float]] - Graham number - roic : Optional[Union[float]] - Return on invested capital - return_on_tangible_assets : Optional[Union[float]] - Return on tangible assets - graham_net_net : Optional[Union[float]] - Graham net-net working capital - working_capital : Optional[Union[float]] - Working capital - tangible_asset_value : Optional[Union[float]] - Tangible asset value - net_current_asset_value : Optional[Union[float]] - Net current asset value - invested_capital : Optional[Union[float]] - Invested capital - average_receivables : Optional[Union[float]] - Average receivables - average_payables : Optional[Union[float]] - Average payables - average_inventory : Optional[Union[float]] - Average inventory - days_sales_outstanding : Optional[Union[float]] - Days sales outstanding - days_payables_outstanding : Optional[Union[float]] - Days payables outstanding - days_of_inventory_on_hand : Optional[Union[float]] - Days of inventory on hand - receivables_turnover : Optional[Union[float]] - Receivables turnover - payables_turnover : Optional[Union[float]] - Payables turnover - inventory_turnover : Optional[Union[float]] - Inventory turnover - roe : Optional[Union[float]] - Return on equity - capex_per_share : Optional[Union[float]] - Capital expenditures per share - calendar_year : Optional[int] - Calendar year. (provider: fmp) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.metrics(symbol="AAPL", period="annual", limit=100) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/metrics", - **inputs, - ) - - @validate - def mgmt( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Key Executives. Key executives for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[KeyExecutives]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - KeyExecutives - ------------- - title : str - Designation of the key executive. - name : str - Name of the key executive. - pay : Optional[int] - Pay of the key executive. - currency_pay : str - Currency of the pay. - gender : Optional[Union[str]] - Gender of the key executive. - year_born : Optional[int] - Birth year of the key executive. - title_since : Optional[int] - Date the tile was held since. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.mgmt(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/mgmt", - **inputs, - ) - - @validate - def overview( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[Data]: - """Company Overview. General information about a company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[CompanyOverview] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - CompanyOverview - --------------- - symbol : str - Symbol representing the entity requested in the data. - price : Optional[Union[float]] - Price of the company. - beta : Optional[Union[float]] - Beta of the company. - vol_avg : Optional[int] - Volume average of the company. - mkt_cap : Optional[int] - Market capitalization of the company. - last_div : Optional[Union[float]] - Last dividend of the company. - range : Optional[Union[str]] - Range of the company. - changes : Optional[Union[float]] - Changes of the company. - company_name : Optional[Union[str]] - Company name of the company. - currency : Optional[Union[str]] - Currency of the company. - cik : Optional[Union[str]] - CIK of the company. - isin : Optional[Union[str]] - ISIN of the company. - cusip : Optional[Union[str]] - CUSIP of the company. - exchange : Optional[Union[str]] - Exchange of the company. - exchange_short_name : Optional[Union[str]] - Exchange short name of the company. - industry : Optional[Union[str]] - Industry of the company. - website : Optional[Union[str]] - Website of the company. - description : Optional[Union[str]] - Description of the company. - ceo : Optional[Union[str]] - CEO of the company. - sector : Optional[Union[str]] - Sector of the company. - country : Optional[Union[str]] - Country of the company. - full_time_employees : Optional[Union[str]] - Full time employees of the company. - phone : Optional[Union[str]] - Phone of the company. - address : Optional[Union[str]] - Address of the company. - city : Optional[Union[str]] - City of the company. - state : Optional[Union[str]] - State of the company. - zip : Optional[Union[str]] - Zip of the company. - dcf_diff : Optional[Union[float]] - Discounted cash flow difference of the company. - dcf : Optional[Union[float]] - Discounted cash flow of the company. - image : Optional[Union[str]] - Image of the company. - ipo_date : Optional[Union[date]] - IPO date of the company. - default_image : bool - If the image is the default image. - is_etf : bool - If the company is an ETF. - is_actively_trading : bool - If the company is actively trading. - is_adr : bool - If the company is an ADR. - is_fund : bool - If the company is a fund. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.overview(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/overview", - **inputs, - ) - - @validate - def own( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - date: typing_extensions.Annotated[ - Union[datetime.date, None], - OpenBBCustomParameter(description="A specific date to get data for."), - ] = None, - page: typing_extensions.Annotated[ - Union[int, None], - OpenBBCustomParameter(description="Page number of the data to fetch."), - ] = 0, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Stock Ownership. Information about the company ownership. - - Parameters - ---------- - symbol : str - Symbol to get data for. - date : Union[datetime.date, None] - A specific date to get data for. - page : Union[int, None] - Page number of the data to fetch. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[StockOwnership]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - StockOwnership - -------------- - date : date - The date of the data. - cik : int - Cik of the stock ownership. - filing_date : date - Filing date of the stock ownership. - investor_name : str - Investor name of the stock ownership. - symbol : str - Symbol representing the entity requested in the data. - security_name : str - Security name of the stock ownership. - type_of_security : str - Type of security of the stock ownership. - security_cusip : str - Security cusip of the stock ownership. - shares_type : str - Shares type of the stock ownership. - put_call_share : str - Put call share of the stock ownership. - investment_discretion : str - Investment discretion of the stock ownership. - industry_title : str - Industry title of the stock ownership. - weight : float - Weight of the stock ownership. - last_weight : float - Last weight of the stock ownership. - change_in_weight : float - Change in weight of the stock ownership. - change_in_weight_percentage : float - Change in weight percentage of the stock ownership. - market_value : int - Market value of the stock ownership. - last_market_value : int - Last market value of the stock ownership. - change_in_market_value : int - Change in market value of the stock ownership. - change_in_market_value_percentage : float - Change in market value percentage of the stock ownership. - shares_number : int - Shares number of the stock ownership. - last_shares_number : int - Last shares number of the stock ownership. - change_in_shares_number : float - Change in shares number of the stock ownership. - change_in_shares_number_percentage : float - Change in shares number percentage of the stock ownership. - quarter_end_price : float - Quarter end price of the stock ownership. - avg_price_paid : float - Average price paid of the stock ownership. - is_new : bool - Is the stock ownership new. - is_sold_out : bool - Is the stock ownership sold out. - ownership : float - How much is the ownership. - last_ownership : float - Last ownership amount. - change_in_ownership : float - Change in ownership amount. - change_in_ownership_percentage : float - Change in ownership percentage. - holding_period : int - Holding period of the stock ownership. - first_added : date - First added date of the stock ownership. - performance : float - Performance of the stock ownership. - performance_percentage : float - Performance percentage of the stock ownership. - last_performance : float - Last performance of the stock ownership. - change_in_performance : float - Change in performance of the stock ownership. - is_counted_for_performance : bool - Is the stock ownership counted for performance. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.own(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "date": date, - "page": page, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/own", - **inputs, - ) - - @validate - def pt( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[Data]: - """Price Target Consensus. Price target consensus data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[PriceTargetConsensus] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - PriceTargetConsensus - -------------------- - symbol : str - Symbol representing the entity requested in the data. - target_high : Optional[Union[float]] - High target of the price target consensus. - target_low : Optional[Union[float]] - Low target of the price target consensus. - target_consensus : Optional[Union[float]] - Consensus target of the price target consensus. - target_median : Optional[Union[float]] - Median target of the price target consensus. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.pt(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/pt", - **inputs, - ) - - @validate - def pta( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Price Target. Price target data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - with_grade : bool - Include upgrades and downgrades in the response. (provider: fmp) - - Returns - ------- - OBBject - results : Union[List[PriceTarget]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - PriceTarget - ----------- - symbol : str - Symbol representing the entity requested in the data. - published_date : datetime - Published date of the price target. - news_url : Optional[Union[str]] - News URL of the price target. - news_title : Optional[Union[str]] - News title of the price target. - analyst_name : Optional[Union[str]] - Analyst name. - analyst_company : Optional[Union[str]] - Analyst company. - price_target : Optional[Union[float]] - Price target. - adj_price_target : Optional[Union[float]] - Adjusted price target. - price_when_posted : Optional[Union[float]] - Price when posted. - news_publisher : Optional[Union[str]] - News publisher of the price target. - news_base_url : Optional[Union[str]] - News base URL of the price target. - new_grade : Optional[Union[str]] - New grade (provider: fmp) - previous_grade : Optional[Union[str]] - Previous grade (provider: fmp) - grading_company : Optional[Union[str]] - Grading company (provider: fmp) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.pta(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/pta", - **inputs, - ) - - @validate - def ratios( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Literal["annual", "quarter"], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - limit: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="The number of data entries to return."), - ] = 12, - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Extensive set of ratios over time. Financial ratios for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Literal['annual', 'quarter'] - Time period of the data to return. - limit : int - The number of data entries to return. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - with_ttm : Optional[Union[bool]] - Include trailing twelve months (TTM) data. (provider: fmp) - - Returns - ------- - OBBject - results : Union[List[FinancialRatios]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - FinancialRatios - --------------- - symbol : str - Symbol representing the entity requested in the data. - date : str - The date of the data. - period : str - Period of the financial ratios. - current_ratio : Optional[Union[float]] - Current ratio. - quick_ratio : Optional[Union[float]] - Quick ratio. - cash_ratio : Optional[Union[float]] - Cash ratio. - days_of_sales_outstanding : Optional[Union[float]] - Days of sales outstanding. - days_of_inventory_outstanding : Optional[Union[float]] - Days of inventory outstanding. - operating_cycle : Optional[Union[float]] - Operating cycle. - days_of_payables_outstanding : Optional[Union[float]] - Days of payables outstanding. - cash_conversion_cycle : Optional[Union[float]] - Cash conversion cycle. - gross_profit_margin : Optional[Union[float]] - Gross profit margin. - operating_profit_margin : Optional[Union[float]] - Operating profit margin. - pretax_profit_margin : Optional[Union[float]] - Pretax profit margin. - net_profit_margin : Optional[Union[float]] - Net profit margin. - effective_tax_rate : Optional[Union[float]] - Effective tax rate. - return_on_assets : Optional[Union[float]] - Return on assets. - return_on_equity : Optional[Union[float]] - Return on equity. - return_on_capital_employed : Optional[Union[float]] - Return on capital employed. - net_income_per_ebt : Optional[Union[float]] - Net income per EBT. - ebt_per_ebit : Optional[Union[float]] - EBT per EBIT. - ebit_per_revenue : Optional[Union[float]] - EBIT per revenue. - debt_ratio : Optional[Union[float]] - Debt ratio. - debt_equity_ratio : Optional[Union[float]] - Debt equity ratio. - long_term_debt_to_capitalization : Optional[Union[float]] - Long term debt to capitalization. - total_debt_to_capitalization : Optional[Union[float]] - Total debt to capitalization. - interest_coverage : Optional[Union[float]] - Interest coverage. - cash_flow_to_debt_ratio : Optional[Union[float]] - Cash flow to debt ratio. - company_equity_multiplier : Optional[Union[float]] - Company equity multiplier. - receivables_turnover : Optional[Union[float]] - Receivables turnover. - payables_turnover : Optional[Union[float]] - Payables turnover. - inventory_turnover : Optional[Union[float]] - Inventory turnover. - fixed_asset_turnover : Optional[Union[float]] - Fixed asset turnover. - asset_turnover : Optional[Union[float]] - Asset turnover. - operating_cash_flow_per_share : Optional[Union[float]] - Operating cash flow per share. - free_cash_flow_per_share : Optional[Union[float]] - Free cash flow per share. - cash_per_share : Optional[Union[float]] - Cash per share. - payout_ratio : Optional[Union[float]] - Payout ratio. - operating_cash_flow_sales_ratio : Optional[Union[float]] - Operating cash flow sales ratio. - free_cash_flow_operating_cash_flow_ratio : Optional[Union[float]] - Free cash flow operating cash flow ratio. - cash_flow_coverage_ratios : Optional[Union[float]] - Cash flow coverage ratios. - short_term_coverage_ratios : Optional[Union[float]] - Short term coverage ratios. - capital_expenditure_coverage_ratio : Optional[Union[float]] - Capital expenditure coverage ratio. - dividend_paid_and_capex_coverage_ratio : Optional[Union[float]] - Dividend paid and capex coverage ratio. - dividend_payout_ratio : Optional[Union[float]] - Dividend payout ratio. - price_book_value_ratio : Optional[Union[float]] - Price book value ratio. - price_to_book_ratio : Optional[Union[float]] - Price to book ratio. - price_to_sales_ratio : Optional[Union[float]] - Price to sales ratio. - price_earnings_ratio : Optional[Union[float]] - Price earnings ratio. - price_to_free_cash_flows_ratio : Optional[Union[float]] - Price to free cash flows ratio. - price_to_operating_cash_flows_ratio : Optional[Union[float]] - Price to operating cash flows ratio. - price_cash_flow_ratio : Optional[Union[float]] - Price cash flow ratio. - price_earnings_to_growth_ratio : Optional[Union[float]] - Price earnings to growth ratio. - price_sales_ratio : Optional[Union[float]] - Price sales ratio. - dividend_yield : Optional[Union[float]] - Dividend yield. - enterprise_value_multiple : Optional[Union[float]] - Enterprise value multiple. - price_fair_value : Optional[Union[float]] - Price fair value. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.ratios(symbol="AAPL", period="annual", limit=12) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "limit": limit, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/ratios", - **inputs, - ) - - @validate - def revgeo( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - structure: typing_extensions.Annotated[ - Literal["hierarchical", "flat"], - OpenBBCustomParameter(description="Structure of the returned data."), - ] = "flat", - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Revenue Geographic. Geographic revenue data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Literal['quarter', 'annual'] - Time period of the data to return. - structure : Literal['hierarchical', 'flat'] - Structure of the returned data. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[RevenueGeographic]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - RevenueGeographic - ----------------- - date : date - The date of the data. - geographic_segment : Dict[str, int] - Day level data containing the revenue of the geographic segment. - americas : Optional[int] - Revenue from the the American segment. - europe : Optional[int] - Revenue from the the European segment. - greater_china : Optional[int] - Revenue from the the Greater China segment. - japan : Optional[int] - Revenue from the the Japan segment. - rest_of_asia_pacific : Optional[int] - Revenue from the the Rest of Asia Pacific segment. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.revgeo(symbol="AAPL", period="annual", structure="flat") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "structure": structure, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/revgeo", - **inputs, - ) - - @validate - def revseg( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - period: typing_extensions.Annotated[ - Literal["quarter", "annual"], - OpenBBCustomParameter(description="Time period of the data to return."), - ] = "annual", - structure: typing_extensions.Annotated[ - Literal["hierarchical", "flat"], - OpenBBCustomParameter(description="Structure of the returned data."), - ] = "flat", - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Revenue Business Line. Business line revenue data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - period : Literal['quarter', 'annual'] - Time period of the data to return. - structure : Literal['hierarchical', 'flat'] - Structure of the returned data. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[RevenueBusinessLine]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - RevenueBusinessLine - ------------------- - date : date - The date of the data. - business_line : Dict[str, int] - Day level data containing the revenue of the business line. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.revseg(symbol="AAPL", period="annual", structure="flat") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "period": period, - "structure": structure, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/revseg", - **inputs, - ) - - @validate - def shrs( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Share Statistics. Share statistics for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[ShareStatistics]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - ShareStatistics - --------------- - symbol : str - Symbol representing the entity requested in the data. - date : Optional[Union[date]] - The date of the data. - free_float : Optional[Union[float]] - Percentage of unrestricted shares of a publicly-traded company. - float_shares : Optional[Union[float]] - Number of shares available for trading by the general public. - outstanding_shares : Optional[Union[float]] - Total number of shares of a publicly-traded company. - source : Optional[Union[str]] - Source of the received data. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.shrs(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/shrs", - **inputs, - ) - - @validate - def split( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Historical Stock Splits. Historical stock splits data. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[HistoricalStockSplits]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - HistoricalStockSplits - --------------------- - date : date - The date of the data. - label : str - Label of the historical stock splits. - numerator : float - Numerator of the historical stock splits. - denominator : float - Denominator of the historical stock splits. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.split(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/split", - **inputs, - ) - - @validate - def transcript( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - year: typing_extensions.Annotated[ - int, - OpenBBCustomParameter(description="Year of the earnings call transcript."), - ], - provider: Union[Literal["fmp"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Earnings Call Transcript. Earnings call transcript for a given company. - - Parameters - ---------- - symbol : str - Symbol to get data for. - year : int - Year of the earnings call transcript. - provider : Union[Literal['fmp'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'fmp' if there is - no default. - - Returns - ------- - OBBject - results : Union[List[EarningsCallTranscript]] - Serializable results. - provider : Union[Literal['fmp'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - EarningsCallTranscript - ---------------------- - symbol : str - Symbol representing the entity requested in the data. - quarter : int - Quarter of the earnings call transcript. - year : int - Year of the earnings call transcript. - date : datetime - The date of the data. - content : str - Content of the earnings call transcript. - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.fa.transcript(symbol="AAPL", year=1) - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - "year": year, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/fa/transcript", - **inputs, - ) diff --git a/openbb_platform/openbb/package/stocks_options.py b/openbb_platform/openbb/package/stocks_options.py deleted file mode 100644 index 8cfa464b5011..000000000000 --- a/openbb_platform/openbb/package/stocks_options.py +++ /dev/null @@ -1,241 +0,0 @@ -### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - -from typing import List, Literal, Union - -import typing_extensions -from openbb_core.app.model.custom_parameter import OpenBBCustomParameter -from openbb_core.app.model.obbject import OBBject -from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate -from openbb_core.app.static.filters import filter_inputs -from openbb_provider.abstract.data import Data - - -class ROUTER_stocks_options(Container): - """/stocks/options - chains - unusual - """ - - def __repr__(self) -> str: - return self.__doc__ or "" - - @validate - def chains( - self, - symbol: typing_extensions.Annotated[ - Union[str, List[str]], - OpenBBCustomParameter(description="Symbol to get data for."), - ], - provider: Union[Literal["cboe", "intrinio"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Get the complete options chain for a ticker. - - Parameters - ---------- - symbol : str - Symbol to get data for. - provider : Union[Literal['cboe', 'intrinio'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'cboe' if there is - no default. - date : Optional[Union[datetime.date]] - Date for which the options chains are returned. (provider: intrinio) - - Returns - ------- - OBBject - results : Union[List[OptionsChains]] - Serializable results. - provider : Union[Literal['cboe', 'intrinio'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - OptionsChains - ------------- - contract_symbol : str - Contract symbol for the option. - symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. Here its the underlying symbol for the option. - expiration : date - Expiration date of the contract. - strike : float - Strike price of the contract. - option_type : str - Call or Put. - eod_date : Optional[Union[date]] - Date for which the options chains are returned. - close : Optional[Union[float]] - The close price of the symbol. - close_bid : Optional[Union[float]] - The closing bid price for the option that day. - close_ask : Optional[Union[float]] - The closing ask price for the option that day. - volume : Optional[Union[float]] - The volume of the symbol. - open : Optional[Union[float]] - The open price of the symbol. - open_bid : Optional[Union[float]] - The opening bid price for the option that day. - open_ask : Optional[Union[float]] - The opening ask price for the option that day. - open_interest : Optional[Union[float]] - Open interest on the contract. - high : Optional[Union[float]] - The high price of the symbol. - low : Optional[Union[float]] - The low price of the symbol. - mark : Optional[Union[float]] - The mid-price between the latest bid-ask spread. - ask_high : Optional[Union[float]] - The highest ask price for the option that day. - ask_low : Optional[Union[float]] - The lowest ask price for the option that day. - bid_high : Optional[Union[float]] - The highest bid price for the option that day. - bid_low : Optional[Union[float]] - The lowest bid price for the option that day. - implied_volatility : Optional[Union[float]] - Implied volatility of the option. - delta : Optional[Union[float]] - Delta of the option. - gamma : Optional[Union[float]] - Gamma of the option. - theta : Optional[Union[float]] - Theta of the option. - vega : Optional[Union[float]] - Vega of the option. - bid_size : Optional[Union[int]] - Bid size for the option. (provider: cboe) - ask_size : Optional[Union[int]] - Ask size for the option. (provider: cboe) - theoretical : Optional[Union[float]] - Theoretical value of the option. (provider: cboe) - last_trade_price : Optional[Union[float]] - Last trade price of the option. (provider: cboe) - tick : Optional[Union[str]] - Whether the last tick was up or down in price. (provider: cboe) - prev_close : Optional[Union[float]] - Previous closing price of the option. (provider: cboe) - change : Optional[Union[float]] - Change in price of the option. (provider: cboe) - change_percent : Optional[Union[float]] - Change, in percent, of the option. (provider: cboe) - rho : Optional[Union[float]] - Rho of the option. (provider: cboe) - last_trade_timestamp : Optional[Union[datetime]] - Last trade timestamp of the option. (provider: cboe) - dte : Optional[Union[int]] - Days to expiration for the option. (provider: cboe) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.options.chains(symbol="AAPL") - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/options/chains", - **inputs, - ) - - @validate - def unusual( - self, - symbol: typing_extensions.Annotated[ - Union[str, None, List[str]], - OpenBBCustomParameter( - description="Symbol to get data for. (the underlying symbol)" - ), - ] = None, - provider: Union[Literal["intrinio"], None] = None, - **kwargs - ) -> OBBject[List[Data]]: - """Get the complete options chain for a ticker. - - Parameters - ---------- - symbol : Union[str, None] - Symbol to get data for. (the underlying symbol) - provider : Union[Literal['intrinio'], None] - The provider to use for the query, by default None. - If None, the provider specified in defaults is selected or 'intrinio' if there is - no default. - source : Literal['delayed', 'realtime'] - The source of the data. Either realtime or delayed. (provider: intrinio) - - Returns - ------- - OBBject - results : Union[List[OptionsUnusual]] - Serializable results. - provider : Union[Literal['intrinio'], None] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra: Dict[str, Any] - Extra info. - - OptionsUnusual - -------------- - underlying_symbol : Optional[Union[str]] - Symbol representing the entity requested in the data. (the underlying symbol) - contract_symbol : str - Contract symbol for the option. - trade_type : Optional[Union[str]] - The type of unusual trade. (provider: intrinio) - sentiment : Optional[Union[str]] - Bullish, Bearish, or Neutral Sentiment is estimated based on whether the trade was executed at the bid, ask, or mark price. (provider: intrinio) - total_value : Optional[Union[int, float]] - The aggregated value of all option contract premiums included in the trade. (provider: intrinio) - total_size : Optional[Union[int]] - The total number of contracts involved in a single transaction. (provider: intrinio) - average_price : Optional[Union[float]] - The average premium paid per option contract. (provider: intrinio) - ask_at_execution : Optional[Union[float]] - Ask price at execution. (provider: intrinio) - bid_at_execution : Optional[Union[float]] - Bid price at execution. (provider: intrinio) - underlying_price_at_execution : Optional[Union[float]] - Price of the underlying security at execution of trade. (provider: intrinio) - timestamp : Optional[Union[datetime]] - The UTC timestamp of order placement. (provider: intrinio) - - Example - ------- - >>> from openbb import obb - >>> obb.stocks.options.unusual() - """ # noqa: E501 - - inputs = filter_inputs( - provider_choices={ - "provider": provider, - }, - standard_params={ - "symbol": ",".join(symbol) if isinstance(symbol, list) else symbol, - }, - extra_params=kwargs, - ) - - return self._run( - "/stocks/options/unusual", - **inputs, - ) diff --git a/openbb_platform/platform/core/openbb_core/api/dependency/coverage.py b/openbb_platform/platform/core/openbb_core/api/dependency/coverage.py index 716833fd43da..9470d7c227be 100644 --- a/openbb_platform/platform/core/openbb_core/api/dependency/coverage.py +++ b/openbb_platform/platform/core/openbb_core/api/dependency/coverage.py @@ -1,6 +1,7 @@ """Coverage dependency.""" from fastapi import Depends +from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.router import CommandMap from openbb_core.app.service.auth_service import AuthService from typing_extensions import Annotated @@ -11,3 +12,10 @@ async def get_command_map( ) -> CommandMap: """Get command map.""" return CommandMap() + + +async def get_provider_interface( + _: Annotated[None, Depends(AuthService().auth_hook)] +) -> ProviderInterface: + """Get provider interface.""" + return ProviderInterface() diff --git a/openbb_platform/platform/core/openbb_core/api/router/coverage.py b/openbb_platform/platform/core/openbb_core/api/router/coverage.py index 10e860c23fa8..f826be9b18f7 100644 --- a/openbb_platform/platform/core/openbb_core/api/router/coverage.py +++ b/openbb_platform/platform/core/openbb_core/api/router/coverage.py @@ -1,11 +1,25 @@ +"""Coverage API router.""" from fastapi import APIRouter, Depends -from openbb_core.api.dependency.coverage import get_command_map +from openbb_core.api.dependency.coverage import get_command_map, get_provider_interface +from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.router import CommandMap from typing_extensions import Annotated router = APIRouter(prefix="/coverage", tags=["Coverage"]) +@router.get("/command_model") +async def get_commands_model_map( + command_map: Annotated[CommandMap, Depends(get_command_map)], + provider_interface: Annotated[ProviderInterface, Depends(get_provider_interface)], +): + """Get the command to model mapping.""" + return { + command: provider_interface.map[command_map.commands_model[command][0]] + for command in command_map.commands_model + } + + @router.get("/providers") async def get_provider_coverage( command_map: Annotated[CommandMap, Depends(get_command_map)] diff --git a/openbb_platform/platform/core/openbb_core/app/static/coverage.py b/openbb_platform/platform/core/openbb_core/app/static/coverage.py index d463f4e6a019..20f93d70bb92 100644 --- a/openbb_platform/platform/core/openbb_core/app/static/coverage.py +++ b/openbb_platform/platform/core/openbb_core/app/static/coverage.py @@ -1,16 +1,23 @@ """Coverage module.""" +from openbb_core.app.provider_interface import ProviderInterface from openbb_core.app.router import CommandMap class Coverage: - """/coverage + """/coverage endpoint. + providers - commands""" + commands + command_model + """ def __init__(self): + """Initialize coverage.""" self._command_map = CommandMap(coverage_sep=".") + self._provider_interface = ProviderInterface() def __repr__(self) -> str: + """Return docstring.""" return self.__doc__ or "" @property @@ -22,3 +29,13 @@ def providers(self): def commands(self): """Return commands coverage.""" return self._command_map.command_coverage + + @property + def command_model(self): + """Return command to model mapping.""" + return { + command: self._provider_interface.map[ + self._command_map.commands_model[command] + ] + for command in self._command_map.commands_model # pylint: disable=C0206 + } diff --git a/openbb_platform/platform/core/tests/api/test_router/test_router_coverage.py b/openbb_platform/platform/core/tests/api/test_router/test_router_coverage.py index c85cad3d041f..dc58cded58f5 100644 --- a/openbb_platform/platform/core/tests/api/test_router/test_router_coverage.py +++ b/openbb_platform/platform/core/tests/api/test_router/test_router_coverage.py @@ -27,3 +27,14 @@ def test_get_command_coverage(mock_command_map): response = get_command_coverage(mock_command_map) assert response + + +@patch("openbb_core.api.router.coverage.CommandMap") +@patch("openbb_core.api.router.coverage.ProviderInterface") +def test_get_command_model(mock_provider_interface, mock_command_map): + """Test get command model.""" + mock_command_map.return_value.commands_model = {"command1": "model1"} + mock_provider_interface.return_value.map = {"model1": "provider1"} + + response = get_command_coverage(mock_command_map) + assert response