singer_sdk.pagination.BaseHATEOASPaginator

class singer_sdk.pagination.BaseHATEOASPaginator

Paginator class for APIs supporting HATEOAS links in their response bodies.

HATEOAS stands for “Hypermedia as the Engine of Application State”. See https://en.wikipedia.org/wiki/HATEOAS.

This paginator expects responses to have a key “next” with a value like “https://api.com/link/to/next-item”.

__init__(*args: Any, **kwargs: Any) None

Create a new paginator.

Parameters
  • args – Paginator positional arguments for base class.

  • kwargs – Paginator keyword arguments for base class.

get_next(response: Response) ParseResult | None

Get the next pagination token or index from the API response.

Parameters

response – API response object.

Returns

A parsed HATEOAS link if the response has one, otherwise None.

abstract get_next_url(response: Response) str | None

Override this method to extract a HATEOAS link from the response.

Parameters

response – API response object.