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.9.2.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_pagination-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f4ec93e379b28ffc47ea834256063fd76ce842d1c9589c5744d960a1543efe |
|
MD5 | 7f3920a891687f99d8806915245d8681 |
|
BLAKE2b-256 | 35a63ce17891621e8cef6f4e3cf70c9acdacb8c67e06adc2972e2e3bfe0f781c |