turboweb 1.3__tar.gz
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.
- turboweb-1.3/LICENSE +21 -0
- turboweb-1.3/PKG-INFO +126 -0
- turboweb-1.3/README.md +98 -0
- turboweb-1.3/pyproject.toml +34 -0
- turboweb-1.3/setup.cfg +4 -0
- turboweb-1.3/setup.py +32 -0
- turboweb-1.3/turboweb/__init__.py +785 -0
- turboweb-1.3/turboweb/turboweb_core.c +332 -0
- turboweb-1.3/turboweb.egg-info/PKG-INFO +126 -0
- turboweb-1.3/turboweb.egg-info/SOURCES.txt +11 -0
- turboweb-1.3/turboweb.egg-info/dependency_links.txt +1 -0
- turboweb-1.3/turboweb.egg-info/requires.txt +1 -0
- turboweb-1.3/turboweb.egg-info/top_level.txt +1 -0
turboweb-1.3/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ScadeBlock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
turboweb-1.3/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: turboweb
|
|
3
|
+
Version: 1.3
|
|
4
|
+
Summary: High-performance Python web framework with C extension
|
|
5
|
+
Home-page: https://github.com/ScadeBlock/turboweb
|
|
6
|
+
Author: ScadeBlock
|
|
7
|
+
Author-email: ScadeBlock <scadeblock@github.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/ScadeBlock/turboweb
|
|
10
|
+
Project-URL: Repository, https://github.com/ScadeBlock/turboweb
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Requires-Python: >=3.7
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: fastpysgi
|
|
24
|
+
Dynamic: author
|
|
25
|
+
Dynamic: home-page
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
Dynamic: requires-python
|
|
28
|
+
|
|
29
|
+
# TurboWeb
|
|
30
|
+
|
|
31
|
+
High-performance Python web framework with C extension for maximum speed.
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- **Fast**: C-accelerated core for high-throughput applications
|
|
36
|
+
- **Async & Sync**: Supports both asyncio and synchronous handlers
|
|
37
|
+
- **ASGI/WSGI**: Compatible with both ASGI and WSGI servers
|
|
38
|
+
- **Routing**: Dynamic route parameters with type conversion
|
|
39
|
+
- **Middleware**: Request/response middleware support
|
|
40
|
+
- **CORS**: Built-in CORS configuration
|
|
41
|
+
- **Static Files**: Serve static files efficiently
|
|
42
|
+
- **File Uploads**: Multipart form data parsing
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install turboweb
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from turboweb import TurboWeb, response
|
|
54
|
+
|
|
55
|
+
app = TurboWeb()
|
|
56
|
+
|
|
57
|
+
@app.route("/")
|
|
58
|
+
def index(req):
|
|
59
|
+
return response.json({"message": "Hello, TurboWeb!"})
|
|
60
|
+
|
|
61
|
+
@app.route("/user/<name>")
|
|
62
|
+
def greet(req, name):
|
|
63
|
+
return response.text(f"Hello, {name}!")
|
|
64
|
+
|
|
65
|
+
@app.route("/api/data", methods=["POST"])
|
|
66
|
+
async def api_data(req):
|
|
67
|
+
data = req.json
|
|
68
|
+
return response.json({"received": data})
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
app.run(host="0.0.0.0", port=8000)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Async Support
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
@app.route("/async")
|
|
78
|
+
async def async_handler(req):
|
|
79
|
+
await asyncio.sleep(0.1)
|
|
80
|
+
return response.json({"status": "done"})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Middleware
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
@app.middleware("request")
|
|
87
|
+
def log_request(req):
|
|
88
|
+
print(f"{req.method} {req.path}")
|
|
89
|
+
|
|
90
|
+
@app.middleware("response")
|
|
91
|
+
def add_header(req, resp):
|
|
92
|
+
resp.headers.append(("X-Custom-Header", "TurboWeb"))
|
|
93
|
+
return resp
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## CORS
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
app.cors(
|
|
100
|
+
allow_origins=["https://example.com"],
|
|
101
|
+
allow_methods=["GET", "POST"],
|
|
102
|
+
allow_headers=["Content-Type"],
|
|
103
|
+
allow_credentials=True
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Static Files
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
app.static("/static", "./public")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Running with Workers
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
app.run(host="0.0.0.0", port=8000, workers=4)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Requirements
|
|
120
|
+
|
|
121
|
+
- Python 3.7+
|
|
122
|
+
- fastpysgi (installed automatically)
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT License
|
turboweb-1.3/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# TurboWeb
|
|
2
|
+
|
|
3
|
+
High-performance Python web framework with C extension for maximum speed.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Fast**: C-accelerated core for high-throughput applications
|
|
8
|
+
- **Async & Sync**: Supports both asyncio and synchronous handlers
|
|
9
|
+
- **ASGI/WSGI**: Compatible with both ASGI and WSGI servers
|
|
10
|
+
- **Routing**: Dynamic route parameters with type conversion
|
|
11
|
+
- **Middleware**: Request/response middleware support
|
|
12
|
+
- **CORS**: Built-in CORS configuration
|
|
13
|
+
- **Static Files**: Serve static files efficiently
|
|
14
|
+
- **File Uploads**: Multipart form data parsing
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install turboweb
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from turboweb import TurboWeb, response
|
|
26
|
+
|
|
27
|
+
app = TurboWeb()
|
|
28
|
+
|
|
29
|
+
@app.route("/")
|
|
30
|
+
def index(req):
|
|
31
|
+
return response.json({"message": "Hello, TurboWeb!"})
|
|
32
|
+
|
|
33
|
+
@app.route("/user/<name>")
|
|
34
|
+
def greet(req, name):
|
|
35
|
+
return response.text(f"Hello, {name}!")
|
|
36
|
+
|
|
37
|
+
@app.route("/api/data", methods=["POST"])
|
|
38
|
+
async def api_data(req):
|
|
39
|
+
data = req.json
|
|
40
|
+
return response.json({"received": data})
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
app.run(host="0.0.0.0", port=8000)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Async Support
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
@app.route("/async")
|
|
50
|
+
async def async_handler(req):
|
|
51
|
+
await asyncio.sleep(0.1)
|
|
52
|
+
return response.json({"status": "done"})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Middleware
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
@app.middleware("request")
|
|
59
|
+
def log_request(req):
|
|
60
|
+
print(f"{req.method} {req.path}")
|
|
61
|
+
|
|
62
|
+
@app.middleware("response")
|
|
63
|
+
def add_header(req, resp):
|
|
64
|
+
resp.headers.append(("X-Custom-Header", "TurboWeb"))
|
|
65
|
+
return resp
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## CORS
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
app.cors(
|
|
72
|
+
allow_origins=["https://example.com"],
|
|
73
|
+
allow_methods=["GET", "POST"],
|
|
74
|
+
allow_headers=["Content-Type"],
|
|
75
|
+
allow_credentials=True
|
|
76
|
+
)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Static Files
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
app.static("/static", "./public")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Running with Workers
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
app.run(host="0.0.0.0", port=8000, workers=4)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Requirements
|
|
92
|
+
|
|
93
|
+
- Python 3.7+
|
|
94
|
+
- fastpysgi (installed automatically)
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT License
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "turboweb"
|
|
7
|
+
version = "1.3"
|
|
8
|
+
description = "High-performance Python web framework with C extension"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
authors = [{name = "ScadeBlock", email = "scadeblock@github.com"}]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.7",
|
|
15
|
+
"Programming Language :: Python :: 3.8",
|
|
16
|
+
"Programming Language :: Python :: 3.9",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
]
|
|
23
|
+
requires-python = ">=3.7"
|
|
24
|
+
dependencies = ["fastpysgi"]
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/ScadeBlock/turboweb"
|
|
28
|
+
Repository = "https://github.com/ScadeBlock/turboweb"
|
|
29
|
+
|
|
30
|
+
[tool.setuptools]
|
|
31
|
+
packages = ["turboweb"]
|
|
32
|
+
ext-modules = [
|
|
33
|
+
{name = "turboweb.turboweb_core", sources = ["turboweb/turboweb_core.c"]}
|
|
34
|
+
]
|
turboweb-1.3/setup.cfg
ADDED
turboweb-1.3/setup.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from setuptools import setup, Extension, find_packages
|
|
2
|
+
|
|
3
|
+
turboweb_extension = Extension(
|
|
4
|
+
name="turboweb.turboweb_core",
|
|
5
|
+
sources=["turboweb/turboweb_core.c"],
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
setup(
|
|
9
|
+
name="turboweb",
|
|
10
|
+
version="1.3",
|
|
11
|
+
packages=find_packages(),
|
|
12
|
+
ext_modules=[turboweb_extension],
|
|
13
|
+
python_requires=">=3.7",
|
|
14
|
+
install_requires=["fastpysgi"],
|
|
15
|
+
author="ScadeBlock",
|
|
16
|
+
author_email="scadeblock@github.com",
|
|
17
|
+
description="High-performance Python web framework with C extension",
|
|
18
|
+
long_description=open("README.md", encoding="utf-8").read(),
|
|
19
|
+
long_description_content_type="text/markdown",
|
|
20
|
+
url="https://github.com/ScadeBlock/turboweb",
|
|
21
|
+
classifiers=[
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.7",
|
|
24
|
+
"Programming Language :: Python :: 3.8",
|
|
25
|
+
"Programming Language :: Python :: 3.9",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
],
|
|
32
|
+
)
|