RUSTxPY/BustAPI
RUSTxPY/BustAPI has 44 GitHub stars and 2 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and +3 in 15 days. Last checked 2026-11-09 06:44 UTC. Last push 2026-09-21.
BustAPI is a High-Performance Python Web Framework.
What you can do
- ๐ 20,000+ RPS out of the box โ 5x faster than Flask
- ๐ฆ Rust-powered โ Zero-copy JSON, mimalloc allocator, Actix-Web
- ๐ Pure Python API โ No Rust knowledge required
- ๐ Security built-in โ JWT, sessions, CSRF, rate limiting
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +3
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalBustAPI โ High-Performance Python Web Framework
The fastest Python web framework for building REST APIs
Flask-like syntax โข Rust-powered performance โข Up to 20,000+ requests/sec
โก What is BustAPI?
BustAPI is a production-ready Python web framework that combines the best of both worlds: Python's simplicity and Rust's raw performance.
Under the hood, BustAPI runs on Actix-Web โ consistently ranked among the fastest web frameworks across all programming languages. But you never touch Rust. You write clean, familiar Python code with Flask-style decorators.
Why BustAPI?
| Problem | BustAPI Solution |
|---|---|
| Python web frameworks are slow | Rust core handles HTTP, JSON, routing |
| ASGI/WSGI adds overhead | Built-in server, no middleware layers |
| Scaling requires complex setup | Native multiprocessing with SO_REUSEPORT |
| Auth is always a pain | JWT, sessions, Argon2 hashing built-in |
Key Highlights
- ๐ 20,000+ RPS out of the box โ 5x faster than Flask
- ๐ฆ Rust-powered โ Zero-copy JSON, mimalloc allocator, Actix-Web
- ๐ Pure Python API โ No Rust knowledge required
- ๐ Security built-in โ JWT, sessions, CSRF, rate limiting
- ๐ก๏ธ Robust Header System โ Case-insensitive, multi-value support, high-performance cookie parsing
- ๐ฆ Zero config โ
pip install bustapiand you're ready - ๐ฅ Hot reload โ Rust-native file watcher for instant restarts
from bustapi import BustAPI
app = BustAPI()
@app.route("/")
def hello():
return {"message": "Hello, world!"}
if __name__ == "__main__":
app.run()
No ASGI servers needed. No complex configuration. Just run your file.
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Python Code โ
โ (Flask-like decorators & handlers) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ PyO3 Bindings (v0.27) โ
โ (Zero-cost Python โ Rust bridge) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Rust Core (bustapi_core) โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ Actix-Web โ โ serde_json โ โ mimalloc allocator โโ
โ โ HTTP Server โ โ Zero-copy โ โ Optimized memory โโ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Component | Technology | Purpose |
|---|---|---|
| HTTP Server | Actix-Web 4.x | Ultra-fast async HTTP handling |
| Serialization | serde_json | Zero-copy JSON encoding |
| Memory | mimalloc | High-performance allocator |
| Bindings | PyO3 0.27 | Python 3.10โ3.14 support |
| Async Runtime | Tokio | Non-blocking I/O |
๐ฆ Installation
pip install bustapi
Supports: Python 3.10 โ 3.14 | Linux, macOS, Windows | x86_64 & ARM64
Pre-built wheels available โ no Rust toolchain required!
โจ Features
๐ฃ๏ธ Routing
- Dynamic Routes โ
/users/<int:id>with automatic type validation - Blueprints โ Modular app organization (Flask-style)
- Turbo Routes โ Zero-overhead handlers for maximum speed
- Wildcard Paths โ
<path:filepath>for catch-all routes
๐ Authentication & Security
- JWT โ Create/validate tokens (HS256, HS384, HS512)
- Sessions โ Flask-Login compatible user management
- Password Hashing โ Argon2id (OWASP recommended)
- CSRF Protection โ Built-in token validation
- Rate Limiting โ Rust-powered request throttling
๐ HTTP Features
- WebSocket โ Full duplex communication + Turbo mode
- Streaming โ HTTP Range requests, video seeking
- File Uploads โ Multipart form handling
- Static Files โ Efficient serving with caching
๐ ๏ธ Developer Experience
- Hot Reload โ Rust-native file watcher (instant restarts)
- Templates โ Built-in Jinja2 via MiniJinja
- CLI Tool โ
bustapi new,bustapi run,bustapi routes - Auto-docs โ OpenAPI/Swagger generation
- Testing โ Built-in
TestClientfor unit tests
๐ Compatibility
- ASGI/WSGI โ Works with Uvicorn, Gunicorn, Hypercorn
- FastAPI-style โ
Query(),Path(),Body(),Depends() - Flask-style โ
request,session,g,current_app
๐ Quick Start
1. Create app.py:
from bustapi import BustAPI, jsonify
app = BustAPI()
@app.route("/")
def home():
return {"status": "running", "framework": "BustAPI"}
@app.route("/users/<int:user_id>")
def get_user(user_id):
return jsonify({"id": user_id, "name": "Alice"})
@app.route("/greet", methods=["POST"])
def greet():
from bustapi import request
data = request.json
return {"message": f"Hello, {data.get('name', 'World')}!"}
if __name__ == "__main__":
app.run(debug=True) # Hot reload enabled
2. Run it:
python app.py
3. Visit http://127.0.0.1:5000
โก Turbo Routes
For maximum performance, use @app.turbo_route(). Path parameters are parsed entirely in Rust:
# Zero-overhead static route
@app.turbo_route("/health")
def health():
return {"status": "ok"}
# Dynamic route with typed params (parsed in Rust)
@app.turbo_route("/users/<int:id>")
def get_user(id: int):
return {"id": id, "name": f"User {id}"}
# Cached response (140k+ RPS!)
@app.turbo_route("/config", cache_ttl=60)
def get_config():
return {"version": "1.0", "env": "production"}
Supported types: int, float, str, path
โ ๏ธ Note: Turbo routes skip middleware, sessions, and request context for speed. Use
@app.route()when you need those features.
๐ Benchmarks
Standard Routes (@app.route())
| Platform | RPS | Mode |
|---|---|---|
| Linux | ~25,000 | Single-process |
| macOS | ~20,000 | Single-process |
| Windows | ~17,000 | Single-process |
Turbo Routes (@app.turbo_route()) โ Linux
| Configuration | RPS |
|---|---|
| Static route | ~30,000 (single) |
| Multiprocessing (4 workers) | ~105,000 |
| Cached (60s TTL) | ~140,000 |
Framework Comparison (Turbo + Multiprocessing)
๐ Platform Support
๐ง Linux (Recommended for Production)
Linux delivers the best performance with native multiprocessing:
- ~25k RPS standard routes, 100k+ RPS with Turbo + multiprocessing
- Kernel-level load balancing via
SO_REUSEPORT - Automatic worker scaling to CPU cores
python app.py # Automatically uses multiprocessing
๐ macOS (Development)
Fully supported for development. Single-process mode (~35k RPS):
pip install bustapi && python app.py
๐ช Windows (Development)
Fully supported for development. Single-process mode (~17k RPS):
pip install bustapi && python app.py
๐ก Tip: For production, deploy on Linux servers to unlock multiprocessing performance.
๐ Authentication
JWT Tokens
from bustapi import BustAPI
from bustapi.jwt import JWT
app = BustAPI()
jwt = JWT(app, secret_key="your-secret-key")
@app.route("/login", methods=["POST"])
def login():
# Validate credentials...
token = jwt.create_access_token(identity=user_id)
return {"access_token": token}
@app.route("/protected")
@jwt.jwt_required()
def protected():
return {"user": jwt.get_jwt_identity()}
Session Login
from bustapi.auth import LoginManager, login_user, current_user, login_required
login_manager = LoginManager(app)
@login_manager.user_loader
def load_user(user_id):
return User.get(user_id)
@app.route("/login", methods=["POST"])
def login():
user = authenticate(request.form)
login_user(user)
return redirect("/dashboard")
@app.route("/dashboard")
@login_required
def dashboard():
return f"Welcome, {current_user.name}!"
Password Hashing
from bustapi.auth import hash_password, verify_password
# Hash (Argon2id)
hashed = hash_password("mysecretpassword")
# Verify
if verify_password("mysecretpassword", hashed):
print("Password correct!")
๐ WebSocket
@app.websocket("/ws")
async def websocket_handler(ws):
await ws.accept()
while True:
message = await ws.receive_text()
await ws.send_text(f"Echo: {message}")
Turbo WebSocket (Pure Rust, ~74% faster):
@app.turbo_websocket("/ws/turbo")
def turbo_handler(message: str) -> str:
return f"Echo: {message}" # Processed entirely in Rust
๐งช Testing
from bustapi.testing import TestClient
def test_homepage():
client = TestClient(app)
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"status": "running"}
def test_create_user():
response = client.post("/users", json={"name": "Alice"})
assert response.status_code == 201
๐ Project Structure
bustapi/
โโโ src/ # Rust core
โ โโโ lib.rs # PyO3 module entry
โ โโโ bindings/ # Python โ Rust bridge
โ โโโ router/ # URL matching engine
โ โโโ server/ # Actix-Web handlers
โ โโโ websocket/ # WS session management
โ โโโ jwt.rs # Token encoding/decoding
โ โโโ crypto.rs # Argon2, CSRF, tokens
โ
โโโ python/bustapi/ # Python package
โ โโโ app.py # BustAPI main class
โ โโโ auth/ # JWT, sessions, CSRF
โ โโโ routing/ # Blueprints, decorators
โ โโโ params.py # Query/Path/Body validators
โ โโโ websocket.py # WebSocket API
โ
โโโ examples/ # 30+ usage examples
โโโ tests/ # Comprehensive test suite
โโโ docs/ # MkDocs documentation
โโโ benchmarks/ # Performance tools
๐ ๏ธ CLI Tool
# Create new project
bustapi new myproject
# Run with hot reload
bustapi run
# List all routes
bustapi routes
# Show system info
bustapi info
๐ข Deployment
Built-in Server (Recommended)
python app.py
Uses the internal Rust HTTP server. Best performance, zero dependencies.
With ASGI (Uvicorn)
pip install uvicorn
uvicorn app:app.asgi_app --host 0.0.0.0 --port 8000
With Docker
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5000
CMD ["python", "app.py"]
๐ Documentation
๐ Full Documentation
๐ค Contributing
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
Found a bug? Have a feature request?
๐ฐ Support
If BustAPI helps your project, consider supporting its development:
Binance ID: 1010167458
๐ Star History
๐ License
Built with ๐ฆ Rust + ๐ Python
Fast. Simple. Production-ready.
Explore related projects
freeCodeCamp/freeCodeCamp
freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.
458,821 starsdonnemartin/system-design-primer
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
377,440 starsreact/react
The library for web and native user interfaces.
252,444 starsvuejs/vue
This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core
212,624 stars