Skip to main content

Korvex

CI License: MIT

A high-performance router for Python, backed by a Rust radix tree — with an optional, equally lightweight ASGI layer for actually hosting it.

Korvex is deliberately small: the core is a router and nothing else. It matches a path to an opaque handler name; it never calls your code itself. Everything above that (an ASGI App, Response/Headers helpers, route groups) is a thin, optional layer built on top — you can use as much or as little of it as you want.

Why

  • Fast routing. A radix tree in Rust, exposed through PyO3, with an allocation-free matching path (no Vec of segments, no String clones for captured params). Benchmarked at 10×–1000× faster route lookups than Flask/Django/Starlette's own routers (see benches/).
  • Small surface. Router deals only in opaque strings — a path pattern in, a handler name + params out. It doesn't know what a Response is, and never will; that keeps the matching engine simple and independently testable (src/router/engine/, zero PyO3 dependency).
  • Host it or don't. korvex.App is a real ASGI application (works with uvicorn, Granian, hypercorn, ...) if you want to actually serve requests — but it's a couple hundred lines of pure Python on top of the router (korvex/app.py), not a requirement.

Install

pip install korvex
# or, to also pull in a server for the ASGI examples:
pip install "korvex[serve]"

Building from source requires maturin and a Rust toolchain — see CONTRIBUTING.md.

Quickstart

from korvex import Router

router = Router()
router.get("/users/{id:int}", "get_user")
router.post("/users", "create_user")

router.match_route("/users/42")
# -> ("get_user", {"id": "42"}, [])

Router never calls your code — match_route just tells you which opaque handler name matched. Dispatching that to real code is up to you, or use App to have Korvex do it:

from korvex import App, Response

app = App()

@app.get("/users/{id:int}")
def get_user(request, id):
    return Response.json({"id": id})

# uvicorn mymodule:app

See examples/ for the router alone, route groups with middleware, and the full ASGI app — each one runnable as-is.

Features

  • Static, dynamic ({id}), constrained ({id:int}, {id:uuid}), and wildcard (*filepath) path segments
  • Per-route HTTP methods, with 405 Method Not Allowed (not a bare 404) when a path matches but the method doesn't
  • Route groups with shared prefixes and middleware (router.group(...))
  • Route introspection (router.routes()) and removal (router.remove_route(...))
  • An optional ASGI App: decorator-based handler/middleware registration, sync or async, zero extra dependencies
  • Fully typed (korvex/py.typed, .pyi stubs for the compiled Router)

Performance

Routing lookups beat Flask/Django/Starlette by 10×–1000× (benches/bench_router.py). Once wired into a full ASGI app, the framework-level gap narrows — most of the per-request cost becomes Python-level handler/response work, common to any framework — but the server you host it with matters far more than the framework: swapping uvicorn for a Rust-based ASGI server (e.g. Granian) measured roughly 5× the throughput in this project's own testing, with zero code changes, since App speaks plain ASGI. See benches/bench_app.py for the methodology; treat any specific numbers as a starting point for your own measurements, not a guarantee — they depend heavily on hardware, Python version, and workload.

Development

git clone https://github.com/3d3n-pyc/korvex
cd korvex
uv run maturin develop --release
uv run pytest

See CONTRIBUTING.md for the full checklist.

License

MIT

Metadata

Release files for korvex 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for korvex 0.1.1
File Size Uploaded Provenance Actions
korvex-0.1.1.tar.gz 117.5 kB With provenance Details for korvex-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for korvex 0.1.1
File Actions
korvex-0.1.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for korvex-0.1.1-cp39-abi3-win_amd64.whl
korvex-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for korvex-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
korvex-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for korvex-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
korvex-0.1.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for korvex-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
korvex-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for korvex-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 1.5 MB

Release files / korvex-0.1.1.tar.gz

Download URL korvex-0.1.1.tar.gz
Size 117.5 kB
Tags Source
SHA-256 checksum
How to use checksums
875c4969a1a564e78195263446428fc4158219f426926a8c614489152cd00957
BLAKE2b-256 checksum
How to use checksums
797d55eed07d89a4af2c00bf555a1b77a76b1894a89932bb2c67dc4e065b1d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / korvex-0.1.1-cp39-abi3-win_amd64.whl

Download URL korvex-0.1.1-cp39-abi3-win_amd64.whl
Size 180.3 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7c652a26f685e9a051d39680f294c8e314d95bd9872302e2cc49bb315da4d883
BLAKE2b-256 checksum
How to use checksums
55222e0be8f447f0e3c84582405029d5b923ab742a37990251d2c3f229a59fd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / korvex-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL korvex-0.1.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 326.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
493e5dce3cb7c26cb0b4b50ebb8bc16e8bd3107ea1d1445e3f268bc7f8de3cdd
BLAKE2b-256 checksum
How to use checksums
49b9a5a0b29a5e4113863a2cbcb77deba34caeec4337a345755bcf9e2bbc138a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / korvex-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL korvex-0.1.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 320.4 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2cab813547e44a200a82c710b96243c5c2af501852f2dc3efd185acd29cf2033
BLAKE2b-256 checksum
How to use checksums
85c127d9cefce85890b984a391651008200e0784bfdd38a0ae32dd79a0d477c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / korvex-0.1.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL korvex-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Size 284.9 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
568e77b4daca5cc5c0f8f1be37aa7a436bc80c70fe501a71760d047e96617df4
BLAKE2b-256 checksum
How to use checksums
ddc4d2c3ad4c50534c55f964fd3d834d34d16b79155a793e7645adfc11656582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / korvex-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL korvex-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 284.7 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
25694ddffe2a2c2c47a6f1a593528fa9245363925be4db0e65b6fc3fefc67f38
BLAKE2b-256 checksum
How to use checksums
38a7a0b3cc908f30659a16aa33b741a3023b96e10f246095136c1fab325c9fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for korvex 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for korvex-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page