Metadata-Version: 2.4
Name: bustapi
Version: 0.5.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Dist: jinja2>=3.1
Requires-Dist: watchfiles>=0.21.0
Requires-Dist: sqlmodel>=0.0.16
Requires-Dist: black>=24.8.0 ; extra == 'dev'
Requires-Dist: isort>=5.13.2 ; extra == 'dev'
Requires-Dist: maturin>=1.9.3 ; extra == 'dev'
Requires-Dist: pytest>=8.3.5 ; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0 ; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0 ; extra == 'dev'
Requires-Dist: ruff>=0.12.10 ; extra == 'dev'
Requires-Dist: mypy>=1.0 ; extra == 'dev'
Requires-Dist: pre-commit>=3.0 ; extra == 'dev'
Requires-Dist: black>=24.0 ; extra == 'dev'
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
Requires-Dist: uvicorn>=0.38.0 ; extra == 'benchmarks'
Requires-Dist: catzilla>=0.2.0 ; extra == 'benchmarks'
Requires-Dist: flask>=3.1.2 ; extra == 'benchmarks'
Requires-Dist: fastapi>=0.124.0 ; extra == 'benchmarks'
Requires-Dist: requests>=2.32.5 ; extra == 'benchmarks'
Requires-Dist: gunicorn>=23.0.0 ; extra == 'benchmarks'
Requires-Dist: httpx>=0.28.1 ; extra == 'benchmarks'
Requires-Dist: psutil>=5.9.0 ; extra == 'benchmarks'
Requires-Dist: mkdocs>=1.5 ; extra == 'docs'
Requires-Dist: mkdocs-material>=9.0 ; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.20 ; extra == 'docs'
Requires-Dist: uvicorn>=0.38.0 ; extra == 'server'
Requires-Dist: gunicorn>=23.0.0 ; extra == 'server'
Requires-Dist: hypercorn>=0.17.0 ; extra == 'server'
Requires-Dist: bustapi[server] ; extra == 'full'
Requires-Dist: bustapi[dev] ; extra == 'full'
Requires-Dist: bustapi[docs] ; extra == 'full'
Requires-Dist: bustapi[benchmarks] ; extra == 'full'
Provides-Extra: dev
Provides-Extra: benchmarks
Provides-Extra: docs
Provides-Extra: server
Provides-Extra: full
License-File: LICENSE
Summary: High-performance Flask-compatible web framework with async support
Keywords: web,framework,async,performance
Author-email: GrandpaEJ <>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/GrandpaEJ/bustapi
Project-URL: Documentation, https://grandpaej.github.io/BustAPI/
Project-URL: Repository, https://github.com/GrandpaEJ/bustapi.git
Project-URL: Issues, https://github.com/GrandpaEJ/bustapi/issues

# 🚀 BustAPI

<p align="center">
  <img src="https://github.com/GrandpaEJ/BustAPI/releases/download/v0.1.5/BustAPI.png" alt="BustAPI Logo" width="250">
</p>

<p align="center">
  <strong>The Ultra-High Performance Python Web Framework</strong><br>
  <em>Powered by Rust. Designed for Python. Built for the Future.</em>
</p>

<p align="center">
  <a href="https://pypi.org/project/bustapi/"><img src="https://img.shields.io/pypi/v/bustapi?color=blue&style=for-the-badge&logo=pypi" alt="PyPI"></a>
  <a href="https://github.com/GrandpaEJ/BustAPI/actions"><img src="https://img.shields.io/github/actions/workflow/status/GrandpaEJ/BustAPI/ci.yml?style=for-the-badge&logo=github" alt="CI"></a>
  <a href="https://pypi.org/project/bustapi/"><img src="https://img.shields.io/pypi/pyversions/bustapi?style=for-the-badge&logo=python&logoColor=white" alt="Versions"></a>
  <a href="https://github.com/GrandpaEJ/BustAPI/blob/main/LICENSE"><img src="https://img.shields.io/github/license/GrandpaEJ/BustAPI?style=for-the-badge" alt="License"></a>
</p>

---

## ⚡ What is BustAPI?

BustAPI isn't just another web framework. It's a **hybrid engine** that fuses the developer experience of Python with the raw performance of Rust.

By running on top of **Actix-Web** (Rust) via **PyO3** bindings, BustAPI eliminates the bottlenecks typical of Python frameworks. It handles requests, routing, and concurrency in compiled Rust code, leaving Python to do what it does best: business logic.

> **"It feels like Flask/FastAPI, but runs like a compiled binary."**

## 🌌 Future-Proof Architecture

### 🚀 **Performance First**

- **~20k RPS**: Capable of handling massive loads on a single node.
- **50x Faster**: Dynamic routing benchmarks show 50x-80x speedup over Flask.
- **Zero-Process Overhead**: Efficient, low-latency request handling.

### 🧠 **Intelligent Concurrency**

- **Native Async**: Built on Tokio, the industry-standard Rust async runtime.
<!-- - **Free-Threaded Ready**: Fully supports **Python 3.13 (NoGIL)** and **PyPy** for heavily optimized execution. [OPTIONAL] `DEFAULT: GIL` -->
- **Smart Worker Pool**: Rust manages the thread pool, automatically scaling to your CPU cores.

### 🛠️ **Developer Experience (DX)**

- **Hot Reload**: Instant feedback loop with `watchfiles` integration.
- **Type-Safe**: Built with modern Python typing in mind.
- **Auto-Docs**: Interactive Swagger/OpenAPI documentation generated automatically.

---

## 📦 Installation

Install the core framework:

```bash
pip install bustapi
```

### If you need ASGI / WSGI

Install with standard server compatibility (Uvicorn, Gunicorn, Hypercorn):

```bash
pip install "bustapi[server]"
```

Or go full throttle with all dev tools and benchmarks:

```bash
pip install "bustapi[full]"
```

---

## 🏁 Quick Start

Create `main.py`:

```python
from bustapi import BustAPI

app = BustAPI()

@app.route("/")
def home():
    return {"message": "Welcome to the future 🚀"}

@app.route("/users/<int:user_id>")
def get_user(user_id):
    return {"id": user_id, "status": "active"}

if __name__ == "__main__":
    # Hot reload enabled!
    app.run(debug=True)
```

Run it:

```bash
python main.py
```

Visit `http://127.0.0.1:5000` and confirm your entry into high-speed web development.

---

## 🔌 Server & Deployment

BustAPI is flexible. Use the ultra-fast internal Rust server, or bring your own.

### **Rust Engine (Default)**

Optimized for raw speed.

```bash
python main.py
```

### **ASGI (Uvicorn)**

```bash
uvicorn main:app.asgi_app --interface asgi3
```

### **WSGI (Gunicorn)**

```bash
gunicorn main:app
```

---

## 🛡️ Key Features

- **Rate Limiting**: Built-in, high-performance rate limiter protected by Rust.
- **Middleware**: Simple `@app.before_request` and `@app.after_request` hooks.
- **Blueprints**: Organizing extensive applications with ease.
- **Templates**: Integrated Jinja2 support.
- **Security**: Robust headers and CORS support out of the box.

### ✨ New in v0.5.0
- **FastAPI Compatibility**: Migrate easily with `Header`, `Cookie`, `Form`, `File`, and `UploadFile` support.
- **Context Globals**: Full support for Flask-style `g` and `current_app` proxies.
- **Background Tasks**: Fire-and-forget tasks with `BackgroundTasks`.
- **Response Aliases**: Use `JSONResponse`, `HTMLResponse`, etc., just like in FastAPI.

---

## Benchmarks at a Glance

| Framework           | Requests/Sec | Relative Speed | Memory (RAM) |
| :------------------ | :----------- | :------------- | :----------- |
| **BustAPI (v0.5)**  | **25,782**   | **🚀 100%**    | **~24 MB**   |
| Catzilla (v0.2)     | 15,727       | 💨 61%         | ~718 MB      |
| Flask (4 workers)   | 6,869        | 🐢 27%         | ~160 MB      |
| FastAPI (4 workers) | 1,867        | 🐢 7%          | ~237 MB      |

_(Benchmarks run on Python 3.13, Intel i5-8365U, 8 Cores, Ubuntu Linux)_

---

## 🤝 Contributing & Community

Join us in building the fastest Python framework ever created.

- **[Issues](https://github.com/GrandpaEJ/bustapi/issues)**: Report bugs or request features.
- **[Discussions](https://github.com/GrandpaEJ/bustapi/discussions)**: Ask questions and share ideas.

## 📄 License

[MIT](LICENSE) © 2025 GrandpaEJ.

