RustAPI
FastAPI-style Python Web Framework backed by a Rust (Tokio / Hyper) Engine — with embedded Rust Database Streaming, JWT & Argon2 Primitives, Tier 3 Rust-Native Routes, and a built-in MCP Server.
📦 Key Open-Source Features Included
| Feature Area | Implementation Details |
|---|---|
| FastAPI Compatibility | FastAPI & Request aliases, status codes, EventSourceResponse (SSE), jsonable_encoder, Query/Body/Path, OAuth2PasswordBearer, HTTPBearer, APIKeyHeader, OpenIdConnect, get_openapi, app.frontend(). |
| HTTP & Routing | FastAPI-style @app.get, @app.post, APIRouter, Depends, app.dependency_overrides, response_model, reload=True. |
| Rust-Native Tier 3 Routes | app.add_native_route() zero-GIL C-speed fast-paths (50,000+ req/sec). |
| Database Engine | sqlx SQLite & PostgreSQL pool (app.connect_db()) with zero-copy JSON streaming (db.query_json()). |
| Power Primitives | Native Rust encode_jwt() / decode_jwt(), Argon2 hash_password() / verify_password(), MiniJinja render_template(). |
| Response Classes | HTMLResponse, JSONResponse, PlainTextResponse, RedirectResponse, StreamingResponse, EventSourceResponse. |
| Request Ergonomics | req.json(), req.form, req.body, UploadFile, WebSocket. |
| AI / MCP Integration | Embedded Model Context Protocol server (@app.tool(), @app.resource(), @app.prompt()) at POST /mcp. |
| Telemetry & Observability | Terminal access logging (INFO: 127.0.0.1 - "GET /render HTTP/1.1" 200 - 0.45ms), Swagger UI (/docs), OpenAPI (/openapi.json). |
⚡ Framework Standing & Capability Comparison
rustapi delivers 100% FastAPI developer experience (DX) while running on a high-performance Rust (Tokio/Hyper) core engine.
┌───────────────────────────────────────────────────────────┐
│ Python Layer (DX) │
│ FastAPI Syntax • Pydantic Models • Routers • SSE • Docs │
└─────────────────────────────┬─────────────────────────────┘
│ PyO3 C-Bindings
┌─────────────────────────────▼─────────────────────────────┐
│ Rust Tokio/Hyper Core │
│ Async Multi-Thread IO • Tokio Workers • sqlx DB • SSE │
└───────────────────────────────────────────────────────────┘
| Capability | FastAPI | RustAPI (pyrustapi) |
rustapi Advantage |
|---|---|---|---|
API Syntax (@app.get, Depends, APIRouter) |
✅ | ✅ | 100% drop-in API compatibility |
Interactive Docs (/docs, /redoc) |
✅ | ✅ | Swagger UI & ReDoc served natively |
| SSE Real-Time AI Streaming | ✅ | ✅ | Low-latency token streaming for LLMs |
Single-Page App Serving (app.frontend) |
❌ Manual | ✅ | Zero-config React/Vite/Svelte dist serving |
Embedded DB Engine (sqlx) |
❌ None | ✅ | Native C/Rust DB pool with zero-copy JSON |
| Rust Security Primitives (Argon2/JWT) | ❌ External | ✅ | Built-in high-speed C-extension primitives |
| Model Context Protocol (MCP Server) | ❌ External | ✅ | Built-in AI Agent MCP server (POST /mcp) |
| Peak Throughput (Native Fast-Paths) | ~5k req/s | 50,000+ req/s | Zero-GIL Tokio execution for critical routes |
📚 Documentation Reference
Detailed documentation is available in the docs/ directory and project reference:
- 📖 Getting Started & Core Routing
- ⚡ FastAPI Compatibility & Feature Guide
- 📚 Complete API & Migration Guide
- 🏛️ 3-Tier Architecture Guide
- ⚡ Tier 3 Rust-Native Business Logic Guide
- 🗄️ Rust-Native Database Engine
- 🔐 Embedded Rust Power Primitives (JWT, Argon2, MiniJinja)
- 🤖 Model Context Protocol (MCP) Server
- 📦 Response Types & Request Ergonomics
- 📊 Swagger UI & DX Deviations Guide
- 📊 Empirical Performance Benchmark Report
🛠️ Local Development & Testing
Build from source with maturin:
# Clone the repository
git clone https://github.com/rajboopathiking/rustapi.git
cd rustapi
# Build release wheel with Maturin
pip install maturin
maturin develop --release
# Run full test suite
pytest tests/ -v
PYPI Package
pip install pyrustapi
📄 License
Distributed under the MIT License.
Metadata
Release files for pyrustapi 0.11.86
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyrustapi-0.11.86.tar.gz | 3.4 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pyrustapi-0.11.86-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| pyrustapi-0.11.86-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| pyrustapi-0.11.86-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| pyrustapi-0.11.86-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 19.9 MB
Release files / pyrustapi-0.11.86.tar.gz
| Download URL | pyrustapi-0.11.86.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99cdc73c1580651d58007fc7bb7222f2b6fe912723e7666298579baa230edbc2
|
|
BLAKE2b-256 checksum How to use checksums |
2cef14d8f441e96b8585c0818576614ae877c7166bc80b6a2703128f83ed73ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyrustapi-0.11.86-cp38-abi3-win_amd64.whl
| Download URL | pyrustapi-0.11.86-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0e34974f5f47edd60dc74d587531e3548c0cfd599c2b540650ec6fbf53a3e242
|
|
BLAKE2b-256 checksum How to use checksums |
232899f078d0c9a07bd16e7994932c12e03f3976e2beceb46ac61111a4b38d71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyrustapi-0.11.86-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pyrustapi-0.11.86-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.3 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c6856d4fd2fe0e1d3dc0163c68058b2b19d72aa565e337385e5fb95cc22c6a0e
|
|
BLAKE2b-256 checksum How to use checksums |
1d6d67b7f0764e415b6308ac6e33980a34f521a6949e3f6e77cfc6b1472b6192
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyrustapi-0.11.86-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | pyrustapi-0.11.86-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.9 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
523a268da1b3c021fd91cae7c9690bd73128b83229ca1a0127a3e12a961c2f07
|
|
BLAKE2b-256 checksum How to use checksums |
f746858ad2a1d0ae9b036bd73869c7db5ae979af1d9326abfccbf7d17da07af9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pyrustapi-0.11.86-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | pyrustapi-0.11.86-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
9909c66a8bdf4219470cc25db10d16e5f4ef5725c9547a8270c4e91447ed640f
|
|
BLAKE2b-256 checksum How to use checksums |
0c4f9d66d0295b428129936278195442ec5d099addc3cda0df0336a666000052
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|