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.3.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.3-py3-none-any.whl (504.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.1.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4643882b73e14f76901ca2a7f2bbb74e4115fedd419598cb402d6093ddb9c8e3
MD5 152165998e7767c4b8b1d45370b1bd71
BLAKE2b-256 3bbca730c0b2f78eeb7a91d4ce5408c191da6db73fc7bb7e9e7e8cb1bb122649

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.1.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 84b5b8e290fc3de52daeb24ed0b6eabe7a79099a7d799107ab10ccedb96723c8
MD5 93d729df015a3fc9ece80499eca6a5dc
BLAKE2b-256 4db969c0099ea267df9bbceff83cd2ef14f4c2bd80d76c27803334d1d311258f

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