Metadata-Version: 2.4
Name: fastapi-restkit
Version: 0.1.0
Summary: Pagination utilities for FastAPI with SQLModel ORM
Keywords: fastapi,pagination,sqlmodel,rest,api,toolkit
Author: Fernando Cacenot
Author-email: Fernando Cacenot <cacenot@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Dist: fastapi>=0.100.0
Requires-Dist: sqlmodel>=0.0.14
Requires-Dist: pytest>=7.0.0 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
Requires-Dist: httpx>=0.24.0 ; extra == 'dev'
Requires-Dist: ruff>=0.4.0 ; extra == 'dev'
Requires-Dist: mypy>=1.0.0 ; extra == 'dev'
Requires-Python: >=3.10
Project-URL: Homepage, https://github.com/cacenot/fastapi-restkit
Project-URL: Documentation, https://github.com/cacenot/fastapi-restkit#readme
Project-URL: Repository, https://github.com/cacenot/fastapi-restkit
Project-URL: Issues, https://github.com/cacenot/fastapi-restkit/issues
Provides-Extra: dev
Description-Content-Type: text/markdown

# FastAPI RestKit

[![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Pagination utilities for FastAPI with SQLModel ORM.

## Features

- 🚀 **Easy pagination** for SQLModel queries
- 📦 **Generic response models** with type hints
- ⚡ **FastAPI dependencies** ready to use
- 🔍 **Async support** out of the box

## Installation

```bash
pip install fastapi-restkit
```

Or with uv:

```bash
uv add fastapi-restkit
```

## Quick Start

```python
from fastapi import FastAPI, Depends
from sqlmodel import Session
from fastapi_restkit import PaginationParams, paginate, PaginatedResponse

app = FastAPI()

@app.get("/items", response_model=PaginatedResponse[Item])
async def list_items(
    session: Session = Depends(get_session),
    pagination: PaginationParams = Depends(),
):
    return await paginate(session, select(Item), pagination)
```

## Development

### Setup

```bash
# Clone the repository
git clone https://github.com/cacenot/fastapi-restkit.git
cd fastapi-restkit

# Install dependencies with uv
uv sync --dev

# Run tests
uv run pytest

# Run linter
uv run ruff check .

# Run formatter
uv run ruff format .
```

### Project Structure

```
fastapi-restkit/
├── src/
│   └── fastapi_restkit/
│       ├── __init__.py
│       ├── pagination.py     # Core pagination logic
│       ├── models.py         # Response models
│       └── dependencies.py   # FastAPI dependencies
├── tests/
├── docs/
└── pyproject.toml
```

## License

MIT License - see [LICENSE](LICENSE) for details.
