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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.1.1.tar.gz
  • Upload date:
  • Size: 4.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.1.1.tar.gz
Algorithm Hash digest
SHA256 0f8ec40733c6561065ebc70046d4cd83f00b8a96353970dabc3f30df713122ba
MD5 ac6b86184cdc1c6566ad26de7b9b36c9
BLAKE2b-256 b73f2691ac743e82b8427f853713f77dc2a421429a96cd887595e9482f5facb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2480c8348d5da36e7f1528fdfddc7424229e643fc9739680ced8d1f83f96b637
MD5 b61b574111e6c8e71c179d9ef35729cc
BLAKE2b-256 d4b504194b6178f79592dc35b17ee220e1885ba23ec22714302900ea3394ca2c

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