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 Python web framework that combines the developer simplicity of Python with the performance of Rust. Inspired by FastAPI, sufast delivers high-speed route handling and low-latency response times using a Rust backend while allowing full flexibility via Python.

Perfect for:

  • High-performance microservices ⚡
  • Real-time APIs 🚦
  • Custom dynamic route handling 🔄
  • Python + Rust FFI enthusiasts 🧠

📦 Installation

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()

🔬 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

🤝 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

sufast: Python ❤️ Rust – the future of high-performance web APIs.

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.1.0.tar.gz (4.8 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.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sufast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 287b9af2e5413e4618a3d651225b88e3c04d10508ac122d3948076d5072b1c94
MD5 036ab48bc8f9c74a3413905415e2ffc9
BLAKE2b-256 e15bbb8c0bd8d75e1c0ee6bbb6adf449fec2a712b342b52360dcae49dbd09e5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c5275c0dcdf74aa9c935aa2ffa78b0924ffec753189de014544f8316610af11
MD5 3f736bbba8761ec3b762b739251ae4fb
BLAKE2b-256 03f652df9eae7ef8f436a7f40df586a412b6a72c22ef7295be4e99a560e7883c

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