pyinaturalist.pagination¶
Summary¶
|
Decorator that adds auto-pagination support, invoked by passing |
|
Log the estimated total number of requests and rate-limiting delay, and show a warning if the request is too large |
|
Get all pages of a multi-page request. |
|
Attempt to get as many results as possible from the places autocomplete endpoint. |
Module Contents¶
- pyinaturalist.pagination.add_paginate_all(method='page')¶
Decorator that adds auto-pagination support, invoked by passing
page='all'
to the wrapped API function.
- pyinaturalist.pagination.estimate_request_size(total_results)¶
Log the estimated total number of requests and rate-limiting delay, and show a warning if the request is too large
- pyinaturalist.pagination.paginate_all(api_func, *args, method='page', **params)¶
Get all pages of a multi-page request. Explicit pagination parameters will be overridden.
- Parameters
Note on pagination by ID, from the iNaturalist documentation: _’The large size of the observations index prevents us from supporting the page parameter when retrieving records from large result sets. If you need to retrieve large numbers of records, use the
per_page
andid_above
orid_below
parameters instead.’_
- pyinaturalist.pagination.paginate_autocomplete(api_func, *args, **params)¶
Attempt to get as many results as possible from the places autocomplete endpoint. This is necessary for some problematic places for which there are many matches but not ranked with the desired match(es) first.
This works based on different rankings being returned for order_by=area. No other fields can be sorted on, and direction can’t be specified, but this can at least provide a few additional results beyond the limit of 20.