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.2.2.tar.gz (504.5 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.2.2-py3-none-any.whl (504.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.1.2.2.tar.gz
  • Upload date:
  • Size: 504.5 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.2.2.tar.gz
Algorithm Hash digest
SHA256 66598729139b055ac6d624ad4e4dde58ee2deb02960e996c82e04f3a53864f47
MD5 7a3d720912785c7c17d8c8d9da90618b
BLAKE2b-256 65232d980847c7c982a8714264672b8c7568fb8a8096d5f9ed89858a388890b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 504.8 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e502d2bc14a1ea040966cddfdfcec45aae52aecd1715d5dbec692ce41191545
MD5 8c07a25f89490efe113e164c6aa28594
BLAKE2b-256 cf3bcfe421b351ba452e6ed973b14981db75173aca08190ac600e27f7ab81164

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