RSGI-first web framework: routing, JSON, and JWT in Rust (PyO3), Python handlers
Project description
OxyRoute
RSGI-first web toolkit: HTTP routing, JSON handling, and HS* JWT validation on a Rust hot path (PyO3 + Maturin), with your business logic in ordinary Python handlers. Pair it with Granian using --interface rsgi for the intended stack.
Features
- RSGI entrypoint (
async def __rsgi__(scope, protocol)) compatible with Granian’s RSGI implementation - Routing via matchit (path parameters like
/users/:id) - JSON bodies parsed in Rust; successful values passed to handlers as kwargs
- JWT (HMAC) verification on the Rust path before your handler runs (
require_jwt, HS256/384/512) - Optional
GET /openapi.jsonwith a minimal OpenAPI-style document - Dependencies: linear list of named factories (
Depends, sync or async) passed as kwargs - Optional ASGI 3 bridge:
async def __call__(scope, receive, send)for servers that speak ASGI (see docs/asgi.md) - Native extension wheel (abi3) for Python ≥ 3.10
Full documentation: docs/index.md
Requirements
- Python 3.10 or newer
- For running a pre-built wheel: only
pip(and a server such as Granian) - For building from source: Rust toolchain + maturin (and
patchelfon some Linux setups is recommended for best wheel layout; see docs/installation.md)
Install
From PyPI (when published):
pip install oxyroute
Development / optional test dependencies:
pip install "oxyroute[dev]"
From a git checkout (builds the native module):
pip install maturin
maturin develop
# or: pip install .
Quick start (RSGI + Granian)
examples/rsgi_app.py:
from oxyroute import App
app = App(title="Hello OxyRoute")
@app.get("/")
def root() -> str:
return "OxyRoute RSGI OK"
@app.get("/hello/:name")
def hello_name(**kwargs) -> str:
return f"Hello, {kwargs.get('name', '')}"
Run (from the repo, after maturin develop or an editable install):
granian --interface rsgi examples.rsgi_app:app
Per-worker setup (__rsgi_init__) is shown in examples/rsgi_lifespan_app.py and docs/rsgi.md.
ASGI and other servers are covered in docs/asgi.md.
Project layout
oxyroute/— Python package (App,Depends, optional ASGI bridge)src/— Rust extension (_oxyroute, routing, dispatch, JWT helpers)docs/— detailed English documentationtests/— pytest suite (run from a temp directory or an installed wheel so the source tree does not shadow the package; see docs/development.md)
Contributing
See CONTRIBUTING.md (build, tests, issue backlog, batch gh script).
License
This project is licensed under the MIT License.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oxyroute-0.2.0.tar.gz.
File metadata
- Download URL: oxyroute-0.2.0.tar.gz
- Upload date:
- Size: 142.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf520353a4eae7879d91f328e66c1dac955569b57dcc89bdcacf4fcd98a18c4
|
|
| MD5 |
13bbd5998f337ac22533b9a9455addc1
|
|
| BLAKE2b-256 |
7d01a2f5b40f8373e31b9e93886cbcd06077575bf6dcf220b3f4590a4768fbef
|
File details
Details for the file oxyroute-0.2.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: oxyroute-0.2.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab409aba568cd87ac1acd4c2fa1fa8eb8658de6fa80e6c3dc63056a335568c28
|
|
| MD5 |
0461d59c0c8e5238b9ce63dee55ea852
|
|
| BLAKE2b-256 |
e365a21ac20931c36be0e70440122b24390d8ae1ab770e5c7218f996cb63c3d2
|
File details
Details for the file oxyroute-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: oxyroute-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5781f470dc03ae95a33c602a36f252af7341747333ea3b4542553d9b2fa8b6e5
|
|
| MD5 |
4b919718400bcd77cd697f7a40b5d38d
|
|
| BLAKE2b-256 |
6891ba101241a07cd1941fba868c349c367816c37d418a3644d3040d3aa5aa39
|
File details
Details for the file oxyroute-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: oxyroute-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce4d7f10a27f0d8399b90ac996f761b53ec95ea245159623791783368be5036d
|
|
| MD5 |
d1f9ce8fc77bbf70bd385ff7fa337e96
|
|
| BLAKE2b-256 |
5083bb3e7ca56ad074a93afd8ec4f7c2f198b0183ae16b985eabd1402cd189b8
|
File details
Details for the file oxyroute-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: oxyroute-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2814fc3d629e959b271a2ab63f75454cb9abab571b8868df647bd3b436b2cf94
|
|
| MD5 |
7d38c08c7bbec1e38307753f2ae06497
|
|
| BLAKE2b-256 |
098c96234ef568f515cb2f6e66f2aeee79066b859d9997c2903fdd4b4582e6e4
|