-
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] Government Yield Curves + Chart (#6417)
* stashing * ecb yield curve * field_description * federal reserve yield curve * econdb yield curve * countries literal for python 3.9 * list date * fmp yield curve * fred yield curve * integration tests * chart integration tests * static assets * black * ruff * pylint * more pylint * more pylint * now black * country not a standard param * mypy * merge branch develop * add more countries * econdb date filter * mypy * future linting * make to_chart work * plot_bgcolor should be 'rbga(255,255,255,0)' * push deprecation * push deprecation --------- Co-authored-by: Igor Radovanovic <[email protected]> Co-authored-by: hjoaquim <[email protected]>
- Loading branch information
1 parent
63b8d60
commit 8baf4d7
Showing
36 changed files
with
139,102 additions
and
183 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
openbb_platform/core/openbb_core/provider/standard_models/yield_curve.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,37 @@ | ||
"""Yield Curve Standard Model.""" | ||
|
||
from datetime import date as dateType | ||
from typing import Optional | ||
|
||
from pydantic import Field | ||
|
||
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 YieldCurveQueryParams(QueryParams): | ||
"""Yield Curve Query.""" | ||
|
||
date: Optional[str] = Field( | ||
default=None, | ||
description=QUERY_DESCRIPTIONS.get("date", "") | ||
+ " By default is the current data.", | ||
) | ||
|
||
|
||
class YieldCurveData(Data): | ||
"""Yield Curve Data.""" | ||
|
||
date: Optional[dateType] = Field( | ||
default=None, | ||
description=DATA_DESCRIPTIONS.get("date", ""), | ||
) | ||
maturity: str = Field(description="Maturity length of the security.") | ||
rate: float = Field( | ||
description="The yield as a normalized percent (0.05 is 5%)", | ||
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100}, | ||
) |
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
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.