mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 04:52:07 +00:00
* breakdown builder + remove black * rebuild * rebuild * rebuild * rename method * format built code without black * we still lint if it's available * fix existing tests * add linter tests * add black to dev deps * auto_build as instance method * reorder methods * typing --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
79 lines
2.3 KiB
Python
79 lines
2.3 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.utils.decorators import validate
|
|
from openbb_core.app.static.utils.filters import filter_inputs
|
|
from typing_extensions import Annotated
|
|
|
|
|
|
class ROUTER_equity_compare(Container):
|
|
"""/equity/compare
|
|
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:
|
|
"""Equity Peers. 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 : EquityPeers
|
|
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.
|
|
|
|
EquityPeers
|
|
-----------
|
|
peers_list : List[str]
|
|
A list of equity peers based on sector, exchange and market cap.
|
|
|
|
Example
|
|
-------
|
|
>>> from openbb import obb
|
|
>>> obb.equity.compare.peers(symbol="AAPL")
|
|
""" # noqa: E501
|
|
|
|
return self._run(
|
|
"/equity/compare/peers",
|
|
**filter_inputs(
|
|
provider_choices={
|
|
"provider": provider,
|
|
},
|
|
standard_params={
|
|
"symbol": ",".join(symbol) if isinstance(symbol, list) else symbol,
|
|
},
|
|
extra_params=kwargs,
|
|
)
|
|
)
|