summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormontezdesousa <79287829+montezdesousa@users.noreply.github.com>2024-06-07 12:00:36 +0100
committerGitHub <noreply@github.com>2024-06-07 12:00:36 +0100
commit1ef22dff4c542c1cfc9f0defe6f503fc7a7b93d6 (patch)
tree10b671878ea5132b070363b78d07e3b66ff6209d
parentb19cad7600b791e1b95eb0c3a26b33306a733e1d (diff)
parentaa7bccc4eccc67764ecd3a62f1e7c5f8323cbac0 (diff)
Merge branch 'develop' into feature/ghcr-imagesfeature/ghcr-images
-rw-r--r--cli/openbb_cli/cli.py10
-rw-r--r--cli/openbb_cli/controllers/cli_controller.py12
-rw-r--r--cli/openbb_cli/utils/utils.py34
-rw-r--r--openbb_platform/core/openbb_core/app/model/system_settings.py2
-rw-r--r--openbb_platform/core/openbb_core/provider/standard_models/bond_indices.py52
-rw-r--r--openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py28
-rw-r--r--openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py27
-rw-r--r--openbb_platform/extensions/fixedincome/openbb_fixedincome/corporate/corporate_router.py7
-rw-r--r--openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py37
-rw-r--r--openbb_platform/openbb/assets/reference.json223
-rw-r--r--openbb_platform/openbb/package/fixedincome.py143
-rw-r--r--openbb_platform/openbb/package/fixedincome_corporate.py15
-rw-r--r--openbb_platform/providers/fred/openbb_fred/__init__.py2
-rw-r--r--openbb_platform/providers/fred/openbb_fred/models/bond_indices.py588
-rw-r--r--openbb_platform/providers/fred/tests/record/http/test_fred_fetchers/test_fred_bond_indices_fetcher.yaml168
-rw-r--r--openbb_platform/providers/fred/tests/test_fred_fetchers.py16
16 files changed, 1347 insertions, 17 deletions
diff --git a/cli/openbb_cli/cli.py b/cli/openbb_cli/cli.py
index 1937a05d37b..91c2b4825d8 100644
--- a/cli/openbb_cli/cli.py
+++ b/cli/openbb_cli/cli.py
@@ -2,6 +2,8 @@
import sys
+from openbb_cli.utils.utils import change_logging_sub_app, reset_logging_sub_app
+
def main():
"""Use the main entry point for the OpenBB Platform CLI."""
@@ -20,4 +22,10 @@ def main():
if __name__ == "__main__":
- main()
+ initial_logging_sub_app = change_logging_sub_app()
+ try:
+ main()
+ except Exception as e:
+ pass
+ finally:
+ reset_logging_sub_app(initial_logging_sub_app)
diff --git a/cli/openbb_cli/controllers/cli_controller.py b/cli/openbb_cli/controllers/cli_controller.py
index 31d32499659..807af177ce5 100644
--- a/cli/openbb_cli/controllers/cli_controller.py
+++ b/cli/openbb_cli/controllers/cli_controller.py
@@ -4,7 +4,6 @@
import argparse
import contextlib
import difflib
-import logging
import os
import re
import sys
@@ -60,8 +59,6 @@ DATA_PROCESSING_ROUTERS = ["technical", "quantitative", "econometrics"]
# pylint: disable=too-many-public-methods,import-outside-toplevel, too-many-function-args
# pylint: disable=too-many-branches,no-member,C0302,too-many-return-statements, inconsistent-return-statements
-logger = logging.getLogger(__name__)
-
env_file = str(ENV_FILE_SETTINGS)
session = Session()
@@ -498,11 +495,6 @@ class CLIController(BaseController):
def handle_job_cmds(jobs_cmds: Optional[List[str]]) -> Optional[List[str]]:
"""Handle job commands."""
- # If the path selected does not start from the user root,
- # give relative location from root
- if jobs_cmds is not None and jobs_cmds:
- logger.info("INPUT: %s", "/".join(jobs_cmds))
-
export_path = ""
if jobs_cmds and "export" in jobs_cmds[0]:
commands = jobs_cmds[0].split("/")
@@ -620,10 +612,6 @@ def run_cli(jobs_cmds: Optional[List[str]] = None, test_mode=False):
break
except SystemExit:
- logger.exception(
- "The command '%s' doesn't exist on the / menu.",
- an_input,
- )
session.console.print(
f"[red]The command '{an_input}' doesn't exist on the / menu.[/red]\n",
)
diff --git a/cli/openbb_cli/utils/utils.py b/cli/openbb_cli/utils/utils.py
new file mode 100644
index 00000000000..b38c83a8dab
--- /dev/null
+++ b/cli/openbb_cli/utils/utils.py
@@ -0,0 +1,34 @@
+"""OpenBB Platform CLI utilities."""
+
+import json
+from pathlib import Path
+
+HOME_DIRECTORY = Path.home()
+OPENBB_PLATFORM_DIRECTORY = Path(HOME_DIRECTORY, ".openbb_platform")
+SYSTEM_SETTINGS_PATH = Path(OPENBB_PLATFORM_DIRECTORY, "system_settings.json")
+
+
+def change_logging_sub_app() -> str:
+ """Build OpenBB Platform setting files."""
+ with open(SYSTEM_SETTINGS_PATH) as file:
+ system_settings = json.load(file)
+
+ initial_logging_sub_app = system_settings.get("logging_sub_app", "")
+
+ system_settings["logging_sub_app"] = "cli"
+
+ with open(SYSTEM_SETTINGS_PATH, "w") as file:
+ json.dump(system_settings, file, indent=4)
+
+ return initial_logging_sub_app
+
+
+def reset_logging_sub_app(initial_logging_sub_app: str):
+ """Reset OpenBB Platform setting files."""
+ with open(SYSTEM_SETTINGS_PATH) as file:
+ system_settings = json.load(file)
+
+ system_settings["logging_sub_app"] = initial_logging_sub_app
+
+ with open(SYSTEM_SETTINGS_PATH, "w") as file:
+ json.dump(system_settings, file, indent=4)
diff --git a/openbb_platform/core/openbb_core/app/model/system_settings.py b/openbb_platform/core/openbb_core/app/model/system_settings.py
index c5439fb760d..470e265a9b4 100644
--- a/openbb_platform/core/openbb_core/app/model/system_settings.py
+++ b/openbb_platform/core/openbb_core/app/model/system_settings.py
@@ -42,7 +42,7 @@ class SystemSettings(Tagged):
logging_handlers: List[str] = Field(default_factory=lambda: ["file"])
logging_rolling_clock: bool = False
logging_verbosity: int = 20
- logging_sub_app: Literal["python", "api", "pro"] = "python"
+ logging_sub_app: Literal["python", "api", "pro", "cli"] = "python"
logging_suppress: bool = False
log_collect: bool = True
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/bond_indices.py b/openbb_platform/core/openbb_core/provider/standard_models/bond_indices.py
new file mode 100644
index 00000000000..f778c3bb6c1
--- /dev/null
+++ b/openbb_platform/core/openbb_core/provider/standard_models/bond_indices.py
@@ -0,0 +1,52 @@
+"""Bond Indices Standard Model."""
+
+from datetime import (
+ date as dateType,
+)
+from typing import Literal, 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 BondIndicesQueryParams(QueryParams):
+ """Bond Indices Query."""
+
+ start_date: Optional[dateType] = Field(
+ default=None,
+ description=QUERY_DESCRIPTIONS.get("start_date", ""),
+ )
+ end_date: Optional[dateType] = Field(
+ default=None,
+ description=QUERY_DESCRIPTIONS.get("end_date", ""),
+ )
+ index_type: Literal["yield", "yield_to_worst", "total_return", "oas"] = Field(
+ default="yield",
+ description="The type of series. OAS is the option-adjusted spread. Default is yield.",
+ json_schema_extra={
+ "choices": ["yield", "yield_to_worst", "total_return", "oas"]
+ },
+ )
+
+ @field_validator("index_type", mode="before", check_fields=False)
+ @classmethod
+ def to_lower(cls, v: Optional[str]) -> Optional[str]:
+ """Convert field to lowercase."""
+ return v.lower() if v else v
+
+
+class BondIndicesData(Data):
+ """Bond Indices Data."""
+
+ date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
+ symbol: Optional[str] = Field(
+ default=None,
+ description=DATA_DESCRIPTIONS.get("symbol", ""),
+ )
+ value: float = Field(description="Index values.")
diff --git a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
index 45e7c86a685..1e9844767f3 100644
--- a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
+++ b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_api.py
@@ -666,3 +666,31 @@ def test_fixedincome_government_yield_curve(params, headers):
result = requests.get(url, headers=headers, timeout=10)
assert isinstance(result, requests.Response)
assert result.status_code == 200
+
+
+@parametrize(
+ "params",
+ [
+ {
+ "provider": "fred",
+ "category": "high_yield",
+ "index": "us,europe,emerging",
+ "index_type": "total_return",
+ "start_date": "2023-05-31",
+ "end_date": "2024-06-01",
+ "transform": None,
+ "frequency": None,
+ "aggregation_method": "avg",
+ },
+ ],
+)
+@pytest.mark.integration
+def test_fixedincome_bond_indices(params, headers):
+ """Test the bond indices endpoint."""
+ params = {p: v for p, v in params.items() if v}
+
+ query_str = get_querystring(params, [])
+ url = f"http://0.0.0.0:8000/api/v1/fixedincome/bond_indices?{query_str}"
+ result = requests.get(url, headers=headers, timeout=10)
+ assert isinstance(result, requests.Response)
+ assert result.status_code == 200
diff --git a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
index 3efa8727269..433b96a3d8f 100644
--- a/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
+++ b/openbb_platform/extensions/fixedincome/integration/test_fixedincome_python.py
@@ -620,3 +620,30 @@ def test_fixedincome_government_yield_curve(params, obb):
assert result
assert isinstance(result, OBBject)
assert len(result.results) > 0
+
+
+@parametrize(
+ "params",
+ [
+ {
+ "provider": "fred",
+ "category": "high_yield",
+ "index": "us,europe,emerging",
+ "index_type": "total_return",
+ "start_date": "2023-05-31",
+ "end_date": "2024-06-01",
+ "transform": None,
+ "frequency": None,
+ "aggregation_method": "avg",
+ },
+ ],
+)
+@pytest.mark.integration
+def test_fixedincome_bond_indices(params, obb):
+ """Test the bond indices endpoint."""
+ params = {p: v for p, v in params.items() if v}
+
+ result = obb.fixedincome.bond_indices(**params)
+ assert result
+ assert isinstance(result, OBBject)
+ assert len(result.results) > 0
diff --git a/openbb_platform/extensions/fixedincome/openbb_fixedincome/corporate/corporate_router.py b/openbb_platform/extensions/fixedincome/openbb_fixedincome/corporate/corporate_router.py
index 18631946f2e..996a5820bea 100644
--- a/openbb_platform/extensions/fixedincome/openbb_fixedincome/corporate/corporate_router.py
+++ b/openbb_platform/extensions/fixedincome/openbb_fixedincome/corporate/corporate_router.py
@@ -1,5 +1,6 @@
"""Fixed Income Corporate Router."""
+from openbb_core.app.deprecation import OpenBBDeprecationWarning
from openbb_core.app.model.command_context import CommandContext
from openbb_core.app.model.example import APIEx
from openbb_core.app.model.obbject import OBBject
@@ -22,6 +23,12 @@ router = Router(prefix="/corporate")
APIEx(parameters={"provider": "fred"}),
APIEx(parameters={"index_type": "yield_to_worst", "provider": "fred"}),
],
+ deprecated=True,
+ deprecation=OpenBBDeprecationWarning(
+ message="This endpoint is deprecated; use `/fixedincome/bond_indices` instead.",
+ since=(4, 2),
+ expected_removal=(4, 5),
+ ),
)
async def ice_bofa(
cc: CommandContext,
diff --git a/openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py b/openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py
index 0e232cb1cdb..fb346dd3cc3 100644
--- a/openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py
+++ b/openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py
@@ -44,3 +44,40 @@ async def sofr(
borrowing cash overnight collateralizing by Treasury securities.
"""
return await OBBject.from_query(Query(**locals()))
+
+
+@router.command(
+ model="BondIndices",
+ examples=[
+ APIEx(
+ description="The default state for FRED are series for constructing the US Corporate Bond Yield Curve.",
+ parameters={"provider": "fred"},
+ ),
+ APIEx(
+ description="Multiple indices, from within the same 'category', can be requested.",
+ parameters={
+ "category": "high_yield",
+ "index": "us,europe,emerging",
+ "index_type": "total_return",
+ "provider": "fred",
+ },
+ ),
+ APIEx(
+ description="From FRED, there are three main categories, 'high_yield', 'us', and 'emerging_markets'."
+ + " Emerging markets is a broad category.",
+ parameters={
+ "category": "emerging_markets",
+ "index": "corporate,private_sector,public_sector",
+ "provider": "fred",
+ },
+ ),
+ ],
+)
+async def bond_indices(
+ cc: CommandContext,
+ provider_choices: ProviderChoices,
+ standard_params: StandardParams,
+ extra_params: ExtraParams,
+) -> OBBject: # type: ignore
+ """Bond Indices."""
+ return await OBBject.from_query(Query(**locals()))
diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json
index bb5ee238f37..c1c5e76fd72 100644
--- a/openbb_platform/openbb/assets/reference.json
+++ b/openbb_platform/openbb/assets/reference.json
@@ -31361,8 +31361,8 @@
},
"/fixedincome/corporate/ice_bofa": {
"deprecated": {
- "flag": null,
- "message": null
+ "flag": true,
+ "message": "This endpoint is deprecated; use `/fixedincome/bond_indices` instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.5."
},
"description": "ICE BofA US Corporate Bond Indices.\n\nThe ICE BofA US Corporate Index tracks the performance of US dollar denominated investment grade corporate debt\npublicly issued in the US domestic market. Qualifying securities must have an investment grade rating (based on an\naverage of Moody\u2019s, S&P and Fitch), at least 18 months to final maturity at the time of issuance, at least one year\nremaining term to final maturity as of the rebalance date, a fixed coupon schedule and a minimum amount\noutstanding of $250 million. The ICE BofA US Corporate Index is a component of the US Corporate Master Index.",
"examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.corporate.ice_bofa(provider='fred')\nobb.fixedincome.corporate.ice_bofa(index_type='yield_to_worst', provider='fred')\n```\n\n",
@@ -32016,6 +32016,225 @@
},
"model": "SOFR"
},
+ "/fixedincome/bond_indices": {
+ "deprecated": {
+ "flag": null,
+ "message": null
+ },
+ "description": "Bond Indices.",
+ "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\n# The default state for FRED are series for constructing the US Corporate Bond Yield Curve.\nobb.fixedincome.bond_indices(provider='fred')\n# Multiple indices, from within the same 'category', can be requested.\nobb.fixedincome.bond_indices(category=high_yield, index=us,europe,emerging, index_type='total_return', provider='fred')\n# From FRED, there are three main categories, 'high_yield', 'us', and 'emerging_markets'. Emerging markets is a broad category.\nobb.fixedincome.bond_indices(category=emerging_markets, index=corporate,private_sector,public_sector, provider='fred')\n```\n\n",
+ "parameters": {
+ "standard": [
+ {
+ "name": "start_date",
+ "type": "Union[date, str]",
+ "description": "Start date of the data, in YYYY-MM-DD format.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "end_date",
+ "type": "Union[date, str]",
+ "description": "End date of the data, in YYYY-MM-DD format.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "index_type",
+ "type": "Literal['yield', 'yield_to_worst', 'total_return', 'oas']",
+ "description": "The type of series. OAS is the option-adjusted spread. Default is yield.",
+ "default": "yield",
+ "optional": true,
+ "choices": [
+ "yield",
+ "yield_to_worst",
+ "total_return",
+ "oas"
+ ]
+ },
+ {
+ "name": "provider",
+ "type": "Literal['fred']",
+ "description": "The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: f, r, e, d.",
+ "default": null,
+ "optional": true
+ }
+ ],
+ "fred": [
+ {
+ "name": "category",
+ "type": "Literal['high_yield', 'us', 'emerging_markets']",
+ "description": "The type of index category. Used in conjunction with 'index', default is 'us'.",
+ "default": "us",
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "index",
+ "type": "Union[str, List[str]]",
+ "description": "The specific index to query. Used in conjunction with 'category' and 'index_type', default is 'yield_curve'. Multiple items allowed for provider(s): fred.",
+ "default": "yield_curve",
+ "optional": true,
+ "choices": [
+ "a",
+ "aa",
+ "aaa",
+ "asia",
+ "b",
+ "bb",
+ "bbb",
+ "ccc",
+ "corporate",
+ "crossover",
+ "emea",
+ "high_grade",
+ "high_yield",
+ "latam",
+ "liquid_aaa",
+ "liquid_asia",
+ "liquid_bbb",
+ "liquid_corporate",
+ "liquid_emea",
+ "liquid_latam",
+ "non_financial",
+ "private_sector",
+ "public_sector",
+ "yield_curve"
+ ]
+ },
+ {
+ "name": "frequency",
+ "type": "Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']",
+ "description": "Frequency aggregation to convert daily data to lower frequency. None = No change a = Annual q = Quarterly m = Monthly w = Weekly d = Daily wef = Weekly, Ending Friday weth = Weekly, Ending Thursday wew = Weekly, Ending Wednesday wetu = Weekly, Ending Tuesday wem = Weekly, Ending Monday wesu = Weekly, Ending Sunday wesa = Weekly, Ending Saturday bwew = Biweekly, Ending Wednesday bwem = Biweekly, Ending Monday",
+ "default": null,
+ "optional": true,
+ "choices": [
+ "a",
+ "q",
+ "m",
+ "w",
+ "d",
+ "wef",
+ "weth",
+ "wew",
+ "wetu",
+ "wem",
+ "wesu",
+ "wesa",
+ "bwew",
+ "bwem"
+ ]
+ },
+ {
+ "name": "aggregation_method",
+ "type": "Literal['avg', 'sum', 'eop']",
+ "description": "A key that indicates the aggregation method used for frequency aggregation. This parameter has no affect if the frequency parameter is not set, default is 'avg'. avg = Average sum = Sum eop = End of Period",
+ "default": "avg",
+ "optional": true,
+ "choices": [
+ "avg",
+ "sum",
+ "eop"
+ ]
+ },
+ {
+ "name": "transform",
+ "type": "Literal['chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log']",
+ "description": "Transformation type None = No transformation chg = Change ch1 = Change from Year Ago pch = Percent Change pc1 = Percent Change from Year Ago pca = Compounded Annual Rate of Change cch = Continuously Compounded Rate of Change cca = Continuously Compounded Annual Rate of Change log = Natural Log",
+ "default": null,
+ "optional": true,
+ "choices": [
+ "chg",
+ "ch1",
+ "pch",
+ "pc1",
+ "pca",
+ "cch",
+ "cca",
+ "log"
+ ]
+ }
+ ]
+ },
+ "returns": {
+ "OBBject": [
+ {
+ "name": "results",
+ "type": "List[BondIndices]",
+ "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": "date",
+ "type": "date",
+ "description": "The date of the data.",
+ "default": "",
+ "optional": false,
+ "choices": null
+ },
+ {
+ "name": "symbol",
+ "type": "str",
+ "description": "Symbol representing the entity requested in the data.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "value",
+ "type": "float",
+ "description": "Index values.",
+ "default": "",
+ "optional": false,
+ "choices": null
+ }
+ ],
+ "fred": [
+ {
+ "name": "maturity",
+ "type": "str",
+ "description": "The maturity range of the bond index. Only applicable when 'index' is 'yield_curve'.",
+ "default": null,
+ "optional": true,
+ "choices": null
+ },
+ {
+ "name": "title",
+ "type": "str",
+ "description": "The title of the index.",
+ "default": "",
+ "optional": false,
+ "choices": null
+ }
+ ]
+ },
+ "model": "BondIndices"
+ },
"/index/price/historical": {
"deprecated": {
"flag": null,
diff --git a/openbb_platform/openbb/package/fixedincome.py b/openbb_platform/openbb/package/fixedincome.py
index 4f23ed3b986..456845abcf0 100644
--- a/openbb_platform/openbb/package/fixedincome.py
+++ b/openbb_platform/openbb/package/fixedincome.py
@@ -13,6 +13,7 @@ from typing_extensions import Annotated
class ROUTER_fixedincome(Container):
"""/fixedincome
+ bond_indices
/corporate
/government
/rate
@@ -23,6 +24,148 @@ class ROUTER_fixedincome(Container):
def __repr__(self) -> str:
return self.__doc__ or ""
+ @exception_handler
+ @validate
+ def bond_indices(
+ self,
+ start_date: Annotated[
+ Union[datetime.date, None, str],
+ OpenBBField(description="Start date of the data, in YYYY-MM-DD format."),
+ ] = None,
+ end_date: Annotated[
+ Union[datetime.date, None, str],
+ OpenBBField(description="End date of the data, in YYYY-MM-DD format."),
+ ] = None,
+ index_type: Annotated[
+ Literal["yield", "yield_to_worst", "total_return", "oas"],
+ OpenBBField(
+ description="The type of series. OAS is the option-adjusted spread. Default is yield.",
+ choices=["yield", "yield_to_worst", "total_return", "oas"],
+ ),
+ ] = "yield",
+ 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:
+ """Bond Indices.
+
+ Parameters
+ ----------
+ start_date : Union[datetime.date, None, str]
+ Start date of the data, in YYYY-MM-DD format.
+ end_date : Union[datetime.date, None, str]
+ End date of the data, in YYYY-MM-DD format.
+ index_type : Literal['yield', 'yield_to_worst', 'total_return', 'oas']
+ The type of series. OAS is the option-adjusted spread. Default is yield.
+ provider : Optional[Lite