diff options
author | Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> | 2024-02-20 14:35:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 13:35:30 +0000 |
commit | 9fee65ab68951c77c7f694ebabce6f4fa9181f9b (patch) | |
tree | 9cdab716fb0931417d9f37f71d0ce189b4a1c4dc | |
parent | b84a0910acad3ffc1d29cd438a06950b5c01684a (diff) |
Add ETF examples (#6102)
Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
-rw-r--r-- | openbb_platform/extensions/etf/openbb_etf/discovery/discovery_router.py | 27 | ||||
-rw-r--r-- | openbb_platform/extensions/etf/openbb_etf/etf_router.py | 10 |
2 files changed, 33 insertions, 4 deletions
diff --git a/openbb_platform/extensions/etf/openbb_etf/discovery/discovery_router.py b/openbb_platform/extensions/etf/openbb_etf/discovery/discovery_router.py index 3f6c10f9b2f..21e60286f49 100644 --- a/openbb_platform/extensions/etf/openbb_etf/discovery/discovery_router.py +++ b/openbb_platform/extensions/etf/openbb_etf/discovery/discovery_router.py @@ -15,7 +15,14 @@ router = Router(prefix="/discovery") # pylint: disable=unused-argument -@router.command(model="ETFGainers", operation_id="etf_gainers") +@router.command( + model="ETFGainers", + operation_id="etf_gainers", + examples=[ + "### Get the top ETF gainers. ###", + 'obb.etf.discovery.gainers(provider="wsj")', + ], +) async def gainers( cc: CommandContext, provider_choices: ProviderChoices, @@ -26,7 +33,14 @@ async def gainers( return await OBBject.from_query(Query(**locals())) -@router.command(model="ETFLosers", operation_id="etf_losers") +@router.command( + model="ETFLosers", + operation_id="etf_losers", + examples=[ + "### Get the top ETF losers. ###", + 'obb.etf.discovery.losers(provider="wsj")', + ], +) async def losers( cc: CommandContext, provider_choices: ProviderChoices, @@ -37,7 +51,14 @@ async def losers( return await OBBject.from_query(Query(**locals())) -@router.command(model="ETFActive", operation_id="etf_active") +@router.command( + model="ETFActive", + operation_id="etf_active", + examples=[ + "### Get the most active ETFs. ###", + 'obb.etf.discovery.active(provider="wsj")', + ], +) async def active( cc: CommandContext, provider_choices: ProviderChoices, diff --git a/openbb_platform/extensions/etf/openbb_etf/etf_router.py b/openbb_platform/extensions/etf/openbb_etf/etf_router.py index c2906727d7a..8a528a885cf 100644 --- a/openbb_platform/extensions/etf/openbb_etf/etf_router.py +++ b/openbb_platform/extensions/etf/openbb_etf/etf_router.py @@ -41,7 +41,15 @@ async def search( return await OBBject.from_query(Query(**locals())) -@router.command(model="EtfHistorical", operation_id="etf_historical") +@router.command( + model="EtfHistorical", + operation_id="etf_historical", + examples=[ + 'obb.etf.historical("SPY", provider="yfinance")', + "#### This function accepts multiple tickers. ####", + 'obb.etf.historical("SPY,IWM,QQQ,DJIA", provider="yfinance")', + ], +) async def historical( cc: CommandContext, provider_choices: ProviderChoices, |