asgi-tools 1.2.0__cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.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.
- asgi_tools/__init__.py +65 -0
- asgi_tools/_compat.py +259 -0
- asgi_tools/app.py +303 -0
- asgi_tools/constants.py +6 -0
- asgi_tools/errors.py +25 -0
- asgi_tools/forms.c +19218 -0
- asgi_tools/forms.cpython-312-aarch64-linux-gnu.so +0 -0
- asgi_tools/forms.py +166 -0
- asgi_tools/forms.pyx +167 -0
- asgi_tools/logs.py +6 -0
- asgi_tools/middleware.py +458 -0
- asgi_tools/multipart.c +19234 -0
- asgi_tools/multipart.cpython-312-aarch64-linux-gnu.so +0 -0
- asgi_tools/multipart.pxd +34 -0
- asgi_tools/multipart.py +589 -0
- asgi_tools/multipart.pyx +565 -0
- asgi_tools/py.typed +0 -0
- asgi_tools/request.py +337 -0
- asgi_tools/response.py +537 -0
- asgi_tools/router.py +15 -0
- asgi_tools/tests.py +405 -0
- asgi_tools/types.py +31 -0
- asgi_tools/utils.py +110 -0
- asgi_tools/view.py +69 -0
- asgi_tools-1.2.0.dist-info/METADATA +214 -0
- asgi_tools-1.2.0.dist-info/RECORD +29 -0
- asgi_tools-1.2.0.dist-info/WHEEL +7 -0
- asgi_tools-1.2.0.dist-info/licenses/LICENSE +21 -0
- asgi_tools-1.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,214 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: asgi-tools
|
3
|
+
Version: 1.2.0
|
4
|
+
Summary: ASGI Toolkit to build web applications
|
5
|
+
Author-email: Kirill Klenov <horneds@gmail.com>
|
6
|
+
License: MIT License
|
7
|
+
Project-URL: homepage, https://github.com/klen/asgi-tools
|
8
|
+
Project-URL: repository, https://github.com/klen/asgi-tools
|
9
|
+
Project-URL: documentation, https://klen.github.io/asgi-tools
|
10
|
+
Keywords: asgi,asgi-tools,request,response,asyncio,trio
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Programming Language :: Python
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
20
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
21
|
+
Classifier: Programming Language :: Cython
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
23
|
+
Classifier: Framework :: AsyncIO
|
24
|
+
Classifier: Framework :: Trio
|
25
|
+
Requires-Python: >=3.10
|
26
|
+
Description-Content-Type: text/x-rst
|
27
|
+
License-File: LICENSE
|
28
|
+
Requires-Dist: http-router>=4.0.0
|
29
|
+
Requires-Dist: multidict>=6.6.3
|
30
|
+
Requires-Dist: sniffio
|
31
|
+
Requires-Dist: yarl>=1.8.2
|
32
|
+
Requires-Dist: async-timeout; python_version < "3.11"
|
33
|
+
Provides-Extra: tests
|
34
|
+
Requires-Dist: aiofile; extra == "tests"
|
35
|
+
Requires-Dist: pytest; extra == "tests"
|
36
|
+
Requires-Dist: pytest-aio[curio,trio]>=1.2.0; extra == "tests"
|
37
|
+
Requires-Dist: pytest-benchmark; extra == "tests"
|
38
|
+
Requires-Dist: PyYAML; extra == "tests"
|
39
|
+
Requires-Dist: ruff; extra == "tests"
|
40
|
+
Requires-Dist: mypy; extra == "tests"
|
41
|
+
Requires-Dist: exceptiongroup; python_version < "3.11" and extra == "tests"
|
42
|
+
Requires-Dist: ujson; implementation_name == "cpython" and extra == "tests"
|
43
|
+
Requires-Dist: uvloop; implementation_name == "cpython" and extra == "tests"
|
44
|
+
Requires-Dist: pytest-mypy; implementation_name == "cpython" and extra == "tests"
|
45
|
+
Provides-Extra: ujson
|
46
|
+
Requires-Dist: ujson; extra == "ujson"
|
47
|
+
Provides-Extra: orjson
|
48
|
+
Requires-Dist: orjson; extra == "orjson"
|
49
|
+
Provides-Extra: examples
|
50
|
+
Requires-Dist: uvicorn[standard]; extra == "examples"
|
51
|
+
Requires-Dist: jinja2; extra == "examples"
|
52
|
+
Requires-Dist: httpx; extra == "examples"
|
53
|
+
Provides-Extra: dev
|
54
|
+
Requires-Dist: bump2version; extra == "dev"
|
55
|
+
Requires-Dist: tox; extra == "dev"
|
56
|
+
Requires-Dist: cython; extra == "dev"
|
57
|
+
Requires-Dist: pre-commit; extra == "dev"
|
58
|
+
Requires-Dist: sphinx; extra == "dev"
|
59
|
+
Requires-Dist: pydata-sphinx-theme; extra == "dev"
|
60
|
+
Dynamic: license-file
|
61
|
+
|
62
|
+
.. image:: https://raw.githubusercontent.com/klen/asgi-tools/develop/.github/assets/asgi-tools.png
|
63
|
+
:height: 100
|
64
|
+
|
65
|
+
.. _description:
|
66
|
+
|
67
|
+
**asgi-tools** -- Is a really lightweight ASGI_ Toolkit to build ASGI applications faster.
|
68
|
+
|
69
|
+
.. _badges:
|
70
|
+
|
71
|
+
.. image:: https://github.com/klen/asgi-tools/workflows/tests/badge.svg
|
72
|
+
:target: https://github.com/klen/asgi-tools/actions
|
73
|
+
:alt: Tests Status
|
74
|
+
|
75
|
+
.. image:: https://github.com/klen/asgi-tools/workflows/docs/badge.svg
|
76
|
+
:target: https://klen.github.io/asgi-tools
|
77
|
+
:alt: Documentation Status
|
78
|
+
|
79
|
+
.. image:: https://img.shields.io/pypi/v/asgi-tools
|
80
|
+
:target: https://pypi.org/project/asgi-tools/
|
81
|
+
:alt: PYPI Version
|
82
|
+
|
83
|
+
.. image:: https://img.shields.io/pypi/pyversions/asgi-tools
|
84
|
+
:target: https://pypi.org/project/asgi-tools/
|
85
|
+
:alt: Python Versions
|
86
|
+
|
87
|
+
----------
|
88
|
+
|
89
|
+
.. _documentation:
|
90
|
+
|
91
|
+
**Documentation is here**: https://klen.github.io/asgi-tools
|
92
|
+
|
93
|
+
ASGI-Tools is designed to be used as an ASGI Toolkit to quickly build really
|
94
|
+
lightweight ASGI applications/middlewares/tools.
|
95
|
+
|
96
|
+
For instance these middlewares were built with the library:
|
97
|
+
|
98
|
+
* `ASGI-Sessions <https://github.com/klen/asgi-sessions>`_
|
99
|
+
* `ASGI-Babel <https://github.com/klen/asgi-babel>`_
|
100
|
+
* `ASGI-Prometheus <https://github.com/klen/asgi-prometheus>`_
|
101
|
+
|
102
|
+
.. _features:
|
103
|
+
|
104
|
+
**Features:**
|
105
|
+
|
106
|
+
- Supports all most popular async python libraries: `Asyncio`_, `Trio`_ and Curio_
|
107
|
+
- `Request`_ -- Parse ASGI scope, get url, headers, cookies, read a request's data/json/form-data
|
108
|
+
- `Response`_ -- Send HTTP (text, html, json, stream, sse, file, http errors) responses
|
109
|
+
- `ResponseWebsocket`_ -- Work with websockets
|
110
|
+
- `RequestMiddleware`_ -- Parse a scope and insert the parsed request into the scope
|
111
|
+
- `ResponseMiddleware`_ -- Parse responses and convert them into ASGI messages
|
112
|
+
- `RouterMiddleware`_ -- Route HTTP requests
|
113
|
+
- `LifespanMiddleware`_ -- Process a lifespan cycle
|
114
|
+
- `StaticFilesMiddleware`_ -- Serve static files from URL prefixes
|
115
|
+
- `asgi_tools.tests.TestClient <https://klen.github.io/asgi-tools/api.html#testclient>`_ -- A test client with websockets support to test asgi applications
|
116
|
+
- `App`_ -- A simple foundation for ASGI apps
|
117
|
+
|
118
|
+
.. _contents:
|
119
|
+
|
120
|
+
.. contents::
|
121
|
+
|
122
|
+
.. _requirements:
|
123
|
+
|
124
|
+
Requirements
|
125
|
+
=============
|
126
|
+
|
127
|
+
- python >= 3.9
|
128
|
+
|
129
|
+
.. note:: pypy3 is also supported
|
130
|
+
|
131
|
+
**ASGI-Tools** belongs to the category of ASGI_ web frameworks, so it requires
|
132
|
+
an ASGI HTTP server to run, such as uvicorn_, daphne_, or hypercorn_.
|
133
|
+
|
134
|
+
.. _installation:
|
135
|
+
|
136
|
+
Installation
|
137
|
+
=============
|
138
|
+
|
139
|
+
**asgi-tools** should be installed using pip: ::
|
140
|
+
|
141
|
+
pip install asgi-tools
|
142
|
+
|
143
|
+
A Quick Example
|
144
|
+
===============
|
145
|
+
|
146
|
+
You can use any of ASGI-Tools components independently.
|
147
|
+
|
148
|
+
Despite this ASGI-Tools contains App_ helper to quickly build ASGI
|
149
|
+
applications. For instance:
|
150
|
+
|
151
|
+
Save this to ``app.py``.
|
152
|
+
|
153
|
+
.. code-block:: python
|
154
|
+
|
155
|
+
from asgi_tools import App
|
156
|
+
|
157
|
+
app = App()
|
158
|
+
|
159
|
+
@app.route('/')
|
160
|
+
async def hello(request):
|
161
|
+
return "Hello World!"
|
162
|
+
|
163
|
+
Run it with `uvicorn`
|
164
|
+
|
165
|
+
.. code-block:: sh
|
166
|
+
|
167
|
+
$ uvicorn app:app
|
168
|
+
|
169
|
+
|
170
|
+
.. _bugtracker:
|
171
|
+
|
172
|
+
Bug tracker
|
173
|
+
===========
|
174
|
+
|
175
|
+
If you have any suggestions, bug reports or
|
176
|
+
annoyances please report them to the issue tracker
|
177
|
+
at https://github.com/klen/asgi-tools/issues
|
178
|
+
|
179
|
+
.. _contributing:
|
180
|
+
|
181
|
+
Contributing
|
182
|
+
============
|
183
|
+
|
184
|
+
Development of the project happens at: https://github.com/klen/asgi-tools
|
185
|
+
|
186
|
+
.. _license:
|
187
|
+
|
188
|
+
License
|
189
|
+
========
|
190
|
+
|
191
|
+
Licensed under a `MIT license`_.
|
192
|
+
|
193
|
+
|
194
|
+
.. _links:
|
195
|
+
|
196
|
+
.. _ASGI: https://asgi.readthedocs.io/en/latest/
|
197
|
+
.. _Asyncio: https://docs.python.org/3/library/asyncio.html
|
198
|
+
.. _Curio: https://curio.readthedocs.io/en/latest/
|
199
|
+
.. _MIT license: http://opensource.org/licenses/MIT
|
200
|
+
.. _Trio: https://trio.readthedocs.io/en/stable/index.html
|
201
|
+
.. _klen: https://github.com/klen
|
202
|
+
.. _uvicorn: http://www.uvicorn.org/
|
203
|
+
.. _daphne: https://github.com/django/daphne/
|
204
|
+
.. _hypercorn: https://github.com/pgjones/hypercorn/
|
205
|
+
|
206
|
+
.. _Request: https://klen.github.io/asgi-tools/api.html#request
|
207
|
+
.. _Response: https://klen.github.io/asgi-tools/api.html#responses
|
208
|
+
.. _ResponseWebSocket: https://klen.github.io/asgi-tools/api.html#responsewebsocket
|
209
|
+
.. _RequestMiddleware: https://klen.github.io/asgi-tools/api.html#requestmiddleware
|
210
|
+
.. _ResponseMiddleware: https://klen.github.io/asgi-tools/api.html#responsemiddleware
|
211
|
+
.. _LifespanMiddleware: https://klen.github.io/asgi-tools/api.html#lifespanmiddleware
|
212
|
+
.. _StaticFilesMiddleware: https://klen.github.io/asgi-tools/api.html#staticfilesmiddleware
|
213
|
+
.. _RouterMiddleware: https://klen.github.io/asgi-tools/api.html#routermiddleware
|
214
|
+
.. _App: https://klen.github.io/asgi-tools/api.html#application
|
@@ -0,0 +1,29 @@
|
|
1
|
+
asgi_tools/__init__.py,sha256=tBnlggb3FJPK8tDrnpC580OfbQ0QpuKFRdyfxmIeu8w,1428
|
2
|
+
asgi_tools/_compat.py,sha256=3BTsysYhxa0itJzCWnzpnE-HuYGs7vXzZRgQRei0IW4,7483
|
3
|
+
asgi_tools/app.py,sha256=OEkoRszSRJ9bwWQ3SKWm3Pv-R0B8uKcP9ciYsDMyCGg,10790
|
4
|
+
asgi_tools/constants.py,sha256=B7fJabLdpSE4COX0vAudyC32xV0dSpLgg0kob-FlCkE,128
|
5
|
+
asgi_tools/errors.py,sha256=TTAtJL5w2EVm9dVNK2pqNBRWM1lGJXg7HnJTibjgkes,550
|
6
|
+
asgi_tools/forms.c,sha256=v7t7ia5JTU68Eg1weG353v2IKfjQf_jTKUBSDmg8pgQ,826881
|
7
|
+
asgi_tools/forms.cpython-312-aarch64-linux-gnu.so,sha256=7B1WTvJwFbeNWgq0VzkLIGBXq9gHvThZ-rlRPnKNzwE,1643080
|
8
|
+
asgi_tools/forms.py,sha256=ers1A52YEAO1TBYWJP73K6q6jArNU7QbV0LjTlpKdeM,5059
|
9
|
+
asgi_tools/forms.pyx,sha256=ol1iEXDwS--9vNIoxFFvcTRvzUF14gQC3SDWW9K5-k8,5340
|
10
|
+
asgi_tools/logs.py,sha256=FaXJF5UYClU-JdqLL7VANxQ8O-eYAEemt0Zc_GaEC60,148
|
11
|
+
asgi_tools/middleware.py,sha256=_hTALpm3Gv_3ssCyZfInzuFC8onNz2ZFVrDCdgOcnF8,15148
|
12
|
+
asgi_tools/multipart.c,sha256=EY4Z9r8PmtB-EuV7mI1evcyEGOFpKZCT-KeE5GPH2II,844007
|
13
|
+
asgi_tools/multipart.cpython-312-aarch64-linux-gnu.so,sha256=0cr1slTo7A_AzZSyP3mwl7cSDlyMmqvd23hAd_g1TJE,1322952
|
14
|
+
asgi_tools/multipart.pxd,sha256=bPnRLYuBw51OX7v-SZTOgOpb4PxM1MtR5dGWVoymX3A,725
|
15
|
+
asgi_tools/multipart.py,sha256=8RkJm9JIjyjR7z2OIhYg8fgLKq21HBWCMEOwbhx-3GA,21707
|
16
|
+
asgi_tools/multipart.pyx,sha256=pq-DzmAaRhS0yMJIFPNI-GP7OjJUt4k3Y8vMbXJOpKk,21929
|
17
|
+
asgi_tools/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
|
+
asgi_tools/request.py,sha256=s-CqT9JI-aPZz46YtKyvSDR7CfLxEhPrIuH9OG6npzk,10802
|
19
|
+
asgi_tools/response.py,sha256=ZBe1UCu64k8hRqrgGvhGrk-mT653mWnaDa7a01LFkD0,18685
|
20
|
+
asgi_tools/router.py,sha256=1MCF5QLfYPWZH10AuXMRN0rTMTyQWciDSh3owgsFhk4,440
|
21
|
+
asgi_tools/tests.py,sha256=elUGlBE8qklBzKAov1x1i0eVHfkFLzj5Oifd6_JjHv4,12944
|
22
|
+
asgi_tools/types.py,sha256=QWmrnhqc_jEUaXUcMm5iMpxpd6vrTcCnlq4O9moKANg,926
|
23
|
+
asgi_tools/utils.py,sha256=6qNwZbUsKatg75Gi1ltRsAeJhBaf1gwJkuR0LemitRw,2813
|
24
|
+
asgi_tools/view.py,sha256=DO0Lr8euP98kMicDwmZLcbMpJ-Hzbhl3vYFYqAXpisw,1925
|
25
|
+
asgi_tools-1.2.0.dist-info/METADATA,sha256=Oyxz72uoD1qM5iK1fxjGVEYtWZ61H-Ma0GO16M_kPKA,7138
|
26
|
+
asgi_tools-1.2.0.dist-info/WHEEL,sha256=8dLfIaEdZhvKMcxjctjlRF9OMhsXJ-Ot8dAcG4hIc8U,193
|
27
|
+
asgi_tools-1.2.0.dist-info/top_level.txt,sha256=-6i6ebKuJ0cSaXJ3KWPmJLKUbmBE2UsuA2b7BcZMJSk,11
|
28
|
+
asgi_tools-1.2.0.dist-info/RECORD,,
|
29
|
+
asgi_tools-1.2.0.dist-info/licenses/LICENSE,sha256=ytogAgYcPT6gWj8aRc-cZwhSq9Y3wOzG-4KteKCyQOw,1070
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Kirill Klenov
|
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.
|
@@ -0,0 +1 @@
|
|
1
|
+
asgi_tools
|