mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
deprecate functions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "openbb-fixedincome"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Fixed income extension for OpenBB"
|
||||
authors = ["OpenBB Team <hello@openbb.co>"]
|
||||
license = "AGPL-3.0-only"
|
||||
|
||||
82
openbb_platform/openbb/assets/reference.json
vendored
82
openbb_platform/openbb/assets/reference.json
vendored
@@ -13,7 +13,7 @@
|
||||
"economy@1.4.0",
|
||||
"equity@1.4.0",
|
||||
"etf@1.4.0",
|
||||
"fixedincome@1.4.0",
|
||||
"fixedincome@1.4.1",
|
||||
"index@1.4.0",
|
||||
"news@1.4.0",
|
||||
"regulators@1.4.0"
|
||||
@@ -38325,86 +38325,6 @@
|
||||
},
|
||||
"model": "YieldCurve"
|
||||
},
|
||||
"/fixedincome/government/us_yield_curve": {
|
||||
"deprecated": {
|
||||
"flag": true,
|
||||
"message": "This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4."
|
||||
},
|
||||
"description": "US Yield Curve. Get United States yield curve.",
|
||||
"examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.government.us_yield_curve(provider='fred')\nobb.fixedincome.government.us_yield_curve(inflation_adjusted=True, provider='fred')\n```\n\n",
|
||||
"parameters": {
|
||||
"standard": [
|
||||
{
|
||||
"name": "date",
|
||||
"type": "Union[date, str]",
|
||||
"description": "A specific date to get data for. Defaults to the most recent FRED entry.",
|
||||
"default": null,
|
||||
"optional": true,
|
||||
"choices": null
|
||||
},
|
||||
{
|
||||
"name": "inflation_adjusted",
|
||||
"type": "bool",
|
||||
"description": "Get inflation adjusted rates.",
|
||||
"default": false,
|
||||
"optional": true,
|
||||
"choices": null
|
||||
}
|
||||
],
|
||||
"fred": []
|
||||
},
|
||||
"returns": {
|
||||
"OBBject": [
|
||||
{
|
||||
"name": "results",
|
||||
"type": "List[USYieldCurve]",
|
||||
"description": "Serializable results."
|
||||
},
|
||||
{
|
||||
"name": "provider",
|
||||
"type": "Optional[Literal['fred']]",
|
||||
"description": "Provider name."
|
||||
},
|
||||
{
|
||||
"name": "warnings",
|
||||
"type": "Optional[List[Warning_]]",
|
||||
"description": "List of warnings."
|
||||
},
|
||||
{
|
||||
"name": "chart",
|
||||
"type": "Optional[Chart]",
|
||||
"description": "Chart object."
|
||||
},
|
||||
{
|
||||
"name": "extra",
|
||||
"type": "Dict[str, Any]",
|
||||
"description": "Extra info."
|
||||
}
|
||||
]
|
||||
},
|
||||
"data": {
|
||||
"standard": [
|
||||
{
|
||||
"name": "maturity",
|
||||
"type": "float",
|
||||
"description": "Maturity of the treasury rate in years.",
|
||||
"default": "",
|
||||
"optional": false,
|
||||
"choices": null
|
||||
},
|
||||
{
|
||||
"name": "rate",
|
||||
"type": "float",
|
||||
"description": "Associated rate given in decimal form (0.05 is 5%)",
|
||||
"default": "",
|
||||
"optional": false,
|
||||
"choices": null
|
||||
}
|
||||
],
|
||||
"fred": []
|
||||
},
|
||||
"model": "USYieldCurve"
|
||||
},
|
||||
"/fixedincome/government/treasury_rates": {
|
||||
"deprecated": {
|
||||
"flag": null,
|
||||
|
||||
@@ -28,7 +28,7 @@ Extensions:
|
||||
- economy@1.4.0
|
||||
- equity@1.4.0
|
||||
- etf@1.4.0
|
||||
- fixedincome@1.4.0
|
||||
- fixedincome@1.4.1
|
||||
- index@1.4.0
|
||||
- news@1.4.0
|
||||
- regulators@1.4.0
|
||||
|
||||
@@ -2,22 +2,19 @@
|
||||
|
||||
import datetime
|
||||
from typing import List, Literal, Optional, Union
|
||||
from warnings import simplefilter, warn
|
||||
|
||||
from openbb_core.app.deprecation import OpenBBDeprecationWarning
|
||||
from openbb_core.app.model.field import OpenBBField
|
||||
from openbb_core.app.model.obbject import OBBject
|
||||
from openbb_core.app.static.container import Container
|
||||
from openbb_core.app.static.utils.decorators import exception_handler, validate
|
||||
from openbb_core.app.static.utils.filters import filter_inputs
|
||||
from typing_extensions import Annotated, deprecated
|
||||
from typing_extensions import Annotated
|
||||
|
||||
|
||||
class ROUTER_fixedincome_government(Container):
|
||||
"""/fixedincome/government
|
||||
tips_yields
|
||||
treasury_rates
|
||||
us_yield_curve
|
||||
yield_curve
|
||||
"""
|
||||
|
||||
@@ -244,95 +241,6 @@ class ROUTER_fixedincome_government(Container):
|
||||
)
|
||||
)
|
||||
|
||||
@exception_handler
|
||||
@validate
|
||||
@deprecated(
|
||||
"This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4.",
|
||||
category=OpenBBDeprecationWarning,
|
||||
)
|
||||
def us_yield_curve(
|
||||
self,
|
||||
date: Annotated[
|
||||
Union[datetime.date, None, str],
|
||||
OpenBBField(
|
||||
description="A specific date to get data for. Defaults to the most recent FRED entry."
|
||||
),
|
||||
] = None,
|
||||
inflation_adjusted: Annotated[
|
||||
Optional[bool], OpenBBField(description="Get inflation adjusted rates.")
|
||||
] = False,
|
||||
provider: Annotated[
|
||||
Optional[Literal["fred"]],
|
||||
OpenBBField(
|
||||
description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred."
|
||||
),
|
||||
] = None,
|
||||
**kwargs
|
||||
) -> OBBject:
|
||||
"""US Yield Curve. Get United States yield curve.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
date : Union[date, None, str]
|
||||
A specific date to get data for. Defaults to the most recent FRED entry.
|
||||
inflation_adjusted : Optional[bool]
|
||||
Get inflation adjusted rates.
|
||||
provider : Optional[Literal['fred']]
|
||||
The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred.
|
||||
|
||||
Returns
|
||||
-------
|
||||
OBBject
|
||||
results : List[USYieldCurve]
|
||||
Serializable results.
|
||||
provider : Optional[Literal['fred']]
|
||||
Provider name.
|
||||
warnings : Optional[List[Warning_]]
|
||||
List of warnings.
|
||||
chart : Optional[Chart]
|
||||
Chart object.
|
||||
extra : Dict[str, Any]
|
||||
Extra info.
|
||||
|
||||
USYieldCurve
|
||||
------------
|
||||
maturity : float
|
||||
Maturity of the treasury rate in years.
|
||||
rate : float
|
||||
Associated rate given in decimal form (0.05 is 5%)
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> from openbb import obb
|
||||
>>> obb.fixedincome.government.us_yield_curve(provider='fred')
|
||||
>>> obb.fixedincome.government.us_yield_curve(inflation_adjusted=True, provider='fred')
|
||||
""" # noqa: E501
|
||||
|
||||
simplefilter("always", DeprecationWarning)
|
||||
warn(
|
||||
"This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4.",
|
||||
category=DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
return self._run(
|
||||
"/fixedincome/government/us_yield_curve",
|
||||
**filter_inputs(
|
||||
provider_choices={
|
||||
"provider": self._get_provider(
|
||||
provider,
|
||||
"fixedincome.government.us_yield_curve",
|
||||
("fred",),
|
||||
)
|
||||
},
|
||||
standard_params={
|
||||
"date": date,
|
||||
"inflation_adjusted": inflation_adjusted,
|
||||
},
|
||||
extra_params=kwargs,
|
||||
)
|
||||
)
|
||||
|
||||
@exception_handler
|
||||
@validate
|
||||
def yield_curve(
|
||||
|
||||
8
openbb_platform/poetry.lock
generated
vendored
8
openbb_platform/poetry.lock
generated
vendored
@@ -2141,15 +2141,15 @@ openbb-core = ">=1.4.0,<2.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "openbb-fixedincome"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
description = "Fixed income extension for OpenBB"
|
||||
optional = false
|
||||
python-versions = "<4.0,>=3.9"
|
||||
groups = ["main"]
|
||||
markers = "python_version <= \"3.11\" or python_version >= \"3.12\""
|
||||
files = [
|
||||
{file = "openbb_fixedincome-1.4.0-py3-none-any.whl", hash = "sha256:bd9683ac6d66b4a9cd3b0923e96175752ef7925e69ccfd4e6f4e715fad01b52f"},
|
||||
{file = "openbb_fixedincome-1.4.0.tar.gz", hash = "sha256:626d65d9aa288bd4db10e808c24bddd737c3fa36b8c8e8f5462cb8f947d15a86"},
|
||||
{file = "openbb_fixedincome-1.4.1-py3-none-any.whl", hash = "sha256:5c076a04bd77ba7a2e622c319255259fb447b2ce34d08419ebf2c6380e155336"},
|
||||
{file = "openbb_fixedincome-1.4.1.tar.gz", hash = "sha256:7f1825b92bd6fe100363a2c6f5ee47f23d6617db24db28ed182ce08ccd447d37"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
@@ -4494,4 +4494,4 @@ wsj = ["openbb-wsj"]
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = ">=3.9,<3.13"
|
||||
content-hash = "8c97bee090d707e03d4c60fc1cb423091ec4e7c3f31c61bc96cc6201c11ee1c5"
|
||||
content-hash = "839a0dbd464af812510f2ec177aeeb9377d33f04162760139b30bd271a716746"
|
||||
|
||||
2
openbb_platform/pyproject.toml
vendored
2
openbb_platform/pyproject.toml
vendored
@@ -36,7 +36,7 @@ openbb-derivatives = "^1.4.0"
|
||||
openbb-economy = "^1.4.0"
|
||||
openbb-equity = "^1.4.0"
|
||||
openbb-etf = "^1.4.0"
|
||||
openbb-fixedincome = "^1.4.0"
|
||||
openbb-fixedincome = "^1.4.1"
|
||||
openbb-index = "^1.4.0"
|
||||
openbb-news = "^1.4.0"
|
||||
openbb-regulators = "^1.4.0"
|
||||
|
||||
Reference in New Issue
Block a user