bustapi 0.1.0__cp311-cp311-win_amd64.whl → 0.1.5__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bustapi might be problematic. Click here for more details.
- bustapi/__init__.py +10 -5
- bustapi/app.py +338 -41
- bustapi/bustapi_core.cp311-win_amd64.pyd +0 -0
- bustapi/helpers.py +28 -8
- bustapi/logging.py +468 -0
- bustapi/openapi/__init__.py +33 -0
- bustapi/openapi/const.py +3 -0
- bustapi/openapi/docs.py +269 -0
- bustapi/openapi/models.py +128 -0
- bustapi/openapi/utils.py +158 -0
- bustapi/templating.py +30 -0
- bustapi/testing.py +2 -1
- bustapi-0.1.5.dist-info/METADATA +324 -0
- bustapi-0.1.5.dist-info/RECORD +23 -0
- {bustapi-0.1.0.dist-info → bustapi-0.1.5.dist-info}/licenses/LICENSE +1 -1
- bustapi-0.1.0.dist-info/METADATA +0 -233
- bustapi-0.1.0.dist-info/RECORD +0 -16
- {bustapi-0.1.0.dist-info → bustapi-0.1.5.dist-info}/WHEEL +0 -0
- {bustapi-0.1.0.dist-info → bustapi-0.1.5.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bustapi
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Rust
|
|
14
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
+
Requires-Dist: black>=24.8.0
|
|
17
|
+
Requires-Dist: isort>=5.13.2
|
|
18
|
+
Requires-Dist: maturin>=1.9.3
|
|
19
|
+
Requires-Dist: pytest>=8.3.5
|
|
20
|
+
Requires-Dist: pytest-asyncio>=0.24.0
|
|
21
|
+
Requires-Dist: pytest-cov>=5.0.0
|
|
22
|
+
Requires-Dist: ruff>=0.12.10
|
|
23
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
24
|
+
Requires-Dist: werkzeug>=2.0.0
|
|
25
|
+
Requires-Dist: jinja2>=3.1
|
|
26
|
+
Requires-Dist: pydantic>=2.10.6
|
|
27
|
+
Requires-Dist: requests>=2.32.4
|
|
28
|
+
Requires-Dist: colorama>=0.4.6
|
|
29
|
+
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
|
|
31
|
+
Requires-Dist: black>=22.0 ; extra == 'dev'
|
|
32
|
+
Requires-Dist: mypy>=1.0 ; extra == 'dev'
|
|
33
|
+
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
|
|
34
|
+
Requires-Dist: pre-commit>=3.0 ; extra == 'dev'
|
|
35
|
+
Requires-Dist: maturin>=1.0 ; extra == 'dev'
|
|
36
|
+
Requires-Dist: mkdocs>=1.5 ; extra == 'docs'
|
|
37
|
+
Requires-Dist: mkdocs-material>=9.0 ; extra == 'docs'
|
|
38
|
+
Requires-Dist: mkdocstrings[python]>=0.20 ; extra == 'docs'
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Summary: High-performance Flask-compatible web framework with async support
|
|
43
|
+
Keywords: web,framework,async,performance,flask
|
|
44
|
+
Author-email: BustAPI Team <hello@bustapi.dev>
|
|
45
|
+
License: MIT
|
|
46
|
+
Requires-Python: >=3.8
|
|
47
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
48
|
+
Project-URL: Homepage, https://github.com/bustapi/bustapi
|
|
49
|
+
Project-URL: Documentation, https://bustapi.dev
|
|
50
|
+
Project-URL: Repository, https://github.com/bustapi/bustapi.git
|
|
51
|
+
Project-URL: Issues, https://github.com/bustapi/bustapi/issues
|
|
52
|
+
|
|
53
|
+
# 🚀 BustAPI
|
|
54
|
+
|
|
55
|
+
**High-Performance Python Web Framework Powered by Rust**
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
## ⚡ Performance
|
|
60
|
+
|
|
61
|
+
BustAPI achieves **539+ RPS** compared to Flask's 452 RPS and FastAPI's 451 RPS - delivering **20% better performance** through its Rust-powered backend.
|
|
62
|
+
|
|
63
|
+
| Framework | RPS | Improvement |
|
|
64
|
+
|-----------|-----|-------------|
|
|
65
|
+
| **BustAPI** | **539** | **Baseline** |
|
|
66
|
+
| Flask | 451 | +20% slower |
|
|
67
|
+
| FastAPI | 452 | +19% slower |
|
|
68
|
+
|
|
69
|
+
*Benchmarks: 100 concurrent connections, 10,000 total requests*
|
|
70
|
+
|
|
71
|
+
## 🎯 Key Features
|
|
72
|
+
|
|
73
|
+
- **🔥 High Performance**: Rust-powered backend with Python ease-of-use
|
|
74
|
+
- **🔄 Flask Compatible**: Drop-in replacement for most Flask applications
|
|
75
|
+
- **⚡ Async Support**: Native async/await support with Tokio runtime
|
|
76
|
+
- **📚 Auto Documentation**: FastAPI-style automatic OpenAPI/Swagger UI
|
|
77
|
+
- **🎨 Template Support**: Jinja2 template rendering out of the box
|
|
78
|
+
- **🔧 Extension Support**: Compatible with popular Flask extensions
|
|
79
|
+
- **🛡️ Type Safety**: Full type hints and Pydantic integration
|
|
80
|
+
- **🌐 All HTTP Methods**: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
|
|
81
|
+
|
|
82
|
+
## 🚀 Quick Start
|
|
83
|
+
|
|
84
|
+
### Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install bustapi
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Your First App
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from bustapi import BustAPI
|
|
94
|
+
|
|
95
|
+
app = BustAPI()
|
|
96
|
+
|
|
97
|
+
@app.route('/')
|
|
98
|
+
def hello():
|
|
99
|
+
return {'message': 'Hello, World!'}
|
|
100
|
+
|
|
101
|
+
@app.route('/users/<int:user_id>')
|
|
102
|
+
def get_user(user_id):
|
|
103
|
+
return {'user_id': user_id, 'name': f'User {user_id}'}
|
|
104
|
+
|
|
105
|
+
if __name__ == '__main__':
|
|
106
|
+
app.run(debug=True)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Visit `http://127.0.0.1:8000` to see your app in action!
|
|
110
|
+
|
|
111
|
+
### Auto Documentation
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from bustapi import BustAPI
|
|
115
|
+
|
|
116
|
+
app = BustAPI(
|
|
117
|
+
title="My API",
|
|
118
|
+
description="A high-performance API built with BustAPI",
|
|
119
|
+
version="1.0.0",
|
|
120
|
+
docs_url="/docs", # Swagger UI
|
|
121
|
+
redoc_url="/redoc", # ReDoc
|
|
122
|
+
openapi_url="/openapi.json"
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
@app.get("/users")
|
|
126
|
+
def get_users():
|
|
127
|
+
"""Get all users from the system."""
|
|
128
|
+
return {"users": []}
|
|
129
|
+
|
|
130
|
+
@app.post("/users")
|
|
131
|
+
def create_user():
|
|
132
|
+
"""Create a new user."""
|
|
133
|
+
return {"message": "User created"}, 201
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- **Swagger UI**: `http://127.0.0.1:8000/docs`
|
|
137
|
+
- **ReDoc**: `http://127.0.0.1:8000/redoc`
|
|
138
|
+
- **OpenAPI Schema**: `http://127.0.0.1:8000/openapi.json`
|
|
139
|
+
|
|
140
|
+
## 🔧 HTTP Methods
|
|
141
|
+
|
|
142
|
+
BustAPI supports all HTTP methods with convenient decorators:
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
from bustapi import BustAPI
|
|
146
|
+
|
|
147
|
+
app = BustAPI()
|
|
148
|
+
|
|
149
|
+
@app.get('/items')
|
|
150
|
+
def get_items():
|
|
151
|
+
return {'items': []}
|
|
152
|
+
|
|
153
|
+
@app.post('/items')
|
|
154
|
+
def create_item():
|
|
155
|
+
return {'message': 'Item created'}, 201
|
|
156
|
+
|
|
157
|
+
@app.put('/items/<int:item_id>')
|
|
158
|
+
def update_item(item_id):
|
|
159
|
+
return {'message': f'Item {item_id} updated'}
|
|
160
|
+
|
|
161
|
+
@app.delete('/items/<int:item_id>')
|
|
162
|
+
def delete_item(item_id):
|
|
163
|
+
return {'message': f'Item {item_id} deleted'}
|
|
164
|
+
|
|
165
|
+
@app.patch('/items/<int:item_id>')
|
|
166
|
+
def patch_item(item_id):
|
|
167
|
+
return {'message': f'Item {item_id} patched'}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 🎨 Template Rendering
|
|
171
|
+
|
|
172
|
+
Full Jinja2 support with template inheritance:
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
from bustapi import BustAPI, render_template
|
|
176
|
+
|
|
177
|
+
app = BustAPI()
|
|
178
|
+
|
|
179
|
+
@app.route('/')
|
|
180
|
+
def index():
|
|
181
|
+
return render_template('index.html',
|
|
182
|
+
title='BustAPI App',
|
|
183
|
+
message='Welcome to BustAPI!')
|
|
184
|
+
|
|
185
|
+
@app.route('/users')
|
|
186
|
+
def users():
|
|
187
|
+
users = [{'name': 'Alice'}, {'name': 'Bob'}]
|
|
188
|
+
return render_template('users.html', users=users)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 📊 Request Handling
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from bustapi import BustAPI, request
|
|
195
|
+
|
|
196
|
+
app = BustAPI()
|
|
197
|
+
|
|
198
|
+
@app.route('/data', methods=['POST'])
|
|
199
|
+
def handle_data():
|
|
200
|
+
# JSON data
|
|
201
|
+
json_data = request.get_json()
|
|
202
|
+
|
|
203
|
+
# Form data
|
|
204
|
+
form_data = request.form
|
|
205
|
+
|
|
206
|
+
# Query parameters
|
|
207
|
+
args = request.args
|
|
208
|
+
|
|
209
|
+
# Headers
|
|
210
|
+
headers = request.headers
|
|
211
|
+
|
|
212
|
+
# Files
|
|
213
|
+
files = request.files
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
'json': json_data,
|
|
217
|
+
'form': dict(form_data),
|
|
218
|
+
'args': dict(args),
|
|
219
|
+
'headers': dict(headers)
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 🔄 Flask Migration
|
|
224
|
+
|
|
225
|
+
BustAPI is designed as a drop-in replacement for Flask:
|
|
226
|
+
|
|
227
|
+
```python
|
|
228
|
+
# Flask code
|
|
229
|
+
from flask import Flask, jsonify, request
|
|
230
|
+
|
|
231
|
+
app = Flask(__name__)
|
|
232
|
+
|
|
233
|
+
@app.route('/api/users', methods=['GET', 'POST'])
|
|
234
|
+
def users():
|
|
235
|
+
if request.method == 'GET':
|
|
236
|
+
return jsonify({'users': []})
|
|
237
|
+
return jsonify({'message': 'User created'}), 201
|
|
238
|
+
|
|
239
|
+
# BustAPI equivalent (same code!)
|
|
240
|
+
from bustapi import BustAPI, jsonify, request
|
|
241
|
+
|
|
242
|
+
app = BustAPI()
|
|
243
|
+
|
|
244
|
+
@app.route('/api/users', methods=['GET', 'POST'])
|
|
245
|
+
def users():
|
|
246
|
+
if request.method == 'GET':
|
|
247
|
+
return jsonify({'users': []})
|
|
248
|
+
return jsonify({'message': 'User created'}), 201
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## 📚 Documentation & Examples
|
|
252
|
+
|
|
253
|
+
- **[📖 Full Documentation](docs/)** - Complete guides and API reference
|
|
254
|
+
- **[🎯 Examples](examples/)** - Working examples for all features
|
|
255
|
+
- **[🚀 Quick Start Guide](docs/quickstart.md)** - Get started in minutes
|
|
256
|
+
- **[🔧 API Reference](docs/api-reference.md)** - Complete API documentation
|
|
257
|
+
|
|
258
|
+
## 🏗️ Production Deployment
|
|
259
|
+
|
|
260
|
+
### Using Gunicorn
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
pip install gunicorn
|
|
264
|
+
gunicorn -w 4 -b 0.0.0.0:8000 app:app
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Using Uvicorn
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
pip install uvicorn
|
|
271
|
+
uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Docker
|
|
275
|
+
|
|
276
|
+
```dockerfile
|
|
277
|
+
FROM python:3.11-slim
|
|
278
|
+
|
|
279
|
+
WORKDIR /app
|
|
280
|
+
COPY requirements.txt .
|
|
281
|
+
RUN pip install -r requirements.txt
|
|
282
|
+
|
|
283
|
+
COPY . .
|
|
284
|
+
EXPOSE 8000
|
|
285
|
+
|
|
286
|
+
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8000", "app:app"]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## 🧪 Testing
|
|
290
|
+
|
|
291
|
+
BustAPI includes a built-in test client:
|
|
292
|
+
|
|
293
|
+
```python
|
|
294
|
+
from bustapi.testing import TestClient
|
|
295
|
+
|
|
296
|
+
def test_app():
|
|
297
|
+
client = TestClient(app)
|
|
298
|
+
|
|
299
|
+
response = client.get('/')
|
|
300
|
+
assert response.status_code == 200
|
|
301
|
+
assert response.json() == {'message': 'Hello, World!'}
|
|
302
|
+
|
|
303
|
+
response = client.post('/users', json={'name': 'Alice'})
|
|
304
|
+
assert response.status_code == 201
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## 🤝 Contributing
|
|
308
|
+
|
|
309
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
310
|
+
|
|
311
|
+
## 📄 License
|
|
312
|
+
|
|
313
|
+
BustAPI is licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
|
314
|
+
|
|
315
|
+
## 🙏 Acknowledgments
|
|
316
|
+
|
|
317
|
+
- Built with [PyO3](https://pyo3.rs/) for Python-Rust integration
|
|
318
|
+
- Powered by [Tokio](https://tokio.rs/) for async runtime
|
|
319
|
+
- Inspired by [Flask](https://flask.palletsprojects.com/) and [FastAPI](https://fastapi.tiangolo.com/)
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
**Made with ❤️ and ⚡ by the BustAPI team**
|
|
324
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
bustapi-0.1.5.dist-info/METADATA,sha256=9xSL2WG966ur8BXm3nLXU6DJJhJs0350TZGE3zb_s-g,8789
|
|
2
|
+
bustapi-0.1.5.dist-info/WHEEL,sha256=YCZ9Vxhf2aXNyfoR2QH-PPqnUr48Igr9zjgnGhp3xTc,96
|
|
3
|
+
bustapi-0.1.5.dist-info/entry_points.txt,sha256=rsTfPFL20JIrjJAAXxTWETsd6aqFdbsCJUd478dkI30,43
|
|
4
|
+
bustapi-0.1.5.dist-info/licenses/LICENSE,sha256=I1xpBBVxenkCWISL4Is7bXiL3a7socAR92WcAnbrWmI,1085
|
|
5
|
+
bustapi/__init__.py,sha256=Dlfo1UvIxOp2V6siyH4HXzRvwCsFOlAhy6hyfig8wuQ,2334
|
|
6
|
+
bustapi/app.py,sha256=CLuT43w3ciVtFx3FxjmmCJD1w7BpOPY8DRglGa8r2-U,30731
|
|
7
|
+
bustapi/blueprints.py,sha256=286VL4Kim8LstmCTzV4YaScE4yMuwWvP7Dvw_vMs15Y,15007
|
|
8
|
+
bustapi/bustapi_core.cp311-win_amd64.pyd,sha256=BYNNZrAHBlFwBk9B30j0oXCOmZ3CztjYynFyc1mtpjo,792576
|
|
9
|
+
bustapi/exceptions.py,sha256=tcQW9pDz20vy3R5RK5FP7wHjG3DMSYvUfn2FWi_MnbE,12823
|
|
10
|
+
bustapi/flask_compat.py,sha256=sgvVGvonTEAcgykGsS-TfnVfA7fAPHHRWUYqTZHU10w,1339
|
|
11
|
+
bustapi/helpers.py,sha256=itMJj7Oa5IFRLBnnDcJdP4MLT3igdoec2SmYLFQ_fPY,10047
|
|
12
|
+
bustapi/logging.py,sha256=4YwWYssiry2O9qA8crk_lH_Eq0sxEuocZ3re7Ll2Z78,15271
|
|
13
|
+
bustapi/openapi/__init__.py,sha256=TRPIQdGznGd_LjShBQrfU0gcBC-m2kFP6hhvIDUD1n4,659
|
|
14
|
+
bustapi/openapi/const.py,sha256=BnvzROL1viPGvZxegDzOFq3_dOGZ2BK33s264m2mnio,156
|
|
15
|
+
bustapi/openapi/docs.py,sha256=mfDcXYyRIw2JVqitw_5io4ktiHp489Q1H8bRexHv5vs,9359
|
|
16
|
+
bustapi/openapi/models.py,sha256=fphYuT5bp9NfeRmU1Dw5rOenfeUB798EoTS14rxG8cw,4124
|
|
17
|
+
bustapi/openapi/utils.py,sha256=fL3Ly1RxgWTfXsQ1bnb9dkFQpFDumaaLj2jLpC-opY0,4182
|
|
18
|
+
bustapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
+
bustapi/request.py,sha256=IHuASZqKsnxaYPIfuYqlVW1PGIjvYN04s7y_Q1c-yfE,11752
|
|
20
|
+
bustapi/response.py,sha256=nKAYveh4dF0TcHb9wqXLMW8zS_NGqpjzYYIJh6Bc3ZU,11840
|
|
21
|
+
bustapi/templating.py,sha256=F7tLQ3V2MHLErIShdVKCxAhmUNGjTkh8ynfT5X9mR5o,943
|
|
22
|
+
bustapi/testing.py,sha256=Xlw1cCfsE-ffV3rT2AmjK74pIdelbHtAJGcaD7IWrT4,11991
|
|
23
|
+
bustapi-0.1.5.dist-info/RECORD,,
|
bustapi-0.1.0.dist-info/METADATA
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: bustapi
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Classifier: Development Status :: 3 - Alpha
|
|
5
|
-
Classifier: Intended Audience :: Developers
|
|
6
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Programming Language :: Rust
|
|
14
|
-
Classifier: Topic :: Internet :: WWW/HTTP
|
|
15
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
-
Requires-Dist: black>=24.8.0
|
|
17
|
-
Requires-Dist: isort>=5.13.2
|
|
18
|
-
Requires-Dist: maturin>=1.9.3
|
|
19
|
-
Requires-Dist: pytest>=8.3.5
|
|
20
|
-
Requires-Dist: pytest-asyncio>=0.24.0
|
|
21
|
-
Requires-Dist: pytest-cov>=5.0.0
|
|
22
|
-
Requires-Dist: ruff>=0.12.10
|
|
23
|
-
Requires-Dist: typing-extensions>=4.0.0
|
|
24
|
-
Requires-Dist: werkzeug>=2.0.0
|
|
25
|
-
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
26
|
-
Requires-Dist: pytest-asyncio>=0.21.0 ; extra == 'dev'
|
|
27
|
-
Requires-Dist: black>=22.0 ; extra == 'dev'
|
|
28
|
-
Requires-Dist: mypy>=1.0 ; extra == 'dev'
|
|
29
|
-
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
|
|
30
|
-
Requires-Dist: pre-commit>=3.0 ; extra == 'dev'
|
|
31
|
-
Requires-Dist: maturin>=1.0 ; extra == 'dev'
|
|
32
|
-
Requires-Dist: mkdocs>=1.5 ; extra == 'docs'
|
|
33
|
-
Requires-Dist: mkdocs-material>=9.0 ; extra == 'docs'
|
|
34
|
-
Requires-Dist: mkdocstrings[python]>=0.20 ; extra == 'docs'
|
|
35
|
-
Provides-Extra: dev
|
|
36
|
-
Provides-Extra: docs
|
|
37
|
-
License-File: LICENSE
|
|
38
|
-
Summary: High-performance Flask-compatible web framework with async support
|
|
39
|
-
Keywords: web,framework,async,performance,flask
|
|
40
|
-
Author-email: BustAPI Team <hello@bustapi.dev>
|
|
41
|
-
License: MIT
|
|
42
|
-
Requires-Python: >=3.8
|
|
43
|
-
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
44
|
-
Project-URL: Homepage, https://github.com/bustapi/bustapi
|
|
45
|
-
Project-URL: Documentation, https://bustapi.dev
|
|
46
|
-
Project-URL: Repository, https://github.com/bustapi/bustapi.git
|
|
47
|
-
Project-URL: Issues, https://github.com/bustapi/bustapi/issues
|
|
48
|
-
|
|
49
|
-
# BustAPI 🚀
|
|
50
|
-
|
|
51
|
-
[](https://badge.fury.io/py/bustapi)
|
|
52
|
-
[](https://www.python.org/downloads/)
|
|
53
|
-
[](https://opensource.org/licenses/MIT)
|
|
54
|
-
|
|
55
|
-
**BustAPI** is a high-performance, Flask-compatible Python web framework built with a Rust backend using PyO3. It combines Flask's simplicity with modern async capabilities and superior performance.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<h1>NOTE</h1>
|
|
59
|
-
- Made by AI , so Docs are not valid 100%
|
|
60
|
-
|
|
61
|
-
## ✨ Features
|
|
62
|
-
|
|
63
|
-
- 🏃♂️ **High Performance**: Built with Rust for maximum speed (50,000+ RPS)
|
|
64
|
-
- 🔄 **Hybrid Async/Sync**: Seamlessly support both programming models
|
|
65
|
-
- 🔌 **Flask Compatible**: Drop-in replacement with same API
|
|
66
|
-
- 🛠️ **Extension Support**: Works with Flask-CORS, SQLAlchemy, Login, JWT-Extended
|
|
67
|
-
- 🔥 **Hot Reload**: File watching with automatic restart
|
|
68
|
-
- 🛡️ **Production Ready**: Built-in security, monitoring, and cross-platform support
|
|
69
|
-
- 📦 **Modern Tooling**: UV packaging, fast builds, automated releases
|
|
70
|
-
|
|
71
|
-
## 🚀 Quick Start
|
|
72
|
-
|
|
73
|
-
### Installation
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
pip install bustapi
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Hello World
|
|
80
|
-
|
|
81
|
-
```python
|
|
82
|
-
from bustapi import BustAPI
|
|
83
|
-
|
|
84
|
-
app = BustAPI()
|
|
85
|
-
|
|
86
|
-
@app.route('/')
|
|
87
|
-
def hello():
|
|
88
|
-
return {'message': 'Hello, World!'}
|
|
89
|
-
|
|
90
|
-
@app.route('/async')
|
|
91
|
-
async def async_hello():
|
|
92
|
-
return {'message': 'Async Hello!'}
|
|
93
|
-
|
|
94
|
-
if __name__ == '__main__':
|
|
95
|
-
app.run(debug=True)
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Flask Migration
|
|
99
|
-
|
|
100
|
-
BustAPI is designed as a drop-in replacement for Flask:
|
|
101
|
-
|
|
102
|
-
```python
|
|
103
|
-
# Just change the import!
|
|
104
|
-
# from flask import Flask
|
|
105
|
-
from bustapi import BustAPI as Flask
|
|
106
|
-
|
|
107
|
-
app = Flask(__name__)
|
|
108
|
-
# Rest of your Flask code works unchanged!
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## 🔧 Development
|
|
112
|
-
|
|
113
|
-
### Prerequisites
|
|
114
|
-
|
|
115
|
-
- Python 3.8+
|
|
116
|
-
- Rust 1.70+
|
|
117
|
-
- UV (for package management)
|
|
118
|
-
|
|
119
|
-
### Setup
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
git clone https://github.com/grandpaej/bustapi.git
|
|
123
|
-
cd bustapi
|
|
124
|
-
uv sync --extra dev
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Build
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
maturin develop
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Run Tests
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
pytest
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Run Benchmarks
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
python benchmarks/benchmark_core.py
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## 📊 Performance
|
|
146
|
-
|
|
147
|
-
BustAPI targets exceptional performance:
|
|
148
|
-
|
|
149
|
-
| Framework | Requests/sec | Memory Usage | Latency P99 |
|
|
150
|
-
|-----------|--------------|--------------|-------------|
|
|
151
|
-
| BustAPI | 50,000+ | <50MB | <10ms |
|
|
152
|
-
| Flask | 5,000-10,000 | 80-120MB | 50-100ms |
|
|
153
|
-
| FastAPI | 20,000-30,000| 60-90MB | 20-30ms |
|
|
154
|
-
|
|
155
|
-
## 🔌 Flask Extension Compatibility
|
|
156
|
-
|
|
157
|
-
BustAPI works with popular Flask extensions:
|
|
158
|
-
|
|
159
|
-
```python
|
|
160
|
-
from flask_cors import CORS
|
|
161
|
-
from flask_sqlalchemy import SQLAlchemy
|
|
162
|
-
from bustapi import BustAPI
|
|
163
|
-
|
|
164
|
-
app = BustAPI()
|
|
165
|
-
|
|
166
|
-
# Flask extensions work without changes
|
|
167
|
-
CORS(app)
|
|
168
|
-
db = SQLAlchemy(app)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
**Supported Extensions:**
|
|
172
|
-
- ✅ Flask-CORS
|
|
173
|
-
- ✅ Flask-SQLAlchemy
|
|
174
|
-
- ✅ Flask-Login
|
|
175
|
-
- ✅ Flask-JWT-Extended
|
|
176
|
-
- 🔄 More extensions being added
|
|
177
|
-
|
|
178
|
-
## 🛠️ CLI Usage
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
# Run application
|
|
182
|
-
bustapi run app:app
|
|
183
|
-
|
|
184
|
-
# Run with hot reload
|
|
185
|
-
bustapi run --reload --debug app:app
|
|
186
|
-
|
|
187
|
-
# Initialize new project
|
|
188
|
-
bustapi init myproject
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## 📚 Documentation
|
|
192
|
-
|
|
193
|
-
- [Quick Start Guide](https://bustapi.dev/quickstart)
|
|
194
|
-
- [API Reference](https://bustapi.dev/api)
|
|
195
|
-
- [Migration from Flask](https://bustapi.dev/migration)
|
|
196
|
-
- [Performance Guide](https://bustapi.dev/performance)
|
|
197
|
-
- [Extension Development](https://bustapi.dev/extensions)
|
|
198
|
-
|
|
199
|
-
## 🤝 Contributing
|
|
200
|
-
|
|
201
|
-
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
202
|
-
|
|
203
|
-
### Development Setup
|
|
204
|
-
|
|
205
|
-
1. Fork the repository
|
|
206
|
-
2. Create a virtual environment: `uv venv`
|
|
207
|
-
3. Install dependencies: `uv sync --extra dev`
|
|
208
|
-
4. Install pre-commit hooks: `pre-commit install`
|
|
209
|
-
5. Make your changes and run tests
|
|
210
|
-
6. Submit a pull request
|
|
211
|
-
|
|
212
|
-
## 📄 License
|
|
213
|
-
|
|
214
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
215
|
-
|
|
216
|
-
## 🙏 Acknowledgments
|
|
217
|
-
|
|
218
|
-
- Built with [PyO3](https://github.com/PyO3/pyo3) for Python-Rust integration
|
|
219
|
-
- Inspired by [Flask](https://flask.palletsprojects.com/) for the API design
|
|
220
|
-
- Uses [Tokio](https://tokio.rs/) and [Hyper](https://hyper.rs/) for async HTTP handling
|
|
221
|
-
|
|
222
|
-
## 🔗 Links
|
|
223
|
-
|
|
224
|
-
- [Homepage](https://bustapi.dev)
|
|
225
|
-
- [Documentation](https://bustapi.dev/docs)
|
|
226
|
-
- [PyPI Package](https://pypi.org/project/bustapi/)
|
|
227
|
-
- [GitHub Repository](https://github.com/bustapi/bustapi)
|
|
228
|
-
- [Issue Tracker](https://github.com/bustapi/bustapi/issues)
|
|
229
|
-
|
|
230
|
-
---
|
|
231
|
-
|
|
232
|
-
**BustAPI** - *High-performance Flask-compatible web framework* 🚀
|
|
233
|
-
|
bustapi-0.1.0.dist-info/RECORD
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
bustapi-0.1.0.dist-info/METADATA,sha256=OR9KqpKo1UeLXwHgYd7GwmibDP8oRqz6fUyhIQLhgTg,6602
|
|
2
|
-
bustapi-0.1.0.dist-info/WHEEL,sha256=YCZ9Vxhf2aXNyfoR2QH-PPqnUr48Igr9zjgnGhp3xTc,96
|
|
3
|
-
bustapi-0.1.0.dist-info/entry_points.txt,sha256=rsTfPFL20JIrjJAAXxTWETsd6aqFdbsCJUd478dkI30,43
|
|
4
|
-
bustapi-0.1.0.dist-info/licenses/LICENSE,sha256=V2GOYCgpPjxQF18t7-EfVS2CXdSGNe4czXv1NUs4o18,1088
|
|
5
|
-
bustapi/__init__.py,sha256=2jV0H9sBzpV4MuRShLXSR3trD9SyfGmjiwYi7zdcL7w,2224
|
|
6
|
-
bustapi/app.py,sha256=ckI9M3CXVGaLEVyfIaYl-iO5lluvWzm4Powmkpvi7-Q,18811
|
|
7
|
-
bustapi/blueprints.py,sha256=286VL4Kim8LstmCTzV4YaScE4yMuwWvP7Dvw_vMs15Y,15007
|
|
8
|
-
bustapi/bustapi_core.cp311-win_amd64.pyd,sha256=BNTuDvQPcVRDFgUupdE4hqqjGEGbW6TE1exfPZUo3CY,744448
|
|
9
|
-
bustapi/exceptions.py,sha256=tcQW9pDz20vy3R5RK5FP7wHjG3DMSYvUfn2FWi_MnbE,12823
|
|
10
|
-
bustapi/flask_compat.py,sha256=sgvVGvonTEAcgykGsS-TfnVfA7fAPHHRWUYqTZHU10w,1339
|
|
11
|
-
bustapi/helpers.py,sha256=BtFdsDfk5q0R4EsjxqIxjfhTaVqIWhA1_6qqa74y3v4,9343
|
|
12
|
-
bustapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
bustapi/request.py,sha256=IHuASZqKsnxaYPIfuYqlVW1PGIjvYN04s7y_Q1c-yfE,11752
|
|
14
|
-
bustapi/response.py,sha256=nKAYveh4dF0TcHb9wqXLMW8zS_NGqpjzYYIJh6Bc3ZU,11840
|
|
15
|
-
bustapi/testing.py,sha256=nQWnSjQ3-7AhtcqEyiRPEnkXUBnIKNncfgYHYstIzms,11954
|
|
16
|
-
bustapi-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|