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 details)
Built Distribution
File details
Details for the file apistar-pagination-0.3.0.tar.gz
.
File metadata
- Download URL: apistar-pagination-0.3.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
202049ba6823e9ed96c6fd22f2b74c681df1a95c596671df9ef0e24c61fc5889
|
|
MD5 |
92f142d412d41186c308cdf3bd2f0b76
|
|
BLAKE2b-256 |
4d465fbff7ecf8daba3b96016579b0ac9cde18480b5b8368e85ff45e38fcb0ea
|
File details
Details for the file apistar_pagination-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: apistar_pagination-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fed0128a8b1945eab3d068f791eaeed41db2d86b4f109b16271b1438b042958a
|
|
MD5 |
896421a59c1287a16c6c47d7d7806cc9
|
|
BLAKE2b-256 |
499bea162ccc268ebf96b065e643258f29c7832d4cfebbfa0da85fb0571dabb6
|