Skip to content

Commit

Permalink
Add symbol search to broker api
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Sep 2, 2020
1 parent 483973c commit 93bf372
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions piker/brokers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 93bf372

Please sign in to comment.