mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
78 lines
2.2 KiB
Python
78 lines
2.2 KiB
Python
### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ###
|
|
|
|
from typing import List, Literal, Optional, Union
|
|
|
|
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 as _validate
|
|
from openbb_core.app.static.filters import filter_inputs
|
|
from openbb_provider.abstract.data import Data
|
|
from typing_extensions import Annotated
|
|
|
|
|
|
class ROUTER_stocks_ca(Container):
|
|
"""/stocks/ca
|
|
peers
|
|
"""
|
|
|
|
def __repr__(self) -> str:
|
|
return self.__doc__ or ""
|
|
|
|
@_validate
|
|
def peers(
|
|
self,
|
|
symbol: Annotated[
|
|
Union[str, List[str]],
|
|
OpenBBCustomParameter(description="Symbol to get data for."),
|
|
],
|
|
provider: Optional[Literal["fmp"]] = None,
|
|
**kwargs
|
|
) -> OBBject[Data]:
|
|
"""Company peers.
|
|
|
|
Parameters
|
|
----------
|
|
symbol : str
|
|
Symbol to get data for.
|
|
provider : Optional[Literal['fmp']]
|
|
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 : StockPeers
|
|
Serializable results.
|
|
provider : Optional[Literal['fmp']]
|
|
Provider name.
|
|
warnings : Optional[List[Warning_]]
|
|
List of warnings.
|
|
chart : Optional[Chart]
|
|
Chart object.
|
|
extra: Dict[str, Any]
|
|
Extra info.
|
|
|
|
StockPeers
|
|
----------
|
|
symbol : str
|
|
Symbol representing the entity requested in the data.
|
|
peers_list : List[str]
|
|
A list of stock peers based on sector, exchange and market cap.""" # 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,
|
|
)
|