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 ๐Ÿš€ ๐Ÿ”ฅ 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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. 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.

License: MIT

View the full 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

sufast-0.2.1.tar.gz (507.7 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.1-py3-none-any.whl (506.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.2.1.tar.gz
  • Upload date:
  • Size: 507.7 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.1.tar.gz
Algorithm Hash digest
SHA256 ba9cced977df6ce067acf975383ee82454abddcfb2c9152413fde0fb680fcd02
MD5 aac056083b45691a602c88da469db93f
BLAKE2b-256 bc4c26315bae8453062aaff1f20955bf15f9d64c03209e9f45dd40ebbd95b005

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.2.1-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

Hashes for sufast-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 616c917ee8bf083f1cfb2fae683b5f31bce4598bf47bc2b02451866ce141294a
MD5 dfdb986c845b5c0df9a0c067272cc456
BLAKE2b-256 653f1b54bb4fefb64fd34b3cc67b7f40c117357ec5554da371a875d93723ddbd

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