Skip to main content

FastAPI pagination

Project description

FastAPI Pagination

License codecov codecov Downloads PYPI PYPI

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


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)

Uploaded Source

Built Distribution

fastapi_pagination-0.7.4-py3-none-any.whl (15.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page