A blazing-fast Python web framework powered by Rust ๐
Project description
๐ Sufast โ A Blazing Fast Python Web Framework Powered by Rust
Sufast is a hybrid web framework that combines the developer-friendly simplicity of Python ๐ with the raw execution speed of Rust ๐ฆ.
Built for high-performance APIs, scalable microservices, and modern AI-era backends, Sufast delivers the best of both worlds:
โก Why Sufast?
- ๐ 52,000+ RPS performance with Rust core
- ๐ FastAPI-style decorator syntax (
@app.get,@app.post) - ๐ฆ Easy to use and install
pip install Sufast
โ ๏ธ Requires Python 3.8+ and a platform-compatible Rust binary bundled in the package.
๐ Quickstart
from Sufast import App
app = App()
@app.get("/")
def hello():
return {"message": "Hello from Sufast ๐"}
app.run()
Visit -> http://localhost:8080/ ๐
๐ Advanced Example โ API Server
from Sufast import App
app = App()
# ๐งช Sample database
users = {
"shohan": {"name": "shohan", "email": "shohan@example.com"},
"bob": {"name": "Bob", "email": "bob@example.com"},
"alice": {"name": "Alice", "email": "alice@example.com"},
}
@app.get("/")
def home():
return {"message": "Welcome to Sufast API ๐"}
@app.get("/shohan")
def app_info():
return {"message": "Built by Shohan โ Power of Rust & Python โ๏ธ๐"}
@app.get("/users")
def get_users():
return {"users": users}
@app.post("/users")
def show_user():
# This is a mocked POST example
return {
"data": users["bob"]
}
app.run()
๐ Real-World Performance Benchmark
| Metric | ๐ฆ Native Rust (Actix-Web) | ๐ Sufast (Rust + Python) | ๐ FastAPI (Uvicorn) | ๐ Node.js (Express) |
|---|---|---|---|---|
| Language | ๐ฆ Rust | ๐ฆ Rust + ๐ Python | ๐ Python | |
| Avg. Requests/sec ๐ | ๐ฅ 56,000+ | ๐ฅ 52,000+ | ๐ข ~25,000+ | โก ~35,000+ |
| Avg. Latency (ms) โฑ | ~1.7 | ~2.1 | ~5.6 | ~4.2 |
| Memory Usage (MB) ๐พ | ~20 | ~25 | ~60 | ~50 |
| Startup Time (ms) โก | ~25 | ~35 | ~90 | ~40 |
| Developer UX ๐งโ๐ป | โ ๏ธ Manual, low-level routing | โ FastAPI-style, intuitive | โ Very Dev-Friendly | โ Dev-Friendly |
๐ฌ Load Testing with k6
// test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
export let options = {
vus: 100,
duration: '10s',
};
export default function () {
let res = http.get('http://localhost:8080');
check(res, {
'status is 200': (r) => r.status === 200,
'response has message': (r) => r.json().message !== undefined,
});
sleep(0.001);
}
Run the test:
k6 run test.js
โจ Features
โ Rust-based core for high-speed routing
โ
Python decorators like @app.get() , @app.post()
โ FastAPI-style route syntax
โ Clean, readable API for rapid prototyping
โ Modular architecture for production use
๐ญ Roadmap
๐ง Static parameters (like /users)
๐ Static file serving
๐ณ Docker support
๐ PyPI full release and documentation site
โ ๏ธ Development Status
Notice: Sufast is currently under active development. While it is fully functional for experimentation and early prototyping, it is not yet recommended for production or commercial deployment.
Contributions, bug reports, and feature suggestions are welcome! ๐
๐ค Contributing
Found a bug or want to help?
How to Contribute
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Have suggestions or found a bug? Open an issue or submit a PR!
Join our growing community of contributors helping make Sufast even better!
๐ License
This project is licensed under the terms of the MIT license.
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 Distribution
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 sufast-0.2.2.tar.gz.
File metadata
- Download URL: sufast-0.2.2.tar.gz
- Upload date:
- Size: 507.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0240eef14888ef925e224343b828b7ec404385baff369425f871d253e96a83f6
|
|
| MD5 |
bbd299a82fa6ec38db7e2c4b5fc5e86f
|
|
| BLAKE2b-256 |
f440746a9e9ec80f0941f463a3aecaeeb6c0dd6ae668068c2d073d7dc9106d8b
|
File details
Details for the file sufast-0.2.2-py3-none-any.whl.
File metadata
- Download URL: sufast-0.2.2-py3-none-any.whl
- Upload date:
- Size: 506.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
772805a33a4de97d250fe0d0621f10a90a262cfde6e68a8fe76d07b3cd66684c
|
|
| MD5 |
dd090e2b8ea4f78e77ec8bbca0e67411
|
|
| BLAKE2b-256 |
c14bd358f3075982ce4547ed88d39e7c03c472cf28590976cda916f0f0ad1b18
|