This repository has been archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,6 +293,8 @@ | |
internationalExchangesDF, | ||
sectors, | ||
sectorsDF, | ||
search, | ||
searchDF, | ||
tags, | ||
tagsDF, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
import pandas as pd | ||
from functools import wraps | ||
from ..common import _interval, _getJson | ||
|
||
|
||
@_interval(hours=24) # TODO make this smaller? | ||
def search(fragment, token="", version="", filter=""): | ||
"""Returns an array of symbols up to the top 10 matches. Results will be sorted for relevancy. Search currently defaults to equities only, where the symbol returned is supported by endpoints listed under the Stocks category. | ||
https://iexcloud.io/docs/api/#search | ||
Args: | ||
fragment (str): URL encoded search string. Currently search by symbol or security name. | ||
token (str): Access token | ||
version (str): API version | ||
filter (str): filters: https://iexcloud.io/docs/api/#filter-results | ||
Returns: | ||
dict or DataFrame: result | ||
""" | ||
return _getJson("search/{}".format(fragment), token, version, filter) | ||
|
||
|
||
@wraps(search) | ||
def searchDF(fragment, token="", version="", filter=""): | ||
return pd.DataFrame(search(fragment, token, version, filter)) |