pager

client.pager

Pagination.

Classes

Name Description
Pager Adapts OpenAPI pagination to the Python iterator protocol.

Pager

client.pager.Pager(func, *args, **kwargs)

Adapts OpenAPI pagination to the Python iterator protocol.

TileDB API listings consists of a sequence of “pages”, or batches, of lists of assets. A Pager instance represents one page of the listing. It also serves as an iterator over all items from that page to the last page, and it can be indexed to get all or a subset of items from that page to the last page.

Attributes

Name Type Description
func callable A function that takes at least a page keyword argument and returns a page of results. The signature of func is (*args, page: int, **kwargs) -> list.
args tuple Positional arguments to be passed to func.
kwargs dict Keyword arguments to be passed to func.
page int The number of the current listing page.
response object The value of the current listing page.

Notes

Negative indexing is based on an initial snapshot of the total number of items in a result set. If items are added or removed during pagination, the indexing may no longer be correct.

Methods

Name Description
call_page Call for a page of results to store.
call_page
client.pager.Pager.call_page(page)

Call for a page of results to store.