Name | bustapi JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | High-performance Flask-compatible web framework with async support |
upload_time | 2025-09-01 07:01:42 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
web
framework
async
performance
flask
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ๐ BustAPI
**High-Performance Python Web Framework Powered by Rust**
BustAPI is a modern, fast Python web framework that combines the simplicity of Flask with the performance of Rust. Built with PyO3 and Tokio, it delivers **native Rust performance** while maintaining Python's ease of use.
## โก Performance
BustAPI achieves **539+ RPS** compared to Flask's 452 RPS and FastAPI's 451 RPS - delivering **20% better performance** through its Rust-powered backend.
| Framework | RPS | Improvement |
|-----------|-----|-------------|
| **BustAPI** | **539** | **Baseline** |
| Flask | 451 | +20% slower |
| FastAPI | 452 | +19% slower |
*Benchmarks: 100 concurrent connections, 10,000 total requests*
## ๐ฏ Key Features
- **๐ฅ High Performance**: Rust-powered backend with Python ease-of-use
- **๐ Flask Compatible**: Drop-in replacement for most Flask applications
- **โก Async Support**: Native async/await support with Tokio runtime
- **๐ Auto Documentation**: FastAPI-style automatic OpenAPI/Swagger UI
- **๐จ Template Support**: Jinja2 template rendering out of the box
- **๐ง Extension Support**: Compatible with popular Flask extensions
- **๐ก๏ธ Type Safety**: Full type hints and Pydantic integration
- **๐ All HTTP Methods**: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
## ๐ Quick Start
### Installation
```bash
pip install bustapi
```
### Your First App
```python
from bustapi import BustAPI
app = BustAPI()
@app.route('/')
def hello():
return {'message': 'Hello, World!'}
@app.route('/users/<int:user_id>')
def get_user(user_id):
return {'user_id': user_id, 'name': f'User {user_id}'}
if __name__ == '__main__':
app.run(debug=True)
```
Visit `http://127.0.0.1:8000` to see your app in action!
### Auto Documentation
```python
from bustapi import BustAPI
app = BustAPI(
title="My API",
description="A high-performance API built with BustAPI",
version="1.0.0",
docs_url="/docs", # Swagger UI
redoc_url="/redoc", # ReDoc
openapi_url="/openapi.json"
)
@app.get("/users")
def get_users():
"""Get all users from the system."""
return {"users": []}
@app.post("/users")
def create_user():
"""Create a new user."""
return {"message": "User created"}, 201
```
- **Swagger UI**: `http://127.0.0.1:8000/docs`
- **ReDoc**: `http://127.0.0.1:8000/redoc`
- **OpenAPI Schema**: `http://127.0.0.1:8000/openapi.json`
## ๐ง HTTP Methods
BustAPI supports all HTTP methods with convenient decorators:
```python
from bustapi import BustAPI
app = BustAPI()
@app.get('/items')
def get_items():
return {'items': []}
@app.post('/items')
def create_item():
return {'message': 'Item created'}, 201
@app.put('/items/<int:item_id>')
def update_item(item_id):
return {'message': f'Item {item_id} updated'}
@app.delete('/items/<int:item_id>')
def delete_item(item_id):
return {'message': f'Item {item_id} deleted'}
@app.patch('/items/<int:item_id>')
def patch_item(item_id):
return {'message': f'Item {item_id} patched'}
```
## ๐จ Template Rendering
Full Jinja2 support with template inheritance:
```python
from bustapi import BustAPI, render_template
app = BustAPI()
@app.route('/')
def index():
return render_template('index.html',
title='BustAPI App',
message='Welcome to BustAPI!')
@app.route('/users')
def users():
users = [{'name': 'Alice'}, {'name': 'Bob'}]
return render_template('users.html', users=users)
```
## ๐ Request Handling
```python
from bustapi import BustAPI, request
app = BustAPI()
@app.route('/data', methods=['POST'])
def handle_data():
# JSON data
json_data = request.get_json()
# Form data
form_data = request.form
# Query parameters
args = request.args
# Headers
headers = request.headers
# Files
files = request.files
return {
'json': json_data,
'form': dict(form_data),
'args': dict(args),
'headers': dict(headers)
}
```
## ๐ Flask Migration
BustAPI is designed as a drop-in replacement for Flask:
```python
# Flask code
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/api/users', methods=['GET', 'POST'])
def users():
if request.method == 'GET':
return jsonify({'users': []})
return jsonify({'message': 'User created'}), 201
# BustAPI equivalent (same code!)
from bustapi import BustAPI, jsonify, request
app = BustAPI()
@app.route('/api/users', methods=['GET', 'POST'])
def users():
if request.method == 'GET':
return jsonify({'users': []})
return jsonify({'message': 'User created'}), 201
```
## ๐ Documentation & Examples
- **[๐ Full Documentation](docs/)** - Complete guides and API reference
- **[๐ฏ Examples](examples/)** - Working examples for all features
- **[๐ Quick Start Guide](docs/quickstart.md)** - Get started in minutes
- **[๐ง API Reference](docs/api-reference.md)** - Complete API documentation
## ๐๏ธ Production Deployment
### Using Gunicorn
```bash
pip install gunicorn
gunicorn -w 4 -b 0.0.0.0:8000 app:app
```
### Using Uvicorn
```bash
pip install uvicorn
uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4
```
### Docker
```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8000", "app:app"]
```
## ๐งช Testing
BustAPI includes a built-in test client:
```python
from bustapi.testing import TestClient
def test_app():
client = TestClient(app)
response = client.get('/')
assert response.status_code == 200
assert response.json() == {'message': 'Hello, World!'}
response = client.post('/users', json={'name': 'Alice'})
assert response.status_code == 201
```
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
## ๐ License
BustAPI is licensed under the MIT License. See [LICENSE](LICENSE) for details.
## ๐ Acknowledgments
- Built with [PyO3](https://pyo3.rs/) for Python-Rust integration
- Powered by [Tokio](https://tokio.rs/) for async runtime
- Inspired by [Flask](https://flask.palletsprojects.com/) and [FastAPI](https://fastapi.tiangolo.com/)
---
**Made with โค๏ธ and โก by the BustAPI team**
Raw data
{
"_id": null,
"home_page": null,
"name": "bustapi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "web, framework, async, performance, flask",
"author": null,
"author_email": "BustAPI Team <hello@bustapi.dev>",
"download_url": "https://files.pythonhosted.org/packages/9a/d0/4f5cfecf568cb3a94f2a09ffb31a6ef4b294dfbb7884737f008ef33cc582/bustapi-0.1.5.tar.gz",
"platform": null,
"description": "# \ud83d\ude80 BustAPI\n\n**High-Performance Python Web Framework Powered by Rust**\n\nBustAPI is a modern, fast Python web framework that combines the simplicity of Flask with the performance of Rust. Built with PyO3 and Tokio, it delivers **native Rust performance** while maintaining Python's ease of use.\n\n## \u26a1 Performance\n\nBustAPI achieves **539+ RPS** compared to Flask's 452 RPS and FastAPI's 451 RPS - delivering **20% better performance** through its Rust-powered backend.\n\n| Framework | RPS | Improvement |\n|-----------|-----|-------------|\n| **BustAPI** | **539** | **Baseline** |\n| Flask | 451 | +20% slower |\n| FastAPI | 452 | +19% slower |\n\n*Benchmarks: 100 concurrent connections, 10,000 total requests*\n\n## \ud83c\udfaf Key Features\n\n- **\ud83d\udd25 High Performance**: Rust-powered backend with Python ease-of-use\n- **\ud83d\udd04 Flask Compatible**: Drop-in replacement for most Flask applications \n- **\u26a1 Async Support**: Native async/await support with Tokio runtime\n- **\ud83d\udcda Auto Documentation**: FastAPI-style automatic OpenAPI/Swagger UI\n- **\ud83c\udfa8 Template Support**: Jinja2 template rendering out of the box\n- **\ud83d\udd27 Extension Support**: Compatible with popular Flask extensions\n- **\ud83d\udee1\ufe0f Type Safety**: Full type hints and Pydantic integration\n- **\ud83c\udf10 All HTTP Methods**: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install bustapi\n```\n\n### Your First App\n\n```python\nfrom bustapi import BustAPI\n\napp = BustAPI()\n\n@app.route('/')\ndef hello():\n return {'message': 'Hello, World!'}\n\n@app.route('/users/<int:user_id>')\ndef get_user(user_id):\n return {'user_id': user_id, 'name': f'User {user_id}'}\n\nif __name__ == '__main__':\n app.run(debug=True)\n```\n\nVisit `http://127.0.0.1:8000` to see your app in action!\n\n### Auto Documentation\n\n```python\nfrom bustapi import BustAPI\n\napp = BustAPI(\n title=\"My API\",\n description=\"A high-performance API built with BustAPI\",\n version=\"1.0.0\",\n docs_url=\"/docs\", # Swagger UI\n redoc_url=\"/redoc\", # ReDoc\n openapi_url=\"/openapi.json\"\n)\n\n@app.get(\"/users\")\ndef get_users():\n \"\"\"Get all users from the system.\"\"\"\n return {\"users\": []}\n\n@app.post(\"/users\")\ndef create_user():\n \"\"\"Create a new user.\"\"\"\n return {\"message\": \"User created\"}, 201\n```\n\n- **Swagger UI**: `http://127.0.0.1:8000/docs`\n- **ReDoc**: `http://127.0.0.1:8000/redoc`\n- **OpenAPI Schema**: `http://127.0.0.1:8000/openapi.json`\n\n## \ud83d\udd27 HTTP Methods\n\nBustAPI supports all HTTP methods with convenient decorators:\n\n```python\nfrom bustapi import BustAPI\n\napp = BustAPI()\n\n@app.get('/items')\ndef get_items():\n return {'items': []}\n\n@app.post('/items')\ndef create_item():\n return {'message': 'Item created'}, 201\n\n@app.put('/items/<int:item_id>')\ndef update_item(item_id):\n return {'message': f'Item {item_id} updated'}\n\n@app.delete('/items/<int:item_id>')\ndef delete_item(item_id):\n return {'message': f'Item {item_id} deleted'}\n\n@app.patch('/items/<int:item_id>')\ndef patch_item(item_id):\n return {'message': f'Item {item_id} patched'}\n```\n\n## \ud83c\udfa8 Template Rendering\n\nFull Jinja2 support with template inheritance:\n\n```python\nfrom bustapi import BustAPI, render_template\n\napp = BustAPI()\n\n@app.route('/')\ndef index():\n return render_template('index.html', \n title='BustAPI App',\n message='Welcome to BustAPI!')\n\n@app.route('/users')\ndef users():\n users = [{'name': 'Alice'}, {'name': 'Bob'}]\n return render_template('users.html', users=users)\n```\n\n## \ud83d\udcca Request Handling\n\n```python\nfrom bustapi import BustAPI, request\n\napp = BustAPI()\n\n@app.route('/data', methods=['POST'])\ndef handle_data():\n # JSON data\n json_data = request.get_json()\n \n # Form data\n form_data = request.form\n \n # Query parameters\n args = request.args\n \n # Headers\n headers = request.headers\n \n # Files\n files = request.files\n \n return {\n 'json': json_data,\n 'form': dict(form_data),\n 'args': dict(args),\n 'headers': dict(headers)\n }\n```\n\n## \ud83d\udd04 Flask Migration\n\nBustAPI is designed as a drop-in replacement for Flask:\n\n```python\n# Flask code\nfrom flask import Flask, jsonify, request\n\napp = Flask(__name__)\n\n@app.route('/api/users', methods=['GET', 'POST'])\ndef users():\n if request.method == 'GET':\n return jsonify({'users': []})\n return jsonify({'message': 'User created'}), 201\n\n# BustAPI equivalent (same code!)\nfrom bustapi import BustAPI, jsonify, request\n\napp = BustAPI()\n\n@app.route('/api/users', methods=['GET', 'POST'])\ndef users():\n if request.method == 'GET':\n return jsonify({'users': []})\n return jsonify({'message': 'User created'}), 201\n```\n\n## \ud83d\udcda Documentation & Examples\n\n- **[\ud83d\udcd6 Full Documentation](docs/)** - Complete guides and API reference\n- **[\ud83c\udfaf Examples](examples/)** - Working examples for all features\n- **[\ud83d\ude80 Quick Start Guide](docs/quickstart.md)** - Get started in minutes\n- **[\ud83d\udd27 API Reference](docs/api-reference.md)** - Complete API documentation\n\n## \ud83c\udfd7\ufe0f Production Deployment\n\n### Using Gunicorn\n\n```bash\npip install gunicorn\ngunicorn -w 4 -b 0.0.0.0:8000 app:app\n```\n\n### Using Uvicorn\n\n```bash\npip install uvicorn\nuvicorn app:app --host 0.0.0.0 --port 8000 --workers 4\n```\n\n### Docker\n\n```dockerfile\nFROM python:3.11-slim\n\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install -r requirements.txt\n\nCOPY . .\nEXPOSE 8000\n\nCMD [\"gunicorn\", \"-w\", \"4\", \"-b\", \"0.0.0.0:8000\", \"app:app\"]\n```\n\n## \ud83e\uddea Testing\n\nBustAPI includes a built-in test client:\n\n```python\nfrom bustapi.testing import TestClient\n\ndef test_app():\n client = TestClient(app)\n \n response = client.get('/')\n assert response.status_code == 200\n assert response.json() == {'message': 'Hello, World!'}\n \n response = client.post('/users', json={'name': 'Alice'})\n assert response.status_code == 201\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n## \ud83d\udcc4 License\n\nBustAPI is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n## \ud83d\ude4f Acknowledgments\n\n- Built with [PyO3](https://pyo3.rs/) for Python-Rust integration\n- Powered by [Tokio](https://tokio.rs/) for async runtime\n- Inspired by [Flask](https://flask.palletsprojects.com/) and [FastAPI](https://fastapi.tiangolo.com/)\n\n---\n\n**Made with \u2764\ufe0f and \u26a1 by the BustAPI team**\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "High-performance Flask-compatible web framework with async support",
"version": "0.1.5",
"project_urls": {
"Documentation": "https://bustapi.dev",
"Homepage": "https://github.com/bustapi/bustapi",
"Issues": "https://github.com/bustapi/bustapi/issues",
"Repository": "https://github.com/bustapi/bustapi.git"
},
"split_keywords": [
"web",
" framework",
" async",
" performance",
" flask"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "69ec8ef344153d19bfd5e6c8a1c97157df34bc3c96bd45a8eb40aec3084b4859",
"md5": "3fd1cd17bed9f93f18fad50fb34fb683",
"sha256": "a251b41f911a4bf62d0022dedc417f5b08dec0fdbc8b186c56bd62d41b7b4f53"
},
"downloads": -1,
"filename": "bustapi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "3fd1cd17bed9f93f18fad50fb34fb683",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 460088,
"upload_time": "2025-09-01T07:01:38",
"upload_time_iso_8601": "2025-09-01T07:01:38.261657Z",
"url": "https://files.pythonhosted.org/packages/69/ec/8ef344153d19bfd5e6c8a1c97157df34bc3c96bd45a8eb40aec3084b4859/bustapi-0.1.5-cp311-cp311-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "12e698828e0b0301e83ae6bab711cb7803a4f49964a00eca451e44004ef11c73",
"md5": "0dad438dd21c3dae29329adcb26031d0",
"sha256": "13f852e2de7546254458fb4599000fcff070aba3d3dcef52aa58010ead1c0429"
},
"downloads": -1,
"filename": "bustapi-0.1.5-cp311-cp311-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "0dad438dd21c3dae29329adcb26031d0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 542525,
"upload_time": "2025-09-01T07:01:39",
"upload_time_iso_8601": "2025-09-01T07:01:39.624079Z",
"url": "https://files.pythonhosted.org/packages/12/e6/98828e0b0301e83ae6bab711cb7803a4f49964a00eca451e44004ef11c73/bustapi-0.1.5-cp311-cp311-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1ed6a605ab52d65939490f911506010c06fdcbb98ab8733df607217d718d8f23",
"md5": "4c74111ef69ee9de13dbfaa53e049427",
"sha256": "8a4690a1fe33e5cf6122a43d78c9ab9c8fca2cf733f70d0e126a22f20062c677"
},
"downloads": -1,
"filename": "bustapi-0.1.5-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "4c74111ef69ee9de13dbfaa53e049427",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 421418,
"upload_time": "2025-09-01T07:01:41",
"upload_time_iso_8601": "2025-09-01T07:01:41.047326Z",
"url": "https://files.pythonhosted.org/packages/1e/d6/a605ab52d65939490f911506010c06fdcbb98ab8733df607217d718d8f23/bustapi-0.1.5-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9ad04f5cfecf568cb3a94f2a09ffb31a6ef4b294dfbb7884737f008ef33cc582",
"md5": "b6a976684d980010f11afe2a4ca08acd",
"sha256": "633fda67ef2d024c0f659dc8d4fbf8a5fba0ee2ec21e020a3023f390fee6bfdc"
},
"downloads": -1,
"filename": "bustapi-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "b6a976684d980010f11afe2a4ca08acd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 138545,
"upload_time": "2025-09-01T07:01:42",
"upload_time_iso_8601": "2025-09-01T07:01:42.432003Z",
"url": "https://files.pythonhosted.org/packages/9a/d0/4f5cfecf568cb3a94f2a09ffb31a6ef4b294dfbb7884737f008ef33cc582/bustapi-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-01 07:01:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bustapi",
"github_project": "bustapi",
"github_not_found": true,
"lcname": "bustapi"
}