Async Pagination

class deezer.asyncio.AsyncPaginatedList(client, base_path, parent=None, params=None)

Async paginated response from the API, supporting async iteration.

Instances should be created via the create() classmethod, which fetches the first page of results eagerly.

Parameters:
  • client (AsyncClient)

  • base_path (str)

  • parent (AsyncResource | None)

  • params (dict | None)

async classmethod create(client, base_path, parent=None, params=None)

Create an AsyncPaginatedList and fetch the first page.

Parameters:
  • client (AsyncClient)

  • base_path (str)

  • parent (AsyncResource | None)

  • params (dict | None)

Return type:

AsyncPaginatedList[ResourceType]

property total: int

The total number of items in the list, mirroring what Deezer returns.

async get(index)

Get an item by index.

Parameters:

index (int)

Return type:

ResourceType

async collect()

Fetch all pages and return the full list of items.

Return type:

list[ResourceType]