Skip to main content

Python object paginator

Project description

Example of usage:

from paginator import core

object_list = [obj_1, obj_2, obj_n...]

paginator = core.paginate(object_list, page_limit=50, start_page=0)

Get current page response:

paginator.response

When calling next or previous page you can access new page data with paginator.response

Get next page:

paginator.get_next()

Get previous page:

paginator.get_previous()

Get response of requested page number:

paginator.get_page_response(page_number=0)

Total pages:

paginator.total_pages

Count objects:

paginator.total

Iterating over paginator pages

for page in paginator:
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-paginator-0.0.2.tar.gz (18.2 kB view hashes)

Uploaded Source

Built Distribution

python_paginator-0.0.2-py3-none-any.whl (20.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page