Pagination tools for API Star.
Project description
API Star Pagination
- Version: 0.1.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 = ... # Get your whole collection
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 = ... # Get your whole collection
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.1.0.tar.gz
(14.5 kB
view hashes)
Built Distribution
Close
Hashes for apistar_pagination-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 229f05de3ef7a319ae1c888a025152b2edba70f289321f6d5ee74055ad6c4a56 |
|
MD5 | 44b22c6809e65debbf780e7229139930 |
|
BLAKE2b-256 | 626f3fceee22b43d6ffd119da29b3d5038b42baaff2b635130e12a96cbe11e93 |