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 backendsType-safe inference –
OffsetParamsproducesOffsetPage,CursorParamsproducesCursorPageDeclarative filtering –
FilterSpec, composableAnd/Orgroups, 20 operatorsSorting and search –
SortSpecandSearchSpecwith fuzzy matchingFastAPI dependencies –
OffsetDep,CursorDep,FilterDep,SortDep,SearchDepPipeline composition – filter, sort, search, then paginate in one call
Minimum Requirements
Python 3.11+
pydantic (core dependency)
Optional Dependencies
Feature |
Installation |
Provides |
|---|---|---|
SQLAlchemy |
|
Database pagination + cursor/keyset |
Search |
|
No-op compat alias (fuzzy search is native, no extra needed) |
FastAPI |
|
FastAPI dependency injection |
Fast |
|
msgspec-backed pages (near-zero overhead) |
All |
|
Everything above |
Next Steps
Install pypaginate with your preferred extras
Follow the Quick Start for basic usage
Explore First Steps with filtering, sorting, and search