Metadata-Version: 2.1
Name: fastapi-pagination
Version: 0.7.0
Summary: FastAPI pagination
Home-page: https://github.com/uriyyo/fastapi-pagination
License: MIT
Author: Yurii Karabas
Author-email: 1998uriyyo@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Provides-Extra: all
Provides-Extra: asyncpg
Provides-Extra: databases
Provides-Extra: gino
Provides-Extra: orm
Provides-Extra: ormar
Provides-Extra: sqlalchemy
Provides-Extra: tortoise
Requires-Dist: SQLAlchemy (>=1.3.20,<2.0.0); extra == "gino" or extra == "sqlalchemy" or extra == "asyncpg" or extra == "all"
Requires-Dist: asyncpg (==0.22.0); extra == "asyncpg" or extra == "all"
Requires-Dist: databases[mysql,postgresql,sqlite] (>=0.4.0,<0.5.0); extra == "databases" or extra == "orm" or extra == "all"
Requires-Dist: fastapi (>=0.61.2)
Requires-Dist: gino[starlette] (>=1.0.1,<2.0.0); extra == "gino" or extra == "all"
Requires-Dist: orm (>=0.1.5,<0.2.0); extra == "orm" or extra == "all"
Requires-Dist: ormar (>=0.9.8,<0.10.0); extra == "ormar" or extra == "all"
Requires-Dist: pydantic (>=1.7.2,<2.0.0)
Requires-Dist: sqlalchemy-stubs (>=0.4,<0.5); extra == "gino" or extra == "sqlalchemy" or extra == "all"
Requires-Dist: tortoise-orm[aiomysql,asyncpg,aiosqlite] (>=0.16.18,<0.17.0); extra == "tortoise" or extra == "all"
Requires-Dist: typing-extensions (>=3.7.4,<4.0.0)
Project-URL: Repository, https://github.com/uriyyo/fastapi-pagination
Description-Content-Type: text/markdown

# FastAPI Pagination

[![License](https://img.shields.io/badge/License-MIT-lightgrey)](/LICENSE)
[![codecov](https://github.com/uriyyo/fastapi-pagination/workflows/Test/badge.svg)](https://github.com/uriyyo/fastapi-pagination/actions)
[![codecov](https://codecov.io/gh/uriyyo/fastapi-pagination/branch/main/graph/badge.svg?token=QqIqDQ7FZi)](https://codecov.io/gh/uriyyo/fastapi-pagination)
[![Downloads](https://pepy.tech/badge/fastapi-pagination)](https://pepy.tech/project/fastapi-pagination)
[![PYPI](https://img.shields.io/pypi/v/fastapi-pagination)](https://pypi.org/project/fastapi-pagination/)
[![PYPI](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## Installation

```bash
# Basic version
pip install fastapi-pagination

# All available integrations
pip install fastapi-pagination[all]
```

Available integrations:

* [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy)
* [gino](https://github.com/python-gino/gino)
* [databases](https://github.com/encode/databases)
* [ormar](http://github.com/collerek/ormar)
* [orm](https://github.com/encode/orm)
* [tortoise](https://github.com/tortoise/tortoise-orm)

## Example

```python
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)
```

