-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Add Forward PE Estimates (#6398)
* forward_pe * ruff * merge branch develop * mypy * typo --------- Co-authored-by: Igor Radovanovic <[email protected]> Co-authored-by: montezdesousa <[email protected]>
- Loading branch information
1 parent
17a7e7d
commit 0eee602
Showing
10 changed files
with
586 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
openbb_platform/core/openbb_core/provider/standard_models/forward_pe_estimates.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
"""Forward PE Estimates Standard Model.""" | ||
|
||
from typing import Optional | ||
|
||
from pydantic import Field, field_validator | ||
|
||
from openbb_core.provider.abstract.data import Data | ||
from openbb_core.provider.abstract.query_params import QueryParams | ||
from openbb_core.provider.utils.descriptions import ( | ||
DATA_DESCRIPTIONS, | ||
QUERY_DESCRIPTIONS, | ||
) | ||
|
||
|
||
class ForwardPeEstimatesQueryParams(QueryParams): | ||
"""Forward PE Estimates Query Parameters.""" | ||
|
||
symbol: Optional[str] = Field( | ||
default=None, | ||
description=QUERY_DESCRIPTIONS["symbol"], | ||
) | ||
|
||
@field_validator("symbol", mode="before", check_fields=False) | ||
@classmethod | ||
def to_upper(cls, v): | ||
"""Convert field to uppercase.""" | ||
return v.upper() if v else None | ||
|
||
|
||
class ForwardPeEstimatesData(Data): | ||
"""Forward PE Estimates Data.""" | ||
|
||
symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "")) | ||
name: Optional[str] = Field(default=None, description="Name of the entity.") | ||
year1: Optional[float] = Field( | ||
default=None, | ||
description="Estimated PE ratio for the next fiscal year.", | ||
) | ||
year2: Optional[float] = Field( | ||
default=None, | ||
description="Estimated PE ratio two fiscal years from now.", | ||
) | ||
year3: Optional[float] = Field( | ||
default=None, | ||
description="Estimated PE ratio three fiscal years from now.", | ||
) | ||
year4: Optional[float] = Field( | ||
default=None, | ||
description="Estimated PE ratio four fiscal years from now.", | ||
) | ||
year5: Optional[float] = Field( | ||
default=None, | ||
description="Estimated PE ratio five fiscal years from now.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.