Getting Started

Welcome to pypaginate! This section will help you get up and running quickly.

What is pypaginate?

pypaginate is a modern, framework-agnostic pagination toolkit for Python 3.11+ that provides:

  • Universal paginate() function – one call for lists, SQLAlchemy queries, and custom backends

  • Type-safe inferenceOffsetParams produces OffsetPage, CursorParams produces CursorPage

  • Declarative filteringFilterSpec, composable And/Or groups, 20 operators

  • Sorting and searchSortSpec and SearchSpec with fuzzy matching

  • FastAPI dependenciesOffsetDep, CursorDep, FilterDep, SortDep, SearchDep

  • Pipeline composition – filter, sort, search, then paginate in one call

Quick Navigation

Installation

Install pypaginate and optional dependencies

Installation
Quick Start

Get paginating in 5 minutes

Quick Start
First Steps

Filtering, sorting, and search examples

First Steps

Minimum Requirements

  • Python 3.11+

  • pydantic (core dependency)

Optional Dependencies

Feature

Installation

Provides

SQLAlchemy

pypaginate[sqlalchemy]

Database pagination + cursor/keyset

Search

pypaginate[search]

No-op compat alias (fuzzy search is native, no extra needed)

FastAPI

pypaginate[fastapi]

FastAPI dependency injection

Fast

pypaginate[fast]

msgspec-backed pages (near-zero overhead)

All

pypaginate[all]

Everything above

Next Steps

  1. Install pypaginate with your preferred extras

  2. Follow the Quick Start for basic usage

  3. Explore First Steps with filtering, sorting, and search