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.3.1.tar.gz (1.1 MB 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.3.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sufast-0.2.3.1.tar.gz
Algorithm Hash digest
SHA256 158a7652d58045006ba5096eaad105e834e5aaa87d6ec770174fc088ab42fd38
MD5 1956eb892e2a19e56ee01eaeabc56807
BLAKE2b-256 3a9d69d27a395b23a67e50c2551c98512a27f6e7ae528b6f0a40794b81dc2f9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.2.3.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a1d36e750ae83b95032c2b7abf653a0128f6fde0e72b1aafffd25c744ab5ec33
MD5 79cf5889b1f35ade426c8f4a33e895df
BLAKE2b-256 a4fcb38b62a8493d0a707262f211b6646f33a518c3636c3afa03375671b07d9a

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