Metadata-Version: 2.4
Name: turboweb
Version: 1.3
Summary: High-performance Python web framework with C extension
Home-page: https://github.com/ScadeBlock/turboweb
Author: ScadeBlock
Author-email: ScadeBlock <scadeblock@github.com>
License: MIT
Project-URL: Homepage, https://github.com/ScadeBlock/turboweb
Project-URL: Repository, https://github.com/ScadeBlock/turboweb
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastpysgi
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# TurboWeb

High-performance Python web framework with C extension for maximum speed.

## Features

- **Fast**: C-accelerated core for high-throughput applications
- **Async & Sync**: Supports both asyncio and synchronous handlers
- **ASGI/WSGI**: Compatible with both ASGI and WSGI servers
- **Routing**: Dynamic route parameters with type conversion
- **Middleware**: Request/response middleware support
- **CORS**: Built-in CORS configuration
- **Static Files**: Serve static files efficiently
- **File Uploads**: Multipart form data parsing

## Installation

```bash
pip install turboweb
```

## Quick Start

```python
from turboweb import TurboWeb, response

app = TurboWeb()

@app.route("/")
def index(req):
    return response.json({"message": "Hello, TurboWeb!"})

@app.route("/user/<name>")
def greet(req, name):
    return response.text(f"Hello, {name}!")

@app.route("/api/data", methods=["POST"])
async def api_data(req):
    data = req.json
    return response.json({"received": data})

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=8000)
```

## Async Support

```python
@app.route("/async")
async def async_handler(req):
    await asyncio.sleep(0.1)
    return response.json({"status": "done"})
```

## Middleware

```python
@app.middleware("request")
def log_request(req):
    print(f"{req.method} {req.path}")

@app.middleware("response")
def add_header(req, resp):
    resp.headers.append(("X-Custom-Header", "TurboWeb"))
    return resp
```

## CORS

```python
app.cors(
    allow_origins=["https://example.com"],
    allow_methods=["GET", "POST"],
    allow_headers=["Content-Type"],
    allow_credentials=True
)
```

## Static Files

```python
app.static("/static", "./public")
```

## Running with Workers

```python
app.run(host="0.0.0.0", port=8000, workers=4)
```

## Requirements

- Python 3.7+
- fastpysgi (installed automatically)

## License

MIT License
