def get_dataset(socrata_client, dataset_id, page_size=5000):
    """Iterate over a datasets pages using the Socrata API"""
    page_num = 0
    more_pages = True
    while more_pages:
        api_data = socrata_client.get(dataset_id, limit=page_size, offset=
            page_size * page_num)
        if len(api_data) < page_size:
            more_pages = False
        page_num += 1
        yield api_data
