The fastest Python web framework for building REST APIs
Flask-like syntax • Rust-powered performance • 20,000+ requests/sec
BustAPI is a Python web framework that runs on a Rust core. You write normal Python code, but requests are handled by Actix-Web under the hood.
The result? Flask-like code that handles 20,000+ requests per second.
from bustapi import BustAPI
app = BustAPI()
@app.route("/")
def hello():
return {"message": "Hello, world!"}
if __name__ == "__main__":
app.run()That's it. No ASGI servers, no special configuration. Just run your file.
pip install bustapiPython 3.10 - 3.14 supported. Pre-built wheels available for Linux, macOS, and Windows.
- Routing — Dynamic paths like
/users/<int:id>with type validation - Blueprints — Organize large apps into modules
- Templates — Built-in Jinja2 support
- Middleware —
@app.before_requestand@app.after_requesthooks - Hot Reload — Automatic restart on file changes (Rust-native, no watchfiles needed)
- JWT — Create and validate tokens with HS256/384/512
- Sessions — Flask-Login style user management
- Password Hashing — Argon2id via Rust for secure password storage
- Native JSON — Responses serialized in Rust with
serde_json - Multiprocessing — Fork workers with
SO_REUSEPORTfor true parallelism - Turbo Routes — Zero-overhead handlers for simple endpoints
Create app.py:
from bustapi import BustAPI, jsonify
app = BustAPI()
@app.route("/")
def home():
return {"status": "running"}
@app.route("/users/<int:user_id>")
def get_user(user_id):
return jsonify({"id": user_id, "name": "Alice"})
if __name__ == "__main__":
app.run(debug=True) # Hot reload enabledRun it:
python app.pyOpen http://127.0.0.1:5000 in your browser.
For maximum performance, use @app.turbo_route(). Path parameters are parsed in Rust for zero Python overhead:
# Static route
@app.turbo_route("/health")
def health():
return {"status": "ok"}
# Dynamic route with typed params
@app.turbo_route("/users/<int:id>")
def get_user(id: int):
return {"id": id, "name": f"User {id}"}
# Multiple parameters
@app.turbo_route("/posts/<int:pid>/comments/<int:cid>")
def get_comment(pid: int, cid: int):
return {"post": pid, "comment": cid}Supports int, float, str, and path parameter types.
⚠️ Note: Turbo routes skip middleware, sessions, and request context for speed. Use@app.route()if you need those features.
@app.route()| Run | Requests/sec |
|---|---|
| Run 1 | 29,548.52 |
| Run 2 | 22,752.84 |
| Run 3 | 24,053.13 |
| Run 4 | 23,588.68 |
| Run 5 | 24,299.84 |
| Average | 24,848.60 |
| Peak | 29,548.52 |
@app.turbo_route()Last benchmark
| Platform | RPS (Root) | RPS (JSON) | Mode |
|---|---|---|---|
| Linux | 105,012 | 99,142 | Multiprocessing (SO_REUSEPORT) |
| macOS | 35,560 | 27532 | Single-process |
| Windows | 17,772 | 17,844 | Single-process |
💡 Maximum Performance: Use
@app.turbo_route()withcache_ttlfor ~140,000 RPS on cached endpoints!
Linux provides the best performance with native multiprocessing via SO_REUSEPORT:
- 100,000+ RPS with 4 workers
- Kernel-level load balancing across processes
- Optimal for production deployments
# Production deployment on Linux
python app.py # Automatically uses multiprocessingFully supported for development. Single-process mode (~35k RPS):
pip install bustapi
python app.pyFully supported for development. Single-process mode (~17k RPS):
pip install bustapi
python app.py
⚠️ Production Recommendation: For maximum performance, deploy on Linux servers. macOS and Windows are ideal for development but lack the multiprocessing optimizations available on Linux.
python app.pyUses the internal Rust HTTP server. Best performance, zero dependencies.
pip install uvicorn
uvicorn app:app.asgi_app --interface asgi3pip install gunicorn
gunicorn app:appFound a bug? Have a feature request?
If you find BustAPI useful, consider supporting its development:
Binance ID: 1010167458

