def batch(symbols, fields=None, range_='1m', last=10, token='', version=''):
    '''Batch several data requests into one invocation

    https://iexcloud.io/docs/api/#batch-requests


    Args:
        symbols (list); List of tickers to request
        fields (list); List of fields to request
        range_ (string); Date range for chart
        last (int);
        token (string); Access token
        version (string); API version

    Returns:
        dict: results in json
    '''
    fields = fields or _BATCH_TYPES[:10]  # limit 10

    if not isinstance(symbols, [].__class__):
        if not isinstance(symbols, str):
            raise PyEXception('batch expects string or list of strings for symbols argument')

    if isinstance(fields, str):
        fields = [fields]

    if range_ not in _TIMEFRAME_CHART:
        raise PyEXception('Range must be in %s' % str(_TIMEFRAME_CHART))

    if isinstance(symbols, str):
        route = 'stock/{}/batch?types={}&range={}&last={}'.format(symbols, ','.join(fields), range_, last)
        return _getJson(route, token, version)

    if len(symbols) > 100:
        raise PyEXception('IEX will only handle up to 100 symbols at a time!')
    route = 'stock/market/batch?symbols={}&types={}&range={}&last={}'.format(','.join(symbols), ','.join(fields), range_, last)
    return _getJson(route, token, version)
def batch(symbols, fields=None, range_='1m', last=10, token='', version=''):
    '''Batch several data requests into one invocation

    https://iexcloud.io/docs/api/#batch-requests


    Args:
        symbols (list); List of tickers to request
        fields (list); List of fields to request
        range_ (string); Date range for chart
        last (int);
        token (string); Access token
        version (string); API version

    Returns:
        dict: results in json
    '''
    fields = fields or _BATCH_TYPES[:10]  # limit 10

    if not isinstance(symbols, [].__class__):
        if not isinstance(symbols, str):
            raise PyEXception('batch expects string or list of strings for symbols argument')

    if isinstance(fields, str):
        fields = [fields]

    if range_ not in _TIMEFRAME_CHART:
        raise PyEXception('Range must be in %s' % str(_TIMEFRAME_CHART))

    if isinstance(symbols, str):
        route = 'stock/{}/batch?types={}&range={}&last={}'.format(symbols, ','.join(fields), range_, last)
        return _getJson(route, token, version)

    if len(symbols) > 100:
        raise PyEXception('IEX will only handle up to 100 symbols at a time!')
    route = 'stock/market/batch?symbols={}&types={}&range={}&last={}'.format(','.join(symbols), ','.join(fields), range_, last)
    return _getJson(route, token, version)
def batch ( symbols , fields = None , range_ = '1m' , last = 10 , token = '' , version = '' ) : fields = fields or _BATCH_TYPES [ : 10 ] # limit 10 if not isinstance ( symbols , [ ] . __class__ ) : if not isinstance ( symbols , str ) : raise PyEXception ( 'batch expects string or list of strings for symbols argument' ) if isinstance ( fields , str ) : fields = [ fields ] if range_ not in _TIMEFRAME_CHART : raise PyEXception ( 'Range must be in %s' % str ( _TIMEFRAME_CHART ) ) if isinstance ( symbols , str ) : route = 'stock/{}/batch?types={}&range={}&last={}' . format ( symbols , ',' . join ( fields ) , range_ , last ) return _getJson ( route , token , version ) if len ( symbols ) > 100 : raise PyEXception ( 'IEX will only handle up to 100 symbols at a time!' ) route = 'stock/market/batch?symbols={}&types={}&range={}&last={}' . format ( ',' . join ( symbols ) , ',' . join ( fields ) , range_ , last ) return _getJson ( route , token , version )
Batch several data requests into one invocation

    https://iexcloud.io/docs/api/#batch-requests


    Args:
        symbols (list); List of tickers to request
        fields (list); List of fields to request
        range_ (string); Date range for chart
        last (int);
        token (string); Access token
        version (string); API version

    Returns:
        dict: results in json
Batch several data requests into one invocation