Skip to main content

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 JavaScript
Avg. Requests/sec ๐Ÿš€ ๐Ÿ”ฅ 58,000+ ๐Ÿ”ฅ 52,000+ ๐Ÿข ~20,000+ โšก ~30,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? Open an issue or PR on GitHub!

๐Ÿ“ƒ License MIT License โ€“ do anything you want, just give credit ๐Ÿ˜„ Copyright ยฉ Shohan

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

sufast-0.2.tar.gz (507.0 kB view details)

Uploaded Source

Built Distribution

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

sufast-0.2-py3-none-any.whl (506.0 kB view details)

Uploaded Python 3

File details

Details for the file sufast-0.2.tar.gz.

File metadata

  • Download URL: sufast-0.2.tar.gz
  • Upload date:
  • Size: 507.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for sufast-0.2.tar.gz
Algorithm Hash digest
SHA256 42a5dfc967f252805a08e6b703ae436a42a4a4e154f43bc0eb2dfedbbedd85fd
MD5 18acfecd0276810ed70182973990e41e
BLAKE2b-256 293fb96ceb305c45383f5a7def46b5e5541187c18a66198b3b88089f63f799b4

See more details on using hashes here.

File details

Details for the file sufast-0.2-py3-none-any.whl.

File metadata

  • Download URL: sufast-0.2-py3-none-any.whl
  • Upload date:
  • Size: 506.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for sufast-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2135ae0da70aa1a975ab1992ad9f1d83eadfaa1f32b7e0ec3ab25e6f322239
MD5 1d3923999fe9a1fc180554695889fab0
BLAKE2b-256 7efcc643e4a9419e08a3bc9179e499a2311b5935ae90e0c038ecc16fa25693e6

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