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 web framework that combines the developer-friendly simplicity of Python ๐Ÿ with the raw execution speed of Rust ๐Ÿฆ€.

Built for high-performance APIs, scalable microservices, and modern AI-era backends, Sufast delivers the best of both worlds:


โšก Why Sufast?

  • ๐Ÿš€ 52,000+ RPS performance with Rust core
  • ๐Ÿ FastAPI-style decorator syntax (@app.get, @app.post)
  • ๐Ÿ“ฆ Easy to use and install

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

๐Ÿ“Š Real-World Performance Benchmark

Metric ๐Ÿฆ€ Native Rust (Actix-Web) ๐Ÿš€ Sufast (Rust + Python) ๐Ÿ FastAPI (Uvicorn) ๐ŸŒ Node.js (Express)
Language ๐Ÿฆ€ Rust ๐Ÿฆ€ Rust + ๐Ÿ Python ๐Ÿ Python JavaScript
Avg. Requests/sec ๐Ÿš€ ๐Ÿ”ฅ 56,000+ ๐Ÿ”ฅ 52,000+ ๐Ÿข ~25,000+ โšก ~35,000+
Avg. Latency (ms) โฑ ~1.7 ~2.1 ~5.6 ~4.2
Memory Usage (MB) ๐Ÿ’พ ~20 ~25 ~60 ~50
Startup Time (ms) โšก ~25 ~35 ~90 ~40
Developer UX ๐Ÿง‘โ€๐Ÿ’ป โš ๏ธ Manual, low-level routing โœ… FastAPI-style, intuitive โœ… Very Dev-Friendly โœ… Dev-Friendly

๐Ÿ”ฌ 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

โš ๏ธ Development Status

Notice: Sufast is currently under active development. While it is fully functional for experimentation and early prototyping, it is not yet recommended for production or commercial deployment.

Contributions, bug reports, and feature suggestions are welcome! ๐Ÿ™Œ

๐Ÿค Contributing

Found a bug or want to help?

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Have suggestions or found a bug? Open an issue or submit a PR!

Join our growing community of contributors helping make Sufast even better!

๐Ÿ“ƒ License

This project is licensed under the terms of the MIT license.

License: MIT

View the full license

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sufast-0.2.2.tar.gz
  • Upload date:
  • Size: 507.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.2.2.tar.gz
Algorithm Hash digest
SHA256 0240eef14888ef925e224343b828b7ec404385baff369425f871d253e96a83f6
MD5 bbd299a82fa6ec38db7e2c4b5fc5e86f
BLAKE2b-256 f440746a9e9ec80f0941f463a3aecaeeb6c0dd6ae668068c2d073d7dc9106d8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sufast-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 506.4 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 772805a33a4de97d250fe0d0621f10a90a262cfde6e68a8fe76d07b3cd66684c
MD5 dd090e2b8ea4f78e77ec8bbca0e67411
BLAKE2b-256 c14bd358f3075982ce4547ed88d39e7c03c472cf28590976cda916f0f0ad1b18

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