Skip to main content

Pagination tools for API Star.

Project description

API Star Pagination

Build Status codecov PyPI version

  • Version: 0.3.0
  • Status: Production/Stable
  • Author: José Antonio Perdiguero López

Pagination tools for API Star.

Features

  • Page number pagination.
  • Limit-offset pagination.

Quick start

Install API star Pagination:

pip install apistar-pagination

Use paginated response in your views:

Page number pagination

from apistar_pagination import PageNumberResponse

def page_number(page: http.QueryParam, page_size: http.QueryParam) -> typing.List[int]:
    collection = range(10)  # Get your whole collection instead of a list of numbers

    return PageNumberResponse(page=page, page_size=page_size, content=collection)

Limit-offset pagination

from apistar_pagination import LimitOffsetResponse

def limit_offset(offset: http.QueryParam, limit: http.QueryParam) -> typing.List[int]:
    collection = range(10)  # Get your whole collection instead of a list of numbers

    return LimitOffsetResponse(offset=offset, limit=limit, content=collection)

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

apistar-pagination-0.3.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

apistar_pagination-0.3.0-py3-none-any.whl (40.6 kB view details)

Uploaded Python 3

File details

Details for the file apistar-pagination-0.3.0.tar.gz.

File metadata

File hashes

Hashes for apistar-pagination-0.3.0.tar.gz
Algorithm Hash digest
SHA256 202049ba6823e9ed96c6fd22f2b74c681df1a95c596671df9ef0e24c61fc5889
MD5 92f142d412d41186c308cdf3bd2f0b76
BLAKE2b-256 4d465fbff7ecf8daba3b96016579b0ac9cde18480b5b8368e85ff45e38fcb0ea

See more details on using hashes here.

File details

Details for the file apistar_pagination-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for apistar_pagination-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fed0128a8b1945eab3d068f791eaeed41db2d86b4f109b16271b1438b042958a
MD5 896421a59c1287a16c6c47d7d7806cc9
BLAKE2b-256 499bea162ccc268ebf96b065e643258f29c7832d4cfebbfa0da85fb0571dabb6

See more details on using hashes here.

Supported by

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