Skip to main content

Automatic filterable, sortable, paginated query parameters for FastAPI, derived from your Pydantic models.

Project description

fast-pager

Turn your Pydantic models into filterable, sortable, paginated FastAPI query parameters — automatically.

fast-pager reads the Pydantic models you already use in your FastAPI routes and generates type-safe query parameters for filtering, sorting and pagination. Those parameters show up in your OpenAPI docs for free, and compile down to a real database query (MongoDB first, more backends later).

class User(BaseModel):
    name: str
    age: int

@app.get("/users")
async def list_users(q: FilterQuery[User] = FilterDepends(User)):
    return await db.users.find(q.to_mongo()).to_list(None)

A request to:

GET /users?name__contains=ana&age__gte=21&age__lt=65&sort=-age&limit=20

…compiles to:

{"name": {"$regex": "ana"}, "age": {"$gte": 21, "$lt": 65}}
# sort=[("age", -1)], skip=0, limit=20
# (values in `contains` filters are regex-escaped before compilation)

…and every one of those parameters is documented, validated and typed in /docs.


Built with AI

This project is designed and developed with the assistance of AI (Anthropic's Claude Code). Design documents and code are AI-generated and human-reviewed.


Status

fast-pager is in the design phase. The package is published to PyPI as a placeholder (0.0.x) to reserve the name — it contains no functionality yet. Don't depend on it until 0.1.

Releasing (maintainers)

Releases are fully automated. From a clean main:

./scripts/release.sh patch     # or minor / major

The script bumps the version in pyproject.toml (via uv version --bump), commits, tags v<version>, and pushes. The tag triggers release.yml, which:

  1. verifies the tag matches the pyproject.toml version,
  2. runs the full CI matrix,
  3. builds with uv build and publishes to PyPI via Trusted Publishing (OIDC — no API tokens),
  4. creates the GitHub Release with generated notes.

fast_pager.__version__ reads from package metadata, so the version lives in exactly one place.


Design documents

This repository currently contains only the product design — no implementation yet. Read the docs in order:

# Document What it covers
00 Overview & Vision The problem, goals, non-goals, naming, guiding principles
01 Developer Experience API surface options explored, the recommended ergonomics
02 Type & Operator System Which Python types we support, their operators, compound types, per-field configurability
03 Architecture The layered pipeline, the filter AST, the FastAPI signature trick
04 Backend Roadmap Mongo today, generalizing to any database tomorrow
05 Roadmap & Release Plan Phased path to a clean 1.0 on PyPI

Start with 00-overview.md.

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

fast_pager-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_pager-0.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file fast_pager-0.0.1.tar.gz.

File metadata

  • Download URL: fast_pager-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fast_pager-0.0.1.tar.gz
Algorithm Hash digest
SHA256 523688824aa26787b57e636ede7be90bd5e5a9e1ac7d84bfbcc1dec834de5a57
MD5 180f47dddb53867850db824d448acb01
BLAKE2b-256 9c91de194449aea9bac681a99e6290fe6a653e3bdfd768ca4d1e27a71f77856d

See more details on using hashes here.

File details

Details for the file fast_pager-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: fast_pager-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fast_pager-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a13f745711982e9d6c324dfa4663eaa6694dd09cc808b6c63456bbf5a8b22ce
MD5 39dc9f64c0136dcf6afa89747d4e37c5
BLAKE2b-256 099af7fbc5527f86c3fe4bbc803e810250ed4a1248ca430940f1eb5ae57c73bf

See more details on using hashes here.

Supported by

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