Skip to main content

Rust-powered Python backend framework with fast routing.

Project description

vyro

CI Release PyPI Python Versions License

Vyro is a backend framework that combines Python developer experience with a Rust-native execution engine.

Why Vyro

  • Rust-native runtime for high throughput and low overhead.
  • Pythonic routing and handler authoring.
  • Async-first handler model (async def only).
  • RBAC/ABAC authorization core primitives.
  • API key manager and rotation hook primitives.
  • Security audit log event primitives.
  • Memory/Redis cache backend primitives.
  • Cache invalidation hook primitives.
  • Response cache TTL policy primitives.
  • Canary routing control primitives.
  • Blue-green rollout helper primitives.
  • Safe runtime config hot-reload primitives.
  • Idempotency-key middleware primitives.
  • Structured release automation (tag -> changelog -> PyPI -> GitHub Release).
  • Native file-path response streaming (return pathlib.Path from handler).
  • OpenAPI 3.1 + JSON schema generation from route handlers.
  • Priority-aware middleware ordering primitives.
  • Route-group conditional middleware registration.
  • Automatic correlation-id injection on request context.
  • Structured JSON logging primitives for CLI/runtime output.
  • Production-readiness doctor checks with strict mode for CI gates.
  • API contract lint integration via python -m scripts.dev.check.
  • Benchmark smoke via python -m scripts.dev.bench.
  • CI benchmark regression gate with baseline comparison.
  • vyro new architecture templates (minimal, service, hexagonal).
  • Monorepo workspace support via vyro workspace init|status.
  • Configurable log sampling policy (VYRO_LOG_SAMPLE_INFO/WARN/ERROR).
  • Sensitive field redaction in logs (VYRO_LOG_REDACT_KEYS).
  • OpenTelemetry-friendly trace span exporter with traceparent propagation.
  • Prometheus metrics registry primitives (vyro_requests_total baseline).
  • Built-in latency tracker with p50/p95/p99 quantiles.
  • Per-route throughput counters for method/path traffic visibility.
  • Health probe primitives for liveness/readiness/startup checks.
  • Graceful shutdown policy primitives with timeout/drain controls.
  • Runtime backpressure controller for inflight request limits.
  • Per-route concurrency limiter for hotspot endpoint control.
  • Global token-bucket rate limiter with burst support.
  • Multi-key rate limiter for compound identities (IP/user/token).
  • Native async outbound HTTP client primitive.
  • ETag generation and conditional-request primitives.
  • JWT auth guard primitives (issue/verify/authorize).
  • Background jobs runtime primitives.
  • Cron scheduler primitives.
  • HTTP/2 stream helper primitives.
  • gRPC gateway mapping/transcoding foundation primitives.
  • Streaming multipart upload collector primitives.
  • High-performance multipart parser primitives.
  • Migration runner primitives and vyro migrate CLI.
  • Content negotiation primitives for Accept header matching.
  • OAuth2/OIDC helper primitives.
  • Static file serving primitives with safe path resolution.
  • Response compression primitives with speed/balanced/size profiles.
  • CORS policy profile primitives (strict, standard, permissive).
  • CSRF token issue/verify primitives.
  • DB connection pool manager primitives.
  • Dead-letter queue and retry primitives.
  • Task trace correlation primitives for background jobs.
  • Typed internal event bus primitives.
  • CQRS scaffolding primitives (command/query bus).
  • Transactional outbox pattern helper primitives.
  • Saga orchestration primitives.
  • Multi-tenant isolation model primitives.
  • Tenant-aware routing and config primitives.
  • Feature flag engine primitives for progressive rollout.
  • ABI-stable plugin system primitives.
  • Extension marketplace manifest primitives.
  • Service discovery adapter primitives for multi-service runtime.
  • Kubernetes manifest generator primitives.
  • No-GIL worker tuning primitives.
  • Secrets provider abstraction primitives.
  • Async SQL adapter primitives.
  • Query timeout and slow query log primitives.
  • Schema drift detector primitives.
  • Transaction scope decorator primitives.
  • Outbound circuit-breaker primitive for upstream dependency protection.
  • Outbound bulkhead primitive to isolate dependency pools.
  • Retry policy primitive with exponential backoff and jitter.
  • Timeout budget primitive for end-to-end deadline propagation.
  • First-class SSE response primitive for server-sent events.
  • WebSocket route registry and @app.websocket(...) decorator.

Quickstart

Install from PyPI

pip install "vyro>=0.2.2" --only-binary=:all:

Local development setup

pip install maturin pytest
maturin build --release
pip install --force-reinstall target/wheels/vyro-*.whl
python examples/hello_world.py

Minimal example

from vyro import Context, Vyro

app = Vyro()

@app.get("/")
async def hello(ctx: Context):
    return {"message": "hello from vyro"}

@app.get("/users/:id", version="1")
async def get_user(ctx: Context, id: int):
    return {"id": id}

@app.get("/legacy", deprecated="use /v2/users/:id")
async def legacy(ctx: Context):
    return {"legacy": True}

if __name__ == "__main__":
    app.run(port=8000, workers=2)

Development

Run all core checks locally:

cargo test
python -m pytest tests/py tests/integration -q
maturin build --release

CLI

Vyro ships with an official CLI:

vyro --help
vyro doctor
vyro doctor --strict
vyro new my_service --template service
vyro new my_hex_app --template hexagonal
vyro workspace init platform --apps api,worker --libs common,events
vyro workspace status --root platform
vyro nogil-tune --workload balanced --cpu-count 8 --out nogil_profile.json
vyro k8s --name vyro-api --image ghcr.io/vietrix/vyro:latest --out k8s.yaml
vyro run --app examples.hello_world:app --port 8000
vyro openapi --app examples.hello_world:app --out openapi.json
vyro compat --base openapi-prev.json --target openapi.json
vyro release notes --tag v0.1.0 --out release_notes.md
vyro release changelog --tag v0.1.0 --changelog CHANGELOG.md --out release_notes.md
vyro release assistant --tag v0.1.0 --dist-dir dist --execute

You can also run it as a module:

python -m vyro --help

vyro is the primary end-user command. Use python -m vyro only as a fallback when shell PATH does not expose vyro yet.

Developer automation lives in scripts/dev:

python -m scripts.dev.check
python -m scripts.dev.test
python -m scripts.dev.build --sdist
python -m scripts.dev.bench --suite all --iterations 10000 --out bench.json

Migration (App -> Vyro)

# before
from vyro import App
app = App()

# after
from vyro import Vyro
app = Vyro()

Project structure

  • python/vyro/app: composition root (Vyro) and wiring.
  • python/vyro/api: OpenAPI/JSON schema/compat contracts.
  • python/vyro/runtime: runtime primitives grouped by domain (resilience, security, data, async_ops, edge, platform).
  • rust/src/: native runtime and bridge.
  • tests/: Python, Rust, and integration tests.
  • .github/workflows/: CI and release automation.

See ARCHITECTURE.md for the full module map and request flow.

Community

License

Vyro is licensed under the Apache License 2.0. See LICENSE.

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

vyro-0.2.2.tar.gz (151.6 kB view details)

Uploaded Source

Built Distributions

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

vyro-0.2.2-cp310-abi3-win_amd64.whl (830.9 kB view details)

Uploaded CPython 3.10+Windows x86-64

vyro-0.2.2-cp310-abi3-manylinux_2_34_x86_64.whl (1.1 MB view details)

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

vyro-0.2.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

vyro-0.2.2-cp310-abi3-macosx_11_0_arm64.whl (996.3 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file vyro-0.2.2.tar.gz.

File metadata

  • Download URL: vyro-0.2.2.tar.gz
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vyro-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1b5eedbca657fd38eb65b5391039a8fe39fa29bb48b7aa91d484af021b5e3d73
MD5 009cacccbe63b84135fe63ae6ec8c894
BLAKE2b-256 aba36db4875074491f2a367f90a109fdde456577bccd502be5a5de945d9fc68b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyro-0.2.2.tar.gz:

Publisher: release.yml on vietrix/vyro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vyro-0.2.2-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: vyro-0.2.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 830.9 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vyro-0.2.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9d2820ed438a3fde97bfb738ec6371975be3a569d4397d66328f78cf253f6cf6
MD5 506d96cb068b7b618ae881d0a379e372
BLAKE2b-256 95b9596234db8af9cdb8efd2fd917f432f282acc5e22b4a38cf940f5c0d5cc3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyro-0.2.2-cp310-abi3-win_amd64.whl:

Publisher: release.yml on vietrix/vyro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vyro-0.2.2-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for vyro-0.2.2-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1978da8075291d614244d2955a3062a1895bde635c0c70794b7738d782ac0ecd
MD5 61e0b3b0d20a365995eb293ca24fa0e2
BLAKE2b-256 1de030c02b587ef91bfe75e58fc15e17704ce061be35ecf23aae4275a76a767b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyro-0.2.2-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: release.yml on vietrix/vyro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vyro-0.2.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for vyro-0.2.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f83cad0c6177b080d71be6b2ee57993a327111506e5d93210cc037a202cfbd0e
MD5 aee824c403382e25cdcafa9c47a0fa79
BLAKE2b-256 7c35d7671a982708c646dbaa92ab6e66284e7e25ffd513b4276a46e99d0d243e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyro-0.2.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on vietrix/vyro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vyro-0.2.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: vyro-0.2.2-cp310-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 996.3 kB
  • Tags: CPython 3.10+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vyro-0.2.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2aeab0ccfe6bcf6251866aab76a9ad57a069da030b51e1d70f90b95d4496381b
MD5 3a8bf344da656a0d836a01e04504d0c4
BLAKE2b-256 b8c56701e8edc39fe5b783956ddcb93f7a8b41af5a90d673436abb431c4f3794

See more details on using hashes here.

Provenance

The following attestation bundles were made for vyro-0.2.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on vietrix/vyro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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