You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

apistar-pagination

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apistar-pagination

Pagination tools for API Star.

0.4.0
pipPyPI
Maintainers
1

API Star Pagination

Build Status codecov PyPI version

  • Version: 0.4.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)

Keywords

apistar

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts