Skip to main content

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.

CI

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.json with 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 patchelf on 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 documentation
  • tests/ — 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oxyroute-0.1.0.tar.gz (107.6 kB view details)

Uploaded Source

Built Distributions

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

oxyroute-0.1.0-cp310-abi3-win_amd64.whl (835.8 kB view details)

Uploaded CPython 3.10+Windows x86-64

oxyroute-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (997.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

oxyroute-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (898.1 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

oxyroute-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl (945.4 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file oxyroute-0.1.0.tar.gz.

File metadata

  • Download URL: oxyroute-0.1.0.tar.gz
  • Upload date:
  • Size: 107.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oxyroute-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c5659211cdeef3efbdd437202788f0c8a448e0bc71c9d62130aa54236508d51
MD5 446778b3bbf1de4d1b1d2b8cf9e343e5
BLAKE2b-256 e787e3461a9c272b1c6c607acdf9760e596c691834ad32afadec204e1be51984

See more details on using hashes here.

File details

Details for the file oxyroute-0.1.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: oxyroute-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 835.8 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for oxyroute-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 30099908df211607beb62f72057c46b7480b70b037a35619e021a5cd05d828bc
MD5 519520be4289de709b0c6e35e3a6f635
BLAKE2b-256 b4eb86e58efe215a6373046cca43930a2490e1ef72b332e300ab991f33dc1f8a

See more details on using hashes here.

File details

Details for the file oxyroute-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for oxyroute-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a59c4255d96511e0dafffab1f920ada4908c557844f3faca61e9e491b8434ec
MD5 368ed0241e4409bbcaee657feddce0ff
BLAKE2b-256 cc97d64018a3c5296090f939e74fce7f9bab1cc9beb08c1bb1159a45ef37b2cc

See more details on using hashes here.

File details

Details for the file oxyroute-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oxyroute-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f4fb7d1a1ea7ac17ca77f1b2b36e206f5b008599f1c3f128bfdf0c9087788223
MD5 1711e3c68e73a64b14e87c81a6f74020
BLAKE2b-256 873ddb28e7d3bfb1643ddf8d49506c5c458630aaa7c5884336fb961ec6873f41

See more details on using hashes here.

File details

Details for the file oxyroute-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for oxyroute-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a9e240f4db59e27fcd60038f94f54d4855ae0bd9f2186687268123bfe74a5e9d
MD5 07e39961cec18da9e9019a6ab10885d3
BLAKE2b-256 26491db39edcc12091cb20620b9b97a7d1cdf672f80c875bc77eb63b59a08a17

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