Pagination tools for API Star.
Project description
API Star Pagination
- 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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for apistar_pagination-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fed0128a8b1945eab3d068f791eaeed41db2d86b4f109b16271b1438b042958a |
|
MD5 | 896421a59c1287a16c6c47d7d7806cc9 |
|
BLAKE2b-256 | 499bea162ccc268ebf96b065e643258f29c7832d4cfebbfa0da85fb0571dabb6 |