FastAPI pagination
Project description
FastAPI Pagination
Installation
# Basic version
pip install fastapi-pagination
# All available integrations
pip install fastapi-pagination[all]
Available integrations:
Example
from fastapi import FastAPI
from pydantic import BaseModel
from fastapi_pagination import Page, add_pagination, paginate
app = FastAPI()
class User(BaseModel):
name: str
surname: str
users = [
User(name='Yurii', surname='Karabas'),
# ...
]
@app.get('/users', response_model=Page[User])
async def get_users():
return paginate(users)
add_pagination(app)
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
fastapi-pagination-0.7.4.tar.gz
(10.0 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_pagination-0.7.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f01808f5a216b30afab58028bb0c8c19b60109c954951560945e8bd21c63cd5d |
|
MD5 | f586791c795e26f81a2426df1a428399 |
|
BLAKE2b-256 | ce205696e6728dc1b0e2f6356ddf86f285c6e305f0641737673796ce9d799160 |