{"id":48464192,"url":"https://github.com/rustxpy/bustapi","last_synced_at":"2026-06-04T03:00:28.049Z","repository":{"id":341866278,"uuid":"1171813572","full_name":"RUSTxPY/BustAPI","owner":"RUSTxPY","description":"BustAPI is a High-Performance Python Web Framework.","archived":false,"fork":false,"pushed_at":"2026-06-02T23:30:43.000Z","size":8446,"stargazers_count":30,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-03T01:14:02.208Z","etag":null,"topics":["bustapi","fastapi","flask","performance","python","python-web-framework","rust","rust-lang","web-framework"],"latest_commit_sha":null,"homepage":"https://rustxpy.github.io/BustAPI/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RUSTxPY.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"patreon":"Grandpa_EJ","custom":["https://ej.grandpaacademy.org/"]}},"created_at":"2026-03-03T16:29:52.000Z","updated_at":"2026-06-02T23:30:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RUSTxPY/BustAPI","commit_stats":null,"previous_names":["rustxpy/bustapi"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/RUSTxPY/BustAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUSTxPY%2FBustAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUSTxPY%2FBustAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUSTxPY%2FBustAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUSTxPY%2FBustAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RUSTxPY","download_url":"https://codeload.github.com/RUSTxPY/BustAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUSTxPY%2FBustAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33887124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bustapi","fastapi","flask","performance","python","python-web-framework","rust","rust-lang","web-framework"],"created_at":"2026-04-07T04:02:09.924Z","updated_at":"2026-06-04T03:00:28.039Z","avatar_url":"https://github.com/RUSTxPY.png","language":"Python","funding_links":["https://patreon.com/Grandpa_EJ","https://ej.grandpaacademy.org/"],"categories":[],"sub_categories":[],"readme":"# BustAPI — High-Performance Python Web Framework\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://rustxpy.github.io/BustAPI/latest/assets/logo.png\" alt=\"BustAPI - Fast Python Web Framework powered by Rust and Actix-Web\" width=\"200\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eThe fastest Python web framework for building REST APIs\u003c/strong\u003e\u003cbr\u003e\n  \u003cem\u003eFlask-like syntax • Rust-powered performance • Up to 20,000+ requests/sec\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pypi.org/project/bustapi/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/bustapi?color=blue\u0026style=for-the-badge\u0026logo=pypi\" alt=\"BustAPI on PyPI\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/RUSTxPY/BustAPI/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/RUSTxPY/BustAPI/ci.yml?style=for-the-badge\u0026logo=github\" alt=\"CI Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/bustapi/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/bustapi?style=for-the-badge\u0026logo=python\u0026logoColor=white\" alt=\"Python 3.10 3.11 3.12 3.13 3.14\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/RUSTxPY/BustAPI/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/RUSTxPY/BustAPI?style=for-the-badge\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## ⚡ What is BustAPI?\n\nBustAPI is a **production-ready Python web framework** that combines the best of both worlds: **Python's simplicity** and **Rust's raw performance**.\n\nUnder the hood, BustAPI runs on [Actix-Web](https://actix.rs/) — 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.\n\n### Why BustAPI?\n\n| Problem                        | BustAPI Solution                           |\n| ------------------------------ | ------------------------------------------ |\n| Python web frameworks are slow | Rust core handles HTTP, JSON, routing      |\n| ASGI/WSGI adds overhead        | Built-in server, no middleware layers      |\n| Scaling requires complex setup | Native multiprocessing with `SO_REUSEPORT` |\n| Auth is always a pain          | JWT, sessions, Argon2 hashing built-in     |\n\n### Key Highlights\n\n- 🚀 **20,000+ RPS** out of the box — 5x faster than Flask\n- 🦀 **Rust-powered** — Zero-copy JSON, mimalloc allocator, Actix-Web\n- 🐍 **Pure Python API** — No Rust knowledge required\n- 🔒 **Security built-in** — JWT, sessions, CSRF, rate limiting\n- 🛡️ **Robust Header System** — Case-insensitive, multi-value support, high-performance cookie parsing\n- 📦 **Zero config** — `pip install bustapi` and you're ready\n- 🔥 **Hot reload** — Rust-native file watcher for instant restarts\n\n```python\nfrom bustapi import BustAPI\n\napp = BustAPI()\n\n@app.route(\"/\")\ndef hello():\n    return {\"message\": \"Hello, world!\"}\n\nif __name__ == \"__main__\":\n    app.run()\n```\n\nNo ASGI servers needed. No complex configuration. Just run your file.\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     Your Python Code                        │\n│              (Flask-like decorators \u0026 handlers)             │\n├─────────────────────────────────────────────────────────────┤\n│                    PyO3 Bindings (v0.27)                    │\n│              (Zero-cost Python ↔ Rust bridge)               │\n├─────────────────────────────────────────────────────────────┤\n│                  Rust Core (bustapi_core)                   │\n│  ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐│\n│  │ Actix-Web   │ │ serde_json  │ │ mimalloc allocator      ││\n│  │ HTTP Server │ │ Zero-copy   │ │ Optimized memory        ││\n│  └─────────────┘ └─────────────┘ └─────────────────────────┘│\n└─────────────────────────────────────────────────────────────┘\n```\n\n| Component     | Technology    | Purpose                        |\n| ------------- | ------------- | ------------------------------ |\n| HTTP Server   | Actix-Web 4.x | Ultra-fast async HTTP handling |\n| Serialization | serde_json    | Zero-copy JSON encoding        |\n| Memory        | mimalloc      | High-performance allocator     |\n| Bindings      | PyO3 0.27     | Python 3.10–3.14 support       |\n| Async Runtime | Tokio         | Non-blocking I/O               |\n\n---\n\n## 📦 Installation\n\n```bash\npip install bustapi\n```\n\n**Supports:** Python 3.10 – 3.14 | Linux, macOS, Windows | x86_64 \u0026 ARM64\n\nPre-built wheels available — no Rust toolchain required!\n\n---\n\n## ✨ Features\n\n### 🛣️ Routing\n\n- **Dynamic Routes** — `/users/\u003cint:id\u003e` with automatic type validation\n- **Blueprints** — Modular app organization (Flask-style)\n- **Turbo Routes** — Zero-overhead handlers for maximum speed\n- **Wildcard Paths** — `\u003cpath:filepath\u003e` for catch-all routes\n\n### 🔐 Authentication \u0026 Security\n\n- **JWT** — Create/validate tokens (HS256, HS384, HS512)\n- **Sessions** — Flask-Login compatible user management\n- **Password Hashing** — Argon2id (OWASP recommended)\n- **CSRF Protection** — Built-in token validation\n- **Rate Limiting** — Rust-powered request throttling\n\n### 🌐 HTTP Features\n\n- **WebSocket** — Full duplex communication + Turbo mode\n- **Streaming** — HTTP Range requests, video seeking\n- **File Uploads** — Multipart form handling\n- **Static Files** — Efficient serving with caching\n\n### 🛠️ Developer Experience\n\n- **Hot Reload** — Rust-native file watcher (instant restarts)\n- **Templates** — Built-in Jinja2 via MiniJinja\n- **CLI Tool** — `bustapi new`, `bustapi run`, `bustapi routes`\n- **Auto-docs** — OpenAPI/Swagger generation\n- **Testing** — Built-in `TestClient` for unit tests\n\n### 🔌 Compatibility\n\n- **ASGI/WSGI** — Works with Uvicorn, Gunicorn, Hypercorn\n- **FastAPI-style** — `Query()`, `Path()`, `Body()`, `Depends()`\n- **Flask-style** — `request`, `session`, `g`, `current_app`\n\n---\n\n## 🚀 Quick Start\n\n**1. Create `app.py`:**\n\n```python\nfrom bustapi import BustAPI, jsonify\n\napp = BustAPI()\n\n@app.route(\"/\")\ndef home():\n    return {\"status\": \"running\", \"framework\": \"BustAPI\"}\n\n@app.route(\"/users/\u003cint:user_id\u003e\")\ndef get_user(user_id):\n    return jsonify({\"id\": user_id, \"name\": \"Alice\"})\n\n@app.route(\"/greet\", methods=[\"POST\"])\ndef greet():\n    from bustapi import request\n    data = request.json\n    return {\"message\": f\"Hello, {data.get('name', 'World')}!\"}\n\nif __name__ == \"__main__\":\n    app.run(debug=True)  # Hot reload enabled\n```\n\n**2. Run it:**\n\n```bash\npython app.py\n```\n\n**3. Visit** `http://127.0.0.1:5000`\n\n---\n\n## ⚡ Turbo Routes\n\nFor **maximum performance**, use `@app.turbo_route()`. Path parameters are parsed entirely in Rust:\n\n```python\n# Zero-overhead static route\n@app.turbo_route(\"/health\")\ndef health():\n    return {\"status\": \"ok\"}\n\n# Dynamic route with typed params (parsed in Rust)\n@app.turbo_route(\"/users/\u003cint:id\u003e\")\ndef get_user(id: int):\n    return {\"id\": id, \"name\": f\"User {id}\"}\n\n# Cached response (140k+ RPS!)\n@app.turbo_route(\"/config\", cache_ttl=60)\ndef get_config():\n    return {\"version\": \"1.0\", \"env\": \"production\"}\n```\n\n**Supported types:** `int`, `float`, `str`, `path`\n\n\u003e ⚠️ **Note:** Turbo routes skip middleware, sessions, and request context for speed. Use `@app.route()` when you need those features.\n\n---\n\n## 📊 Benchmarks\n\n### Standard Routes (`@app.route()`)\n\n| Platform  |         RPS | Mode           |\n| --------- | ----------: | -------------- |\n| **Linux** | **~25,000** | Single-process |\n| macOS     |     ~20,000 | Single-process |\n| Windows   |     ~17,000 | Single-process |\n\n### Turbo Routes (`@app.turbo_route()`) — Linux\n\n| Configuration                   |              RPS |\n| ------------------------------- | ---------------: |\n| Static route                    | ~30,000 (single) |\n| **Multiprocessing (4 workers)** |     **~105,000** |\n| **Cached (60s TTL)**            |     **~140,000** |\n\n### Framework Comparison (Turbo + Multiprocessing)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"benchmarks/rps_comparison.png\" alt=\"BustAPI vs Other Frameworks\" width=\"700\"\u003e\n\u003c/p\u003e\n\n---\n\n## 🌍 Platform Support\n\n### 🐧 Linux (Recommended for Production)\n\nLinux delivers the **best performance** with native multiprocessing:\n\n- **~25k RPS** standard routes, **100k+ RPS** with Turbo + multiprocessing\n- Kernel-level load balancing via `SO_REUSEPORT`\n- Automatic worker scaling to CPU cores\n\n```bash\npython app.py  # Automatically uses multiprocessing\n```\n\n### 🍎 macOS (Development)\n\nFully supported for development. Single-process mode (~35k RPS):\n\n```bash\npip install bustapi \u0026\u0026 python app.py\n```\n\n### 🪟 Windows (Development)\n\nFully supported for development. Single-process mode (~17k RPS):\n\n```bash\npip install bustapi \u0026\u0026 python app.py\n```\n\n\u003e 💡 **Tip:** For production, deploy on **Linux servers** to unlock multiprocessing performance.\n\n---\n\n## 🔐 Authentication\n\n### JWT Tokens\n\n```python\nfrom bustapi import BustAPI\nfrom bustapi.jwt import JWT\n\napp = BustAPI()\njwt = JWT(app, secret_key=\"your-secret-key\")\n\n@app.route(\"/login\", methods=[\"POST\"])\ndef login():\n    # Validate credentials...\n    token = jwt.create_access_token(identity=user_id)\n    return {\"access_token\": token}\n\n@app.route(\"/protected\")\n@jwt.jwt_required()\ndef protected():\n    return {\"user\": jwt.get_jwt_identity()}\n```\n\n### Session Login\n\n```python\nfrom bustapi.auth import LoginManager, login_user, current_user, login_required\n\nlogin_manager = LoginManager(app)\n\n@login_manager.user_loader\ndef load_user(user_id):\n    return User.get(user_id)\n\n@app.route(\"/login\", methods=[\"POST\"])\ndef login():\n    user = authenticate(request.form)\n    login_user(user)\n    return redirect(\"/dashboard\")\n\n@app.route(\"/dashboard\")\n@login_required\ndef dashboard():\n    return f\"Welcome, {current_user.name}!\"\n```\n\n### Password Hashing\n\n```python\nfrom bustapi.auth import hash_password, verify_password\n\n# Hash (Argon2id)\nhashed = hash_password(\"mysecretpassword\")\n\n# Verify\nif verify_password(\"mysecretpassword\", hashed):\n    print(\"Password correct!\")\n```\n\n---\n\n## 🌐 WebSocket\n\n```python\n@app.websocket(\"/ws\")\nasync def websocket_handler(ws):\n    await ws.accept()\n    while True:\n        message = await ws.receive_text()\n        await ws.send_text(f\"Echo: {message}\")\n```\n\n**Turbo WebSocket** (Pure Rust, ~74% faster):\n\n```python\n@app.turbo_websocket(\"/ws/turbo\")\ndef turbo_handler(message: str) -\u003e str:\n    return f\"Echo: {message}\"  # Processed entirely in Rust\n```\n\n---\n\n## 🧪 Testing\n\n```python\nfrom bustapi.testing import TestClient\n\ndef test_homepage():\n    client = TestClient(app)\n    response = client.get(\"/\")\n    assert response.status_code == 200\n    assert response.json() == {\"status\": \"running\"}\n\ndef test_create_user():\n    response = client.post(\"/users\", json={\"name\": \"Alice\"})\n    assert response.status_code == 201\n```\n\n---\n\n## 📁 Project Structure\n\n```\nbustapi/\n├── src/                    # Rust core\n│   ├── lib.rs              # PyO3 module entry\n│   ├── bindings/           # Python ↔ Rust bridge\n│   ├── router/             # URL matching engine\n│   ├── server/             # Actix-Web handlers\n│   ├── websocket/          # WS session management\n│   ├── jwt.rs              # Token encoding/decoding\n│   └── crypto.rs           # Argon2, CSRF, tokens\n│\n├── python/bustapi/         # Python package\n│   ├── app.py              # BustAPI main class\n│   ├── auth/               # JWT, sessions, CSRF\n│   ├── routing/            # Blueprints, decorators\n│   ├── params.py           # Query/Path/Body validators\n│   └── websocket.py        # WebSocket API\n│\n├── examples/               # 30+ usage examples\n├── tests/                  # Comprehensive test suite\n├── docs/                   # MkDocs documentation\n└── benchmarks/             # Performance tools\n```\n\n---\n\n## 🛠️ CLI Tool\n\n```bash\n# Create new project\nbustapi new myproject\n\n# Run with hot reload\nbustapi run\n\n# List all routes\nbustapi routes\n\n# Show system info\nbustapi info\n```\n\n---\n\n## 🚢 Deployment\n\n### Built-in Server (Recommended)\n\n```bash\npython app.py\n```\n\nUses the internal Rust HTTP server. Best performance, zero dependencies.\n\n### With ASGI (Uvicorn)\n\n```bash\npip install uvicorn\nuvicorn app:app.asgi_app --host 0.0.0.0 --port 8000\n```\n\n### With Docker\n\n```dockerfile\nFROM python:3.12-slim\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nEXPOSE 5000\nCMD [\"python\", \"app.py\"]\n```\n\n---\n\n## 📖 Documentation\n\n📚 **[Full Documentation](https://RUSTxPY.github.io/BustAPI/)**\n\n- [Getting Started](https://RUSTxPY.github.io/BustAPI/quickstart/)\n- [Routing Guide](https://RUSTxPY.github.io/BustAPI/user-guide/routing/)\n- [JWT Authentication](https://RUSTxPY.github.io/BustAPI/user-guide/jwt/)\n- [WebSocket Guide](https://RUSTxPY.github.io/BustAPI/user-guide/websocket/)\n- [API Reference](https://RUSTxPY.github.io/BustAPI/api-reference/)\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how:\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing`)\n3. **Commit** your changes (`git commit -m 'Add amazing feature'`)\n4. **Push** to the branch (`git push origin feature/amazing`)\n5. **Open** a Pull Request\n\nFound a bug? Have a feature request?\n\n- [Open an Issue](https://github.com/RUSTxPY/BustAPI/issues)\n- [Start a Discussion](https://github.com/RUSTxPY/BustAPI/discussions)\n\n---\n\n## 💰 Support\n\nIf BustAPI helps your project, consider supporting its development:\n\n**Binance ID:** `1010167458`\n\n---\n\n## 🌠 Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=RUSTxPY/BustAPI\u0026type=Date)](https://www.star-history.com/#RUSTxPY/BustAPI\u0026Date)\n\n---\n\n## 📄 License\n\n[MIT](LICENSE) © 2025-2026 **[GrandpaEJ](https://github.com/GrandpaEJ)**\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eBuilt with 🦀 Rust + 🐍 Python\u003c/strong\u003e\u003cbr\u003e\n  \u003cem\u003eFast. Simple. Production-ready.\u003c/em\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustxpy%2Fbustapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustxpy%2Fbustapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustxpy%2Fbustapi/lists"}