Files
OpenBB/openbb_platform/extensions/fixedincome/openbb_fixedincome/fixedincome_router.py
teh_coderer bc2fa9b3e1 Feature/platform async (#5763)
* init

* updates

* Update helpers.py

* tests

* Update helpers.py

* Update command_runner.py

* Update helpers.py

* deps

* Update helpers.py

* only check `async` if model is specified, revert `qa`, `ta`, and `econometrics`

* merge issues

* Update command_runner.py

* remove typing and type: ignore

* fix helpers typing

* add aiohttp to core deps, remove from charting

* remove @overload

* ruff

* import helper from source

* helpers typing+pylint

* black

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt>
Co-authored-by: Diogo Sousa <montezdesousa@gmail.com>
2023-11-23 13:01:56 +00:00

40 lines
1.4 KiB
Python

"""Fixed Income Router."""
# pylint: disable=W0613:unused-argument
from openbb_core.app.model.command_context import CommandContext
from openbb_core.app.model.obbject import OBBject
from openbb_core.app.provider_interface import (
ExtraParams,
ProviderChoices,
StandardParams,
)
from openbb_core.app.query import Query
from openbb_core.app.router import Router
from pydantic import BaseModel
from openbb_fixedincome.corporate.corporate_router import router as corporate_router
from openbb_fixedincome.government.government_router import router as government_router
from openbb_fixedincome.rate.rate_router import router as rate_router
from openbb_fixedincome.spreads.spreads_router import router as spreads_router
router = Router(prefix="")
router.include_router(rate_router)
router.include_router(spreads_router)
router.include_router(government_router)
router.include_router(corporate_router)
@router.command(model="SOFR")
async def sofr(
cc: CommandContext,
provider_choices: ProviderChoices,
standard_params: StandardParams,
extra_params: ExtraParams,
) -> OBBject[BaseModel]: # type: ignore
"""Secured Overnight Financing Rate.
The Secured Overnight Financing Rate (SOFR) is a broad measure of the cost of
borrowing cash overnight collateralizing by Treasury securities.
"""
return await OBBject.from_query(Query(**locals()))