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.1.tar.gz (505.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.1.2.1-py3-none-any.whl (505.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.1.2.1.tar.gz
  • Upload date:
  • Size: 505.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.1.2.1.tar.gz
Algorithm Hash digest
SHA256 46ab39575e0c3cc1501d7b610f2ce17c78ae8ff2037d919aac6c366be4cf5b33
MD5 594e10f7dddc7f047d72d6264d3ee3b8
BLAKE2b-256 387d8865b76474bbb671f9379eb9812836812767d14ab96ef26fe7ce0a4955e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 505.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b51c4f5117cf80b8f95f6ccbfd83f372cea6924fef1d4abd3ab02c9a58de2959
MD5 2ee949f1e74032cc628eccbb28c65640
BLAKE2b-256 4489e9df42bb9c944546ea73cb457c2e55994339e53474bf9d9dae73135b479a

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