docstring
stringlengths
52
499
function
stringlengths
67
35.2k
__index_level_0__
int64
52.6k
1.16M
Earnings data for a given company including the actual EPS, consensus, and fiscal period. Earnings are available quarterly (last 4 quarters) and annually (last 4 years). https://iexcloud.io/docs/api/#earnings Updates at 9am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def earnings(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/earnings', token, version)
312,764
Earnings data for a given company including the actual EPS, consensus, and fiscal period. Earnings are available quarterly (last 4 quarters) and annually (last 4 years). https://iexcloud.io/docs/api/#earnings Updates at 9am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def earningsDF(symbol, token='', version=''): e = earnings(symbol, token, version) df = _earningsToDF(e) return df
312,766
Returns earnings that will be reported today as two arrays: before the open bto and after market close amc. Each array contains an object with all keys from earnings, a quote object, and a headline key. https://iexcloud.io/docs/api/#earnings-today Updates at 9am, 11am, 12pm UTC daily Args: token (string); Access token version (string); API version Returns: DataFrame: result
def earningsTodayDF(token='', version=''): x = earningsToday(token, version) z = [] for k in x: ds = x[k] for d in ds: d['when'] = k z.extend(ds) df = pd.io.json.json_normalize(z) if not df.empty: df.drop_duplicates(inplace=True) _toDatetime(df) _reindex(df, 'symbol') return df
312,767
Provides the latest consensus estimate for the next fiscal period https://iexcloud.io/docs/api/#estimates Updates at 9am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def estimates(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/estimates', token, version)
312,770
Provides the latest consensus estimate for the next fiscal period https://iexcloud.io/docs/api/#estimates Updates at 9am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def estimatesDF(symbol, token='', version=''): f = estimates(symbol, token, version) df = _estimatesToDF(f) return df
312,771
Pulls income statement, balance sheet, and cash flow data from the four most recent reported quarters. https://iexcloud.io/docs/api/#financials Updates at 8am, 9am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def financials(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/financials', token, version)
312,772
Pulls income statement, balance sheet, and cash flow data from the four most recent reported quarters. https://iexcloud.io/docs/api/#financials Updates at 8am, 9am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def financialsDF(symbol, token='', version=''): f = financials(symbol, token, version) df = _financialsToDF(f) return df
312,774
Pulls income statement data. Available quarterly (4 quarters) or annually (4 years). https://iexcloud.io/docs/api/#income-statement Updates at 8am, 9am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def incomeStatement(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/income', token, version)
312,775
Pulls income statement data. Available quarterly (4 quarters) or annually (4 years). https://iexcloud.io/docs/api/#income-statement Updates at 8am, 9am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def incomeStatementDF(symbol, token='', version=''): val = incomeStatement(symbol, token, version) df = pd.io.json.json_normalize(val, 'income', 'symbol') _toDatetime(df) _reindex(df, 'reportDate') return df
312,776
This returns a list of upcoming or today IPOs scheduled for the current and next month. The response is split into two structures: rawData and viewData. rawData represents all available data for an IPO. viewData represents data structured for display to a user. https://iexcloud.io/docs/api/#ipo-calendar 10am, 10:30am UTC daily Args: token (string); Access token version (string); API version Returns: DataFrame: result
def ipoTodayDF(token='', version=''): val = ipoToday(token, version) if val: df = pd.io.json.json_normalize(val, 'rawData') _toDatetime(df) _reindex(df, 'symbol') else: df = pd.DataFrame() return df
312,777
This returns a list of upcoming or today IPOs scheduled for the current and next month. The response is split into two structures: rawData and viewData. rawData represents all available data for an IPO. viewData represents data structured for display to a user. https://iexcloud.io/docs/api/#ipo-calendar 10am, 10:30am UTC daily Args: token (string); Access token version (string); API version Returns: DataFrame: result
def ipoUpcomingDF(token='', version=''): val = ipoUpcoming(token, version) if val: df = pd.io.json.json_normalize(val, 'rawData') _toDatetime(df) _reindex(df, 'symbol') else: df = pd.DataFrame() return df
312,778
Key Stats about company https://iexcloud.io/docs/api/#key-stats 8am, 9am ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def keyStats(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/stats', token, version)
312,779
Key Stats about company https://iexcloud.io/docs/api/#key-stats 8am, 9am ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def keyStatsDF(symbol, token='', version=''): s = keyStats(symbol, token, version) df = _statsToDF(s) return df
312,781
This returns 15 minute delayed, last sale eligible trades. https://iexcloud.io/docs/api/#largest-trades 9:30-4pm ET M-F during regular market hours Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def largestTrades(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/largest-trades', token, version)
312,782
This returns 15 minute delayed, last sale eligible trades. https://iexcloud.io/docs/api/#largest-trades 9:30-4pm ET M-F during regular market hours Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def largestTradesDF(symbol, token='', version=''): df = pd.DataFrame(largestTrades(symbol, token, version)) _toDatetime(df) _reindex(df, 'time') return df
312,783
Returns an array of quotes for the top 10 symbols in a specified list. https://iexcloud.io/docs/api/#list Updated intraday Args: option (string); Option to query token (string); Access token version (string); API version Returns: dict: result
def list(option='mostactive', token='', version=''): if option not in _LIST_OPTIONS: raise PyEXception('Option must be in %s' % str(_LIST_OPTIONS)) return _getJson('stock/market/list/' + option, token, version)
312,784
Returns an array of quotes for the top 10 symbols in a specified list. https://iexcloud.io/docs/api/#list Updated intraday Args: option (string); Option to query token (string); Access token version (string); API version Returns: DataFrame: result
def listDF(option='mostactive', token='', version=''): df = pd.DataFrame(list(option, token, version)) _toDatetime(df) _reindex(df, 'symbol') return df
312,785
This is a helper function, but the google APIs url is standardized. https://iexcloud.io/docs/api/#logo 8am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def logo(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/logo', token, version)
312,786
This is a helper function, but the google APIs url is standardized. https://iexcloud.io/docs/api/#logo 8am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: image: result as png
def logoPNG(symbol, token='', version=''): _raiseIfNotStr(symbol) response = requests.get(logo(symbol, token, version)['url']) return ImageP.open(BytesIO(response.content))
312,787
This is a helper function, but the google APIs url is standardized. https://iexcloud.io/docs/api/#logo 8am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: image: result
def logoNotebook(symbol, token='', version=''): _raiseIfNotStr(symbol) url = logo(symbol, token, version)['url'] return ImageI(url=url)
312,788
News about company https://iexcloud.io/docs/api/#news Continuous Args: symbol (string); Ticker to request count (int): limit number of results token (string); Access token version (string); API version Returns: dict: result
def news(symbol, count=10, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/news/last/' + str(count), token, version)
312,789
News about company https://iexcloud.io/docs/api/#news Continuous Args: symbol (string); Ticker to request count (int): limit number of results token (string); Access token version (string); API version Returns: DataFrame: result
def newsDF(symbol, count=10, token='', version=''): n = news(symbol, count, token, version) df = _newsToDF(n) return df
312,791
News about market https://iexcloud.io/docs/api/#news Continuous Args: count (int): limit number of results token (string); Access token version (string); API version Returns: DataFrame: result
def marketNewsDF(count=10, token='', version=''): df = pd.DataFrame(marketNews(count, token, version)) _toDatetime(df) _reindex(df, 'datetime') return df
312,792
Returns the official open and close for a give symbol. https://iexcloud.io/docs/api/#news 9:30am-5pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def ohlc(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/ohlc', token, version)
312,793
Returns the official open and close for a give symbol. https://iexcloud.io/docs/api/#news 9:30am-5pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def ohlcDF(symbol, token='', version=''): o = ohlc(symbol, token, version) if o: df = pd.io.json.json_normalize(o) _toDatetime(df) else: df = pd.DataFrame() return df
312,794
Returns the official open and close for whole market. https://iexcloud.io/docs/api/#news 9:30am-5pm ET Mon-Fri Args: token (string); Access token version (string); API version Returns: DataFrame: result
def marketOhlcDF(token='', version=''): x = marketOhlc(token, version) data = [] for key in x: data.append(x[key]) data[-1]['symbol'] = key df = pd.io.json.json_normalize(data) _toDatetime(df) _reindex(df, 'symbol') return df
312,795
Peers of ticker https://iexcloud.io/docs/api/#peers 8am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def peers(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/peers', token, version)
312,796
Peers of ticker https://iexcloud.io/docs/api/#peers 8am UTC daily Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def peersDF(symbol, token='', version=''): p = peers(symbol, token, version) df = _peersToDF(p) return df
312,798
This returns previous day adjusted price data for one or more stocks https://iexcloud.io/docs/api/#previous-day-prices Available after 4am ET Tue-Sat Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def yesterday(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/previous', token, version)
312,799
This returns previous day adjusted price data for one or more stocks https://iexcloud.io/docs/api/#previous-day-prices Available after 4am ET Tue-Sat Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def yesterdayDF(symbol, token='', version=''): y = yesterday(symbol, token, version) if y: df = pd.io.json.json_normalize(y) _toDatetime(df) _reindex(df, 'symbol') else: df = pd.DataFrame() return df
312,800
This returns previous day adjusted price data for whole market https://iexcloud.io/docs/api/#previous-day-prices Available after 4am ET Tue-Sat Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def marketYesterdayDF(token='', version=''): x = marketYesterday(token, version) data = [] for key in x: data.append(x[key]) data[-1]['symbol'] = key df = pd.DataFrame(data) _toDatetime(df) _reindex(df, 'symbol') return df
312,801
Price of ticker https://iexcloud.io/docs/api/#price 4:30am-8pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def price(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/price', token, version)
312,802
Price of ticker https://iexcloud.io/docs/api/#price 4:30am-8pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def priceDF(symbol, token='', version=''): df = pd.io.json.json_normalize({'price': price(symbol, token, version)}) _toDatetime(df) return df
312,803
Provides the latest avg, high, and low analyst price target for a symbol. https://iexcloud.io/docs/api/#price-target Updates at 10am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def priceTarget(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/price-target', token, version)
312,804
Provides the latest avg, high, and low analyst price target for a symbol. https://iexcloud.io/docs/api/#price-target Updates at 10am, 11am, 12pm UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def priceTargetDF(symbol, token='', version=''): df = pd.io.json.json_normalize(priceTarget(symbol, token, version)) _toDatetime(df) return df
312,805
Get quote for ticker https://iexcloud.io/docs/api/#quote 4:30am-8pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def quote(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/quote', token, version)
312,806
Get quote for ticker https://iexcloud.io/docs/api/#quote 4:30am-8pm ET Mon-Fri Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def quoteDF(symbol, token='', version=''): q = quote(symbol, token, version) if q: df = pd.io.json.json_normalize(q) _toDatetime(df) _reindex(df, 'symbol') else: df = pd.DataFrame() return df
312,807
Same as peers https://iexcloud.io/docs/api/#relevant Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def relevant(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/relevant', token, version)
312,808
Same as peers https://iexcloud.io/docs/api/#relevant Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def relevantDF(symbol, token='', version=''): df = pd.DataFrame(relevant(symbol, token, version)) _toDatetime(df) return df
312,809
This returns an array of each sector and performance for the current trading day. Performance is based on each sector ETF. https://iexcloud.io/docs/api/#sector-performance 8am-5pm ET Mon-Fri Args: token (string); Access token version (string); API version Returns: DataFrame: result
def sectorPerformanceDF(token='', version=''): df = pd.DataFrame(sectorPerformance(token, version)) _toDatetime(df) _reindex(df, 'name') return df
312,810
Stock split history https://iexcloud.io/docs/api/#splits Updated at 9am UTC every day Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def splitsDF(symbol, timeframe='ytd', token='', version=''): s = splits(symbol, timeframe, token, version) df = _splitsToDF(s) return df
312,812
This returns 15 minute delayed and 30 day average consolidated volume percentage of a stock, by market. This call will always return 13 values, and will be sorted in ascending order by current day trading volume percentage. https://iexcloud.io/docs/api/#volume-by-venue Updated during regular market hours 9:30am-4pm ET Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def volumeByVenue(symbol, token='', version=''): _raiseIfNotStr(symbol) return _getJson('stock/' + symbol + '/volume-by-venue', token, version)
312,813
The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report. The report data will be published daily at 4:00pm ET. https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev Args: symbol (string); Ticker to request date (datetime); Effective Datetime token (string); Access token version (string); API version Returns: dict: result
def shortInterest(symbol, date=None, token='', version=''): _raiseIfNotStr(symbol) if date: date = _strOrDate(date) return _getJson('stock/' + symbol + '/short-interest/' + date, token, version) return _getJson('stock/' + symbol + '/short-interest', token, version)
312,817
The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report. The report data will be published daily at 4:00pm ET. https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev Args: symbol (string); Ticker to request date (datetime); Effective Datetime token (string); Access token version (string); API version Returns: DataFrame: result
def shortInterestDF(symbol, date=None, token='', version=''): df = pd.DataFrame(shortInterest(symbol, date, token, version)) _toDatetime(df) return df
312,818
The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report. The report data will be published daily at 4:00pm ET. https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev Args: date (datetime); Effective Datetime token (string); Access token version (string); API version Returns: dict: result
def marketShortInterest(date=None, token='', version=''): if date: date = _strOrDate(date) return _getJson('stock/market/short-interest/' + date, token, version) return _getJson('stock/market/short-interest', token, version)
312,819
The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report. The report data will be published daily at 4:00pm ET. https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev Args: date (datetime); Effective Datetime token (string); Access token version (string); API version Returns: DataFrame: result
def marketShortInterestDF(date=None, token='', version=''): df = pd.DataFrame(marketShortInterest(date, token, version)) _toDatetime(df) return df
312,820
TOPS provides IEX’s aggregated best quoted bid and offer position in near real time for all securities on IEX’s displayed limit order book. TOPS is ideal for developers needing both quote and trade data. https://iexcloud.io/docs/api/#tops Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def topsSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('tops', symbols, on_data, token, version)
312,825
Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote. https://iexcloud.io/docs/api/#last Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def lastSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('last', symbols, on_data, token, version)
312,826
Trade report messages are sent when an order on the IEX Order Book is executed in whole or in part. DEEP sends a Trade report message for every individual fill. https://iexcloud.io/docs/api/#deep-trades Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def tradesSSE(symbols=None, on_data=None, token='', version=''): symbols = _strCommaSeparatedString(symbols) return _streamSSE(_SSE_DEEP_URL_PREFIX.format(symbols=symbols, channels='trades', token=token, version=version), on_data)
312,828
Book shows IEX’s bids and asks for given symbols. https://iexcloud.io/docs/api/#deep-book Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def bookSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('book', symbols, on_data, token, version)
312,830
The Official Price message is used to disseminate the IEX Official Opening and Closing Prices. These messages will be provided only for IEX Listed Securities. https://iexcloud.io/docs/api/#deep-official-price Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def officialPriceSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('official-price', symbols, on_data, token, version)
312,832
The Security event message is used to indicate events that apply to a security. A Security event message will be sent whenever such event occurs https://iexcloud.io/docs/api/#deep-security-event Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def securityEventSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('security-event', symbols, on_data, token, version)
312,833
The System event message is used to indicate events that apply to the market or the data feed. There will be a single message disseminated per channel for each System Event type within a given trading session. https://iexcloud.io/docs/api/#deep-system-event Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def systemEventSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('system-event', symbols, on_data, token, version)
312,835
Trade report messages are sent when an order on the IEX Order Book is executed in whole or in part. DEEP sends a Trade report message for every individual fill. https://iexcloud.io/docs/api/#deep-trades Args: symbols (string); Tickers to request on_data (function): Callback on data token (string); Access token version (string); API version
def tradeBreaksSSE(symbols=None, on_data=None, token='', version=''): return _runSSE('trade-breaks', symbols, on_data, token, version)
312,836
This will return an array of quotes for all Cryptocurrencies supported by the IEX API. Each element is a standard quote object with four additional keys. https://iexcloud.io/docs/api/#crypto Args: token (string); Access token version (string); API version Returns: DataFrame: result
def cryptoDF(token='', version=''): df = pd.DataFrame(crypto(token, version)) _toDatetime(df) _reindex(df, 'symbol') return df
312,838
This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date. https://iexcloud.io/docs/api/#social-sentiment Continuous Args: symbol (string); Ticker to request type (string); 'daily' or 'minute' date (string); date in YYYYMMDD or datetime token (string); Access token version (string); API version Returns: dict: result
def sentiment(symbol, type='daily', date=None, token='', version=''): _raiseIfNotStr(symbol) if date: date = _strOrDate(date) return _getJson('stock/{symbol}/sentiment/{type}/{date}'.format(symbol=symbol, type=type, date=date), token, version) return _getJson('stock/{symbol}/sentiment/{type}/'.format(symbol=symbol, type=type), token, version)
312,839
This endpoint provides social sentiment data from StockTwits. Data can be viewed as a daily value, or by minute for a given date. https://iexcloud.io/docs/api/#social-sentiment Continuous Args: symbol (string); Ticker to request type (string); 'daily' or 'minute' date (string); date in YYYYMMDD or datetime token (string); Access token version (string); API version Returns: DataFrame: result
def sentimentDF(symbol, type='daily', date=None, token='', version=''): ret = sentiment(symbol, type, date, token, version) if type == 'daiy': ret = [ret] df = pd.DataFrame(ret) _toDatetime(df) return df
312,840
https://iexcloud.io/docs/api/#stats-intraday Args: token (string); Access token version (string); API version Returns: DataFrame: result
def statsDF(token='', version=''): df = pd.DataFrame(stats(token, version)) _toDatetime(df) return df
312,841
https://iexcloud.io/docs/api/#stats-recent Args: token (string); Access token version (string); API version Returns: DataFrame: result
def recentDF(token='', version=''): df = pd.DataFrame(recent(token, version)) _toDatetime(df) _reindex(df, 'date') return df
312,842
https://iexcloud.io/docs/api/#stats-records Args: token (string); Access token version (string); API version Returns: DataFrame: result
def recordsDF(token='', version=''): df = pd.DataFrame(records(token, version)) _toDatetime(df) return df
312,843
https://iexcloud.io/docs/api/#stats-historical-summary Args: token (string); Access token version (string); API version Returns: dict: result
def summary(date=None, token='', version=''): if date: if isinstance(date, str): return _getJson('stats/historical?date=' + date, token, version) elif isinstance(date, datetime): return _getJson('stats/historical?date=' + date.strftime('%Y%m'), token, version) else: raise PyEXception("Can't handle type : %s" % str(type(date)), token, version) return _getJson('stats/historical', token, version)
312,844
https://iexcloud.io/docs/api/#stats-historical-summary Args: token (string); Access token version (string); API version Returns: DataFrame: result
def summaryDF(date=None, token='', version=''): df = pd.DataFrame(summary(date, token, version)) _toDatetime(df) return df
312,845
https://iexcloud.io/docs/api/#stats-historical-daily Args: token (string); Access token version (string); API version Returns: dict: result
def daily(date=None, last='', token='', version=''): if date: date = _strOrDate(date) return _getJson('stats/historical/daily?date=' + date, token, version) elif last: return _getJson('stats/historical/daily?last=' + last, token, version) return _getJson('stats/historical/daily', token, version)
312,846
https://iexcloud.io/docs/api/#stats-historical-daily Args: token (string); Access token version (string); API version Returns: DataFrame: result
def dailyDF(date=None, last='', token='', version=''): df = pd.DataFrame(daily(date, last, token, version)) _toDatetime(df) return df
312,847
TOPS provides IEX’s aggregated best quoted bid and offer position in near real time for all securities on IEX’s displayed limit order book. TOPS is ideal for developers needing both quote and trade data. https://iexcloud.io/docs/api/#tops Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def tops(symbols=None, token='', version=''): symbols = _strToList(symbols) if symbols: return _getJson('tops?symbols=' + ','.join(symbols) + '%2b', token, version) return _getJson('tops', token, version)
312,860
TOPS provides IEX’s aggregated best quoted bid and offer position in near real time for all securities on IEX’s displayed limit order book. TOPS is ideal for developers needing both quote and trade data. https://iexcloud.io/docs/api/#tops Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def topsDF(symbols=None, token='', version=''): df = pd.io.json.json_normalize(tops(symbols, token, version)) _toDatetime(df) _reindex(df, 'symbol') return df
312,861
Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote. https://iexcloud.io/docs/api/#last Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def last(symbols=None, token='', version=''): symbols = _strToList(symbols) if symbols: return _getJson('tops/last?symbols=' + ','.join(symbols) + '%2b', token, version) return _getJson('tops/last', token, version)
312,862
Last provides trade data for executions on IEX. It is a near real time, intraday API that provides IEX last sale price, size and time. Last is ideal for developers that need a lightweight stock quote. https://iexcloud.io/docs/api/#last Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def lastDF(symbols=None, token='', version=''): df = pd.io.json.json_normalize(last(symbols, token, version)) _toDatetime(df) _reindex(df, 'symbol') return df
312,863
DEEP broadcasts an Auction Information Message every one second between the Lock-in Time and the auction match for Opening and Closing Auctions, and during the Display Only Period for IPO, Halt, and Volatility Auctions. Only IEX listed securities are eligible for IEX Auctions. https://iexcloud.io/docs/api/#deep-auction Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def auction(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/auction?symbols=' + symbol, token, version) return _getJson('deep/auction', token, version)
312,866
DEEP broadcasts an Auction Information Message every one second between the Lock-in Time and the auction match for Opening and Closing Auctions, and during the Display Only Period for IPO, Halt, and Volatility Auctions. Only IEX listed securities are eligible for IEX Auctions. https://iexcloud.io/docs/api/#deep-auction Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def auctionDF(symbol=None, token='', version=''): df = pd.io.json.json_normalize(auction(symbol, token, version)) _toDatetime(df) return df
312,867
Book shows IEX’s bids and asks for given symbols. https://iexcloud.io/docs/api/#deep-book Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def book(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/book?symbols=' + symbol, token, version) return _getJson('deep/book', token, version)
312,868
Book shows IEX’s bids and asks for given symbols. https://iexcloud.io/docs/api/#deep-book Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def bookDF(symbol=None, token='', version=''): x = book(symbol, token, version) data = [] for key in x: d = x[key] d['symbol'] = key data.append(d) df = pd.io.json.json_normalize(data) _toDatetime(df) return df
312,869
The Official Price message is used to disseminate the IEX Official Opening and Closing Prices. These messages will be provided only for IEX Listed Securities. https://iexcloud.io/docs/api/#deep-official-price Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def officialPrice(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/official-price?symbols=' + symbol, token, version) return _getJson('deep/official-price', token, version)
312,872
The Official Price message is used to disseminate the IEX Official Opening and Closing Prices. These messages will be provided only for IEX Listed Securities. https://iexcloud.io/docs/api/#deep-official-price Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def officialPriceDF(symbol=None, token='', version=''): df = pd.io.json.json_normalize(officialPrice(symbol, token, version)) _toDatetime(df) return df
312,873
The Security event message is used to indicate events that apply to a security. A Security event message will be sent whenever such event occurs https://iexcloud.io/docs/api/#deep-security-event Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def securityEvent(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/security-event?symbols=' + symbol, token, version) return _getJson('deep/security-event', token, version)
312,874
The Security event message is used to indicate events that apply to a security. A Security event message will be sent whenever such event occurs https://iexcloud.io/docs/api/#deep-security-event Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def securityEventDF(symbol=None, token='', version=''): x = securityEvent(symbol, token, version) data = [] for key in x: d = x[key] d['symbol'] = key data.append(d) df = pd.DataFrame(data) _toDatetime(df) return df
312,875
The System event message is used to indicate events that apply to the market or the data feed. There will be a single message disseminated per channel for each System Event type within a given trading session. https://iexcloud.io/docs/api/#deep-system-event Args: token (string); Access token version (string); API version Returns: DataFrame: result
def systemEventDF(token='', version=''): df = pd.io.json.json_normalize(systemEvent(token, version)) _toDatetime(df) return df
312,878
Trade report messages are sent when an order on the IEX Order Book is executed in whole or in part. DEEP sends a Trade report message for every individual fill. https://iexcloud.io/docs/api/#deep-trades Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def trades(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/trades?symbols=' + symbol, token, version) return _getJson('deep/trades', token, version)
312,879
Trade report messages are sent when an order on the IEX Order Book is executed in whole or in part. DEEP sends a Trade report message for every individual fill. https://iexcloud.io/docs/api/#deep-trades Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def tradesDF(symbol=None, token='', version=''): x = trades(symbol, token, version) data = [] for key in x: dat = x[key] for d in dat: d['symbol'] = key data.append(d) df = pd.DataFrame(data) _toDatetime(df) return df
312,880
Trade break messages are sent when an execution on IEX is broken on that same trading day. Trade breaks are rare and only affect applications that rely upon IEX execution based data. https://iexcloud.io/docs/api/#deep-trade-break Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: dict: result
def tradeBreak(symbol=None, token='', version=''): _raiseIfNotStr(symbol) if symbol: return _getJson('deep/trade-breaks?symbols=' + symbol, token, version) return _getJson('deep/trade-breaks', token, version)
312,881
Trade break messages are sent when an execution on IEX is broken on that same trading day. Trade breaks are rare and only affect applications that rely upon IEX execution based data. https://iexcloud.io/docs/api/#deep-trade-break Args: symbol (string); Ticker to request token (string); Access token version (string); API version Returns: DataFrame: result
def tradeBreakDF(symbol=None, token='', version=''): df = pd.io.json.json_normalize(tradeBreak(symbol, token, version)) _toDatetime(df) return df
312,882
Use pkg-config to query for the location of libraries, library directories, and header directories Arguments: pkg_libries(list): A list of packages as strings Returns: libraries(list), library_dirs(list), include_dirs(list)
def pkg_config(pkg_libraries): libraries=[] library_dirs=[] include_dirs=[] # Check that we have the packages for pkg in pkg_libraries: if os.system('pkg-config --exists %s 2>/dev/null' % pkg) == 0: pass else: print("Could not find library {0}".format(pkg)) sys.exit(1) # Get the pck-config flags if len(pkg_libraries)>0 : # PKG_CONFIG_ALLOW_SYSTEM_CFLAGS explicitly lists system paths. # On system-wide LAL installs, this is needed for swig to find lalswig.i for token in getoutput("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags %s" % ' '.join(pkg_libraries)).split(): if token.startswith("-l"): libraries.append(token[2:]) elif token.startswith("-L"): library_dirs.append(token[2:]) elif token.startswith("-I"): include_dirs.append(token[2:]) return libraries, library_dirs, include_dirs
314,523
Converts to :class:`google.oauth2.credentials.Credentials`. Args: credentials (Union[oauth2client.client.OAuth2Credentials, oauth2client.client.GoogleCredentials]): The credentials to convert. Returns: google.oauth2.credentials.Credentials: The converted credentials.
def _convert_oauth2_credentials(credentials): new_credentials = google.oauth2.credentials.Credentials( token=credentials.access_token, refresh_token=credentials.refresh_token, token_uri=credentials.token_uri, client_id=credentials.client_id, client_secret=credentials.client_secret, scopes=credentials.scopes) new_credentials._expires = credentials.token_expiry return new_credentials
315,019
Converts to :class:`google.oauth2.service_account.Credentials`. Args: credentials (Union[ oauth2client.service_account.ServiceAccountCredentials, oauth2client.service_account._JWTAccessCredentials]): The credentials to convert. Returns: google.oauth2.service_account.Credentials: The converted credentials.
def _convert_service_account_credentials(credentials): info = credentials.serialization_data.copy() info['token_uri'] = credentials.token_uri return google.oauth2.service_account.Credentials.from_service_account_info( info)
315,020
Converts to :class:`google.auth.app_engine.Credentials`. Args: credentials (oauth2client.contrib.app_engine.AppAssertionCredentials): The credentials to convert. Returns: google.oauth2.service_account.Credentials: The converted credentials.
def _convert_appengine_app_assertion_credentials(credentials): # pylint: disable=invalid-name return google.auth.app_engine.Credentials( scopes=_helpers.string_to_scopes(credentials.scope), service_account_id=credentials.service_account_id)
315,021
Updates credentials with a new access_token representing the impersonated account. Args: request (google.auth.transport.requests.Request): Request object to use for refreshing credentials.
def _update_token(self, request): # Refresh our source credentials. self._source_credentials.refresh(request) body = { "delegates": self._delegates, "scope": self._target_scopes, "lifetime": str(self._lifetime) + "s" } headers = { 'Content-Type': 'application/json', } # Apply the source credentials authentication info. self._source_credentials.apply(headers) self.token, self.expiry = _make_iam_token_request( request=request, principal=self._target_principal, headers=headers, body=body)
315,025
Fetches certificates. Google-style cerificate endpoints return JSON in the format of ``{'key id': 'x509 certificate'}``. Args: request (google.auth.transport.Request): The object used to make HTTP requests. certs_url (str): The certificate endpoint URL. Returns: Mapping[str, str]: A mapping of public key ID to x.509 certificate data.
def _fetch_certs(request, certs_url): response = request(certs_url, method='GET') if response.status != http_client.OK: raise exceptions.TransportError( 'Could not fetch certificates at {}'.format(certs_url)) return json.loads(response.data.decode('utf-8'))
315,030
Verifies an ID Token issued by Google's OAuth 2.0 authorization server. Args: id_token (Union[str, bytes]): The encoded token. request (google.auth.transport.Request): The object used to make HTTP requests. audience (str): The audience that this token is intended for. This is typically your application's OAuth 2.0 client ID. If None then the audience is not verified. Returns: Mapping[str, Any]: The decoded token.
def verify_oauth2_token(id_token, request, audience=None): return verify_token( id_token, request, audience=audience, certs_url=_GOOGLE_OAUTH2_CERTS_URL)
315,032
Verifies an ID Token issued by Firebase Authentication. Args: id_token (Union[str, bytes]): The encoded token. request (google.auth.transport.Request): The object used to make HTTP requests. audience (str): The audience that this token is intended for. This is typically your Firebase application ID. If None then the audience is not verified. Returns: Mapping[str, Any]: The decoded token.
def verify_firebase_token(id_token, request, audience=None): return verify_token( id_token, request, audience=audience, certs_url=_GOOGLE_APIS_CERTS_URL)
315,033
Make a signed JWT. Args: signer (google.auth.crypt.Signer): The signer used to sign the JWT. payload (Mapping[str, str]): The JWT payload. header (Mapping[str, str]): Additional JWT header payload. key_id (str): The key id to add to the JWT header. If the signer has a key id it will be used as the default. If this is specified it will override the signer's key id. Returns: bytes: The encoded JWT.
def encode(signer, payload, header=None, key_id=None): if header is None: header = {} if key_id is None: key_id = signer.key_id header.update({'typ': 'JWT', 'alg': 'RS256'}) if key_id is not None: header['kid'] = key_id segments = [ _helpers.unpadded_urlsafe_b64encode( json.dumps(header).encode('utf-8') ), _helpers.unpadded_urlsafe_b64encode( json.dumps(payload).encode('utf-8') ), ] signing_input = b'.'.join(segments) signature = signer.sign(signing_input) segments.append( _helpers.unpadded_urlsafe_b64encode(signature) ) return b'.'.join(segments)
315,034
Decodes a token and does no verification. Args: token (Union[str, bytes]): The encoded JWT. Returns: Tuple[str, str, str, str]: header, payload, signed_section, and signature. Raises: ValueError: if there are an incorrect amount of segments in the token.
def _unverified_decode(token): token = _helpers.to_bytes(token) if token.count(b'.') != 2: raise ValueError( 'Wrong number of segments in token: {0}'.format(token)) encoded_header, encoded_payload, signature = token.split(b'.') signed_section = encoded_header + b'.' + encoded_payload signature = _helpers.padded_urlsafe_b64decode(signature) # Parse segments header = _decode_jwt_segment(encoded_header) payload = _decode_jwt_segment(encoded_payload) return header, payload, signed_section, signature
315,036
Verifies the ``iat`` (Issued At) and ``exp`` (Expires) claims in a token payload. Args: payload (Mapping[str, str]): The JWT payload. Raises: ValueError: if any checks failed.
def _verify_iat_and_exp(payload): now = _helpers.datetime_to_secs(_helpers.utcnow()) # Make sure the iat and exp claims are present. for key in ('iat', 'exp'): if key not in payload: raise ValueError( 'Token does not contain required claim {}'.format(key)) # Make sure the token wasn't issued in the future. iat = payload['iat'] # Err on the side of accepting a token that is slightly early to account # for clock skew. earliest = iat - _helpers.CLOCK_SKEW_SECS if now < earliest: raise ValueError('Token used too early, {} < {}'.format(now, iat)) # Make sure the token wasn't issued in the past. exp = payload['exp'] # Err on the side of accepting a token that is slightly out of date # to account for clow skew. latest = exp + _helpers.CLOCK_SKEW_SECS if latest < now: raise ValueError('Token expired, {} < {}'.format(latest, now))
315,037
Creates a Credentials instance from a signer and service account info. Args: signer (google.auth.crypt.Signer): The signer used to sign JWTs. info (Mapping[str, str]): The service account info. kwargs: Additional arguments to pass to the constructor. Returns: google.auth.jwt.Credentials: The constructed credentials. Raises: ValueError: If the info is not in the expected format.
def _from_signer_and_info(cls, signer, info, **kwargs): kwargs.setdefault('subject', info['client_email']) kwargs.setdefault('issuer', info['client_email']) return cls(signer, **kwargs)
315,040
Get a JWT For a given audience. If there is already an existing, non-expired token in the cache for the audience, that token is used. Otherwise, a new token will be created. Args: audience (str): The intended audience. Returns: bytes: The encoded JWT.
def _get_jwt_for_audience(self, audience): token, expiry = self._cache.get(audience, (None, None)) if token is None or expiry < _helpers.utcnow(): token, expiry = self._make_jwt_for_audience(audience) self._cache[audience] = token, expiry return token
315,046
Performs credential-specific before request logic. Args: request (Any): Unused. JWT credentials do not need to make an HTTP request to refresh. method (str): The request's HTTP method. url (str): The request's URI. This is used as the audience claim when generating the JWT. headers (Mapping): The request's headers.
def before_request(self, request, method, url, headers): # pylint: disable=unused-argument # (pylint doesn't correctly recognize overridden methods.) parts = urllib.parse.urlsplit(url) # Strip query string and fragment audience = urllib.parse.urlunsplit( (parts.scheme, parts.netloc, parts.path, "", "")) token = self._get_jwt_for_audience(audience) self.apply(headers, token=token)
315,047
Construct an Verifier instance from a public key or public certificate string. Args: public_key (Union[str, bytes]): The public key in PEM format or the x509 public key certificate. Returns: Verifier: The constructed verifier. Raises: ValueError: If the public key can't be parsed.
def from_string(cls, public_key): public_key_data = _helpers.to_bytes(public_key) if _CERTIFICATE_MARKER in public_key_data: cert = cryptography.x509.load_pem_x509_certificate( public_key_data, _BACKEND) pubkey = cert.public_key() else: pubkey = serialization.load_pem_public_key( public_key_data, _BACKEND) return cls(pubkey)
315,049
Creates a Credentials instance from a signer and service account info. Args: signer (google.auth.crypt.Signer): The signer used to sign JWTs. info (Mapping[str, str]): The service account info. kwargs: Additional arguments to pass to the constructor. Returns: google.auth.jwt.Credentials: The constructed credentials. Raises: ValueError: If the info is not in the expected format.
def _from_signer_and_info(cls, signer, info, **kwargs): return cls( signer, service_account_email=info['client_email'], token_uri=info['token_uri'], project_id=info.get('project_id'), **kwargs)
315,066
Creates a Credentials instance from parsed service account info. Args: info (Mapping[str, str]): The service account info in Google format. kwargs: Additional arguments to pass to the constructor. Returns: google.auth.service_account.Credentials: The constructed credentials. Raises: ValueError: If the info is not in the expected format.
def from_service_account_info(cls, info, **kwargs): signer = _service_account_info.from_dict( info, require=['client_email', 'token_uri']) return cls._from_signer_and_info(signer, info, **kwargs)
315,067
Creates a Credentials instance from a service account json file. Args: filename (str): The path to the service account json file. kwargs: Additional arguments to pass to the constructor. Returns: google.auth.service_account.Credentials: The constructed credentials.
def from_service_account_file(cls, filename, **kwargs): info, signer = _service_account_info.from_filename( filename, require=['client_email', 'token_uri']) return cls._from_signer_and_info(signer, info, **kwargs)
315,068
Create a copy of these credentials with the specified subject. Args: subject (str): The subject claim. Returns: google.auth.service_account.Credentials: A new credentials instance.
def with_subject(self, subject): return self.__class__( self._signer, service_account_email=self._service_account_email, scopes=self._scopes, token_uri=self._token_uri, subject=subject, project_id=self._project_id, additional_claims=self._additional_claims.copy())
315,070