From 75f98276cc66dab7e7af7a260c3d59727c6f5de5 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 24 Jun 2020 14:13:00 -0400 Subject: [PATCH] Add symbol search to broker api --- piker/brokers/core.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/piker/brokers/core.py b/piker/brokers/core.py index e65fcb40..2e672c61 100644 --- a/piker/brokers/core.py +++ b/piker/brokers/core.py @@ -108,3 +108,15 @@ async def symbol_info( """ async with brokermod.get_client() as client: return await client.symbol_info(symbol, **kwargs) + + +async def symbol_search( + brokermod: ModuleType, + symbol: str, + **kwargs, +) -> Dict[str, Dict[str, Dict[str, Any]]]: + """Return symbol info from broker. + """ + async with brokermod.get_client() as client: + # TODO: support multiple asset type concurrent searches. + return await client.search_stocks(symbol, **kwargs)