From 900e58ab272723727968c1f08f8aac35e7b005c2 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Sun, 24 Mar 2024 23:33:30 -0400 Subject: add sales estimates to estimates_router --- .../provider/standard_models/sales_estimates.py | 22 ---------------------- .../openbb_equity/estimates/estimates_router.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/openbb_platform/core/openbb_core/provider/standard_models/sales_estimates.py b/openbb_platform/core/openbb_core/provider/standard_models/sales_estimates.py index 3216421d306..ea4c731d862 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/sales_estimates.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/sales_estimates.py @@ -11,25 +11,6 @@ from openbb_core.provider.utils.descriptions import ( QUERY_DESCRIPTIONS, ) -#from openbb_intrinio.utils.references import IntrinioCompany - -# doing this to avoid recursion lol -class IntrinioCompany(Data): - """Intrinio Company Data.""" - - id: str = Field(description="The Intrinio ID of the Company.") - ticker: Optional[str] = Field( - description="The stock market ticker symbol associated with the company's common stock securities", - default=None, - ) - name: Optional[str] = Field(description="The company's common name.", default=None) - lei: Optional[str] = Field( - description="The Legal Entity Identifier (LEI) of the company.", default=None - ) - cik: Optional[str] = Field( - description="The Central Index Key (CIK) of the company.", - ) - class SalesEstimatesQueryParams(QueryParams): """Sales Estimates Query.""" @@ -78,9 +59,6 @@ class SalesEstimatesQueryParams(QueryParams): class SalesEstimatesData(Data): """Sales Estimates data.""" estimates: List[float] = Field(description="Zacks Sales estimate data for a given date range.") - company: Optional[IntrinioCompany] = Field( - description="The company to get sales estimates data from.", default=None - ) date: Union[date, str] = Field(description="The period end date.") fiscal_year: Optional[int] = Field( default=None, diff --git a/openbb_platform/extensions/equity/openbb_equity/estimates/estimates_router.py b/openbb_platform/extensions/equity/openbb_equity/estimates/estimates_router.py index 07c328c334c..a2964a4f63e 100644 --- a/openbb_platform/extensions/equity/openbb_equity/estimates/estimates_router.py +++ b/openbb_platform/extensions/equity/openbb_equity/estimates/estimates_router.py @@ -91,3 +91,17 @@ async def analyst_search( ) -> OBBject: """Search for specific analysts and get their forecast track record.""" return await OBBject.from_query(Query(**locals())) + + +@router.command( + model="SalesEstimates", + examples=[], +) +async def sales_estimates( + cc: CommandContext, + provider_choices: ProviderChoices, + standard_params: StandardParams, + extra_params: ExtraParams, +) -> OBBject: + """Get sales estimates.""" + return await OBBject.from_query(Query(**locals())) -- cgit v1.2.3