FastAPI pagination
Project description
FastAPI Pagination
Installation
Basic version
pip install fastapi-pagination
Gino
integration
pip install fastapi-pagination[gino]
SQLAlchemy
integration
pip install fastapi-pagination[sqlalchemy]
Example
from fastapi import FastAPI, Depends
from pydantic import BaseModel
from fastapi_pagination import PaginationParams, Page
from fastapi_pagination.paginator import 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(params: PaginationParams = Depends()):
return paginate(users, params)
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
Built Distribution
Close
Hashes for fastapi_pagination-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d20796d05c571b702a9b2b19fd8252903b34e8ba47567080ba9cf20b7a840af |
|
MD5 | 1969850ec6febef987493c7e0b297a85 |
|
BLAKE2b-256 | 00f7aceea9b711b1fa3512b70aac15b9503e7279e983e996a66dcb7a900e3cdd |