def get_num_pages(api_url, url, page_size=None):
    query = {'url': url,
             'showNumPages': True}

    if page_size:
        query['pageSize'] = page_size

    query = urllib.urlencode(query)

    # Get the result
    session = requests.Session()
    r = session.get(api_url + '?' + query)
    pages_info = r.json()

    if isinstance(pages_info, dict):
        return pages_info['pages']
    elif isinstance(pages_info, int):
        return pages_info
    else:
        msg = 'Num pages query returned invalid data: ' + r.text
        raise Exception(msg)
Get a blob object by name.
dataset/ETHPy150Open ikreymer/cdx-index-client/cdx-index-client.py/get_num_pages--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/storage/bucket.py/Bucket.get_blob