mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
* round 1 * black * more black * providers a-thru-fmp * charting settings * charting backend * black * charting_settings * missing nasdaq import * nasdaq mypy * fed money measure * some linting * black * more linting * more linting * charting imports * black * pylint * refactor fred * more linting * rest of the providers * didn't want that file * more cleanup * missed * ta_helpers * router views * chart ta_class * forgot a file * forgot another file * biztoc * package builder * technical router * fred params * bump finviz * fix tmx * more cleanup * try again * currency historical * equity search * missed files in commit * fix some tests * black * fix more test cassettes * more patchy * black * linters * more tests * black * mypy * delete unused model * more linting * forgot files * more linting * make up your mind, black, and stop moving pylint for me * more black * back to where we were before black destroyed it * .......... * .................. * unused fetcher test * remove standard model validator * commodity router * treasury prices * oecd tests * finra * container cleanup * black * forgotten file * linter * remove wrapped "" * fix merge * patches * ecb test * finra cassette * finviz cassettes * nasdaq cassettes * oecd cassettes * yfinance cassettes * more test cassettes * black * merge cleanup * cboe helpers * black * fix typo --------- Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
"""The Commodity router."""
|
|
|
|
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
|
|
from openbb_core.app.provider_interface import (
|
|
ExtraParams,
|
|
ProviderChoices,
|
|
StandardParams,
|
|
)
|
|
from openbb_core.app.query import Query
|
|
from openbb_core.app.router import Router
|
|
|
|
router = Router(prefix="", description="Commodity market data.")
|
|
|
|
|
|
# pylint: disable=unused-argument
|
|
@router.command(
|
|
model="LbmaFixing",
|
|
examples=[
|
|
APIEx(parameters={"provider": "nasdaq"}),
|
|
APIEx(
|
|
description="Get the daily LBMA fixing prices for silver in 2023.",
|
|
parameters={
|
|
"asset": "silver",
|
|
"start_date": "2023-01-01",
|
|
"end_date": "2023-12-31",
|
|
"transform": "rdiff",
|
|
"collapse": "monthly",
|
|
"provider": "nasdaq",
|
|
},
|
|
),
|
|
],
|
|
)
|
|
async def lbma_fixing(
|
|
cc: CommandContext,
|
|
provider_choices: ProviderChoices,
|
|
standard_params: StandardParams,
|
|
extra_params: ExtraParams,
|
|
) -> OBBject:
|
|
"""Daily LBMA Fixing Prices in USD/EUR/GBP."""
|
|
return await OBBject.from_query(Query(**locals()))
|