update to python fastpi
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,181 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: uvicorn
|
||||
Version: 0.24.0
|
||||
Summary: The lightning-fast ASGI server.
|
||||
Project-URL: Changelog, https://github.com/encode/uvicorn/blob/master/CHANGELOG.md
|
||||
Project-URL: Funding, https://github.com/sponsors/encode
|
||||
Project-URL: Homepage, https://www.uvicorn.org/
|
||||
Project-URL: Source, https://github.com/encode/uvicorn
|
||||
Author-email: Tom Christie <tom@tomchristie.com>
|
||||
License-Expression: BSD-3-Clause
|
||||
License-File: LICENSE.md
|
||||
Classifier: Development Status :: 4 - Beta
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
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: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Classifier: Topic :: Internet :: WWW/HTTP
|
||||
Requires-Python: >=3.8
|
||||
Requires-Dist: click>=7.0
|
||||
Requires-Dist: h11>=0.8
|
||||
Requires-Dist: typing-extensions>=4.0; python_version < '3.11'
|
||||
Provides-Extra: standard
|
||||
Requires-Dist: colorama>=0.4; sys_platform == 'win32' and extra == 'standard'
|
||||
Requires-Dist: httptools>=0.5.0; extra == 'standard'
|
||||
Requires-Dist: python-dotenv>=0.13; extra == 'standard'
|
||||
Requires-Dist: pyyaml>=5.1; extra == 'standard'
|
||||
Requires-Dist: uvloop!=0.15.0,!=0.15.1,>=0.14.0; sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy') and extra == 'standard'
|
||||
Requires-Dist: watchfiles>=0.13; extra == 'standard'
|
||||
Requires-Dist: websockets>=10.4; extra == 'standard'
|
||||
Description-Content-Type: text/markdown
|
||||
|
||||
<p align="center">
|
||||
<img width="320" height="320" src="https://raw.githubusercontent.com/tomchristie/uvicorn/master/docs/uvicorn.png" alt='uvicorn'>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<em>An ASGI web server, for Python.</em>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
[](https://github.com/encode/uvicorn/actions)
|
||||
[](https://pypi.python.org/pypi/uvicorn)
|
||||
[](https://pypi.org/project/uvicorn)
|
||||
|
||||
**Documentation**: [https://www.uvicorn.org](https://www.uvicorn.org)
|
||||
|
||||
**Requirements**: Python 3.8+
|
||||
|
||||
Uvicorn is an ASGI web server implementation for Python.
|
||||
|
||||
Until recently Python has lacked a minimal low-level server/application interface for
|
||||
async frameworks. The [ASGI specification][asgi] fills this gap, and means we're now able to
|
||||
start building a common set of tooling usable across all async frameworks.
|
||||
|
||||
Uvicorn supports HTTP/1.1 and WebSockets.
|
||||
|
||||
## Quickstart
|
||||
|
||||
Install using `pip`:
|
||||
|
||||
```shell
|
||||
$ pip install uvicorn
|
||||
```
|
||||
|
||||
This will install uvicorn with minimal (pure Python) dependencies.
|
||||
|
||||
```shell
|
||||
$ pip install 'uvicorn[standard]'
|
||||
```
|
||||
|
||||
This will install uvicorn with "Cython-based" dependencies (where possible) and other "optional extras".
|
||||
|
||||
In this context, "Cython-based" means the following:
|
||||
|
||||
- the event loop `uvloop` will be installed and used if possible.
|
||||
- the http protocol will be handled by `httptools` if possible.
|
||||
|
||||
Moreover, "optional extras" means that:
|
||||
|
||||
- the websocket protocol will be handled by `websockets` (should you want to use `wsproto` you'd need to install it manually) if possible.
|
||||
- the `--reload` flag in development mode will use `watchfiles`.
|
||||
- windows users will have `colorama` installed for the colored logs.
|
||||
- `python-dotenv` will be installed should you want to use the `--env-file` option.
|
||||
- `PyYAML` will be installed to allow you to provide a `.yaml` file to `--log-config`, if desired.
|
||||
|
||||
Create an application, in `example.py`:
|
||||
|
||||
```python
|
||||
async def app(scope, receive, send):
|
||||
assert scope['type'] == 'http'
|
||||
|
||||
await send({
|
||||
'type': 'http.response.start',
|
||||
'status': 200,
|
||||
'headers': [
|
||||
(b'content-type', b'text/plain'),
|
||||
],
|
||||
})
|
||||
await send({
|
||||
'type': 'http.response.body',
|
||||
'body': b'Hello, world!',
|
||||
})
|
||||
```
|
||||
|
||||
Run the server:
|
||||
|
||||
```shell
|
||||
$ uvicorn example:app
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Why ASGI?
|
||||
|
||||
Most well established Python Web frameworks started out as WSGI-based frameworks.
|
||||
|
||||
WSGI applications are a single, synchronous callable that takes a request and returns a response.
|
||||
This doesn’t allow for long-lived connections, like you get with long-poll HTTP or WebSocket connections,
|
||||
which WSGI doesn't support well.
|
||||
|
||||
Having an async concurrency model also allows for options such as lightweight background tasks,
|
||||
and can be less of a limiting factor for endpoints that have long periods being blocked on network
|
||||
I/O such as dealing with slow HTTP requests.
|
||||
|
||||
---
|
||||
|
||||
## Alternative ASGI servers
|
||||
|
||||
A strength of the ASGI protocol is that it decouples the server implementation
|
||||
from the application framework. This allows for an ecosystem of interoperating
|
||||
webservers and application frameworks.
|
||||
|
||||
### Daphne
|
||||
|
||||
The first ASGI server implementation, originally developed to power Django Channels, is [the Daphne webserver][daphne].
|
||||
|
||||
It is run widely in production, and supports HTTP/1.1, HTTP/2, and WebSockets.
|
||||
|
||||
Any of the example applications given here can equally well be run using `daphne` instead.
|
||||
|
||||
```
|
||||
$ pip install daphne
|
||||
$ daphne app:App
|
||||
```
|
||||
|
||||
### Hypercorn
|
||||
|
||||
[Hypercorn][hypercorn] was initially part of the Quart web framework, before
|
||||
being separated out into a standalone ASGI server.
|
||||
|
||||
Hypercorn supports HTTP/1.1, HTTP/2, and WebSockets.
|
||||
|
||||
It also supports [the excellent `trio` async framework][trio], as an alternative to `asyncio`.
|
||||
|
||||
```
|
||||
$ pip install hypercorn
|
||||
$ hypercorn app:App
|
||||
```
|
||||
|
||||
### Mangum
|
||||
|
||||
[Mangum][mangum] is an adapter for using ASGI applications with AWS Lambda & API Gateway.
|
||||
|
||||
---
|
||||
|
||||
<p align="center"><i>Uvicorn is <a href="https://github.com/encode/uvicorn/blob/master/LICENSE.md">BSD licensed</a> code.<br/>Designed & crafted with care.</i><br/>— 🦄 —</p>
|
||||
|
||||
[asgi]: https://asgi.readthedocs.io/en/latest/
|
||||
[daphne]: https://github.com/django/daphne
|
||||
[hypercorn]: https://github.com/pgjones/hypercorn
|
||||
[mangum]: https://mangum.io
|
||||
[trio]: https://trio.readthedocs.io
|
||||
@@ -0,0 +1,87 @@
|
||||
../../../bin/uvicorn,sha256=aGDFx2p0b64guwUezFMr1QlsCqy70x8rTCBmECnje1M,224
|
||||
uvicorn-0.24.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
uvicorn-0.24.0.dist-info/METADATA,sha256=LRJwXYsI8Q9dQnDUvzpKJ1aBW5eCBl-DvVRQZtsncV8,6352
|
||||
uvicorn-0.24.0.dist-info/RECORD,,
|
||||
uvicorn-0.24.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn-0.24.0.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
||||
uvicorn-0.24.0.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
|
||||
uvicorn-0.24.0.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
|
||||
uvicorn/__init__.py,sha256=XEfHXh-78SCvzwYakkVzl3sQoLLxJ6xz_0hyb2y7pXk,147
|
||||
uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
|
||||
uvicorn/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/__main__.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/_subprocess.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/_types.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/config.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/importer.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/logging.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/main.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/server.cpython-312.pyc,,
|
||||
uvicorn/__pycache__/workers.cpython-312.pyc,,
|
||||
uvicorn/_subprocess.py,sha256=zip7kqIlWL_GG7dBnl9dVuzScnjDt97VJJNH5PJFcts,2403
|
||||
uvicorn/_types.py,sha256=D6RGBlRV7_5_NDHmnmetSpiX8kGajdrAG7efhNHbPzs,7458
|
||||
uvicorn/config.py,sha256=q0vZZxKSK1l0kJDrUZvt2rxsnZZvDQ8Pl-Xd2dbAUls,21364
|
||||
uvicorn/importer.py,sha256=rUjBcH3xCBIvuEE7Buq4uWxjAzHPjEfP1dESQyAmPpU,1174
|
||||
uvicorn/lifespan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/lifespan/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/lifespan/__pycache__/off.cpython-312.pyc,,
|
||||
uvicorn/lifespan/__pycache__/on.cpython-312.pyc,,
|
||||
uvicorn/lifespan/off.py,sha256=vzXBbSkw_DmW7y9Kgba7fRWdJFBeJPtnzTnxUuJA8nM,302
|
||||
uvicorn/lifespan/on.py,sha256=XzBnwAjJFpO7GRA-sR2gGnnrCHBQH9niA4X-d8EIlyo,5182
|
||||
uvicorn/logging.py,sha256=dHOiKuWbWq8jtnEGScceF9_Q_LvHoMbCDhgnaW1aBvw,4255
|
||||
uvicorn/loops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/loops/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/loops/__pycache__/asyncio.cpython-312.pyc,,
|
||||
uvicorn/loops/__pycache__/auto.cpython-312.pyc,,
|
||||
uvicorn/loops/__pycache__/uvloop.cpython-312.pyc,,
|
||||
uvicorn/loops/asyncio.py,sha256=VcornZKJoV8yBYgLON3Gd8YKpUxlLlardxy_LJq_PhE,276
|
||||
uvicorn/loops/auto.py,sha256=BWVq18ce9SoFTo3z5zNW2IU2850u2tRrc6WyK7idsdI,400
|
||||
uvicorn/loops/uvloop.py,sha256=K4QybYVxtK9C2emDhDPUCkBXR4XMT5Ofv9BPFPoX0ok,148
|
||||
uvicorn/main.py,sha256=zSKb6dqqaJ-QoaBITRrZeWxMxix6JBGmbo-Y7R_7qAM,16961
|
||||
uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/middleware/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/middleware/__pycache__/asgi2.cpython-312.pyc,,
|
||||
uvicorn/middleware/__pycache__/message_logger.cpython-312.pyc,,
|
||||
uvicorn/middleware/__pycache__/proxy_headers.cpython-312.pyc,,
|
||||
uvicorn/middleware/__pycache__/wsgi.cpython-312.pyc,,
|
||||
uvicorn/middleware/asgi2.py,sha256=U5zg_1wqQMuPGWWs-uJqlUiqhDmluuVf3hYe3J9dC_k,408
|
||||
uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
|
||||
uvicorn/middleware/proxy_headers.py,sha256=hYZAAXSk5_iMohtMzdO9lQ4kVBZnU950FuLnjvIBZfc,3261
|
||||
uvicorn/middleware/wsgi.py,sha256=BnPKY1qlV9W9QP0ZAuqLq2jWTXCr5_D8B-xjN5M5mmo,7014
|
||||
uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/protocols/__pycache__/utils.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/http/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/auto.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/flow_control.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/h11_impl.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/httptools_impl.cpython-312.pyc,,
|
||||
uvicorn/protocols/http/auto.py,sha256=fvYmlgqD3ockeVj13Hhjc3kMWBu8zj2D0npUQcvIraM,391
|
||||
uvicorn/protocols/http/flow_control.py,sha256=4ERvUKBa8Ocsmw-kpRmVkwbEnmuxPmKnOE-NV4mkE2M,1777
|
||||
uvicorn/protocols/http/h11_impl.py,sha256=TRO0ubSxPTxbVyoYGsYYn8fkgflk_ExftzCb53Q2644,19869
|
||||
uvicorn/protocols/http/httptools_impl.py,sha256=CeuBFgxeD-A6cL6QeeBt1Ya1pbd3YAyEmj89jS2m4Gs,21673
|
||||
uvicorn/protocols/utils.py,sha256=dwRewBrq5Y8-XzrnKOpUfzuolieN_tQkkZLJG-49RKs,1839
|
||||
uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/websockets/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/auto.cpython-312.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/websockets_impl.cpython-312.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/wsproto_impl.cpython-312.pyc,,
|
||||
uvicorn/protocols/websockets/auto.py,sha256=H7irPeGN2MdHE29hdPKwca9YTA7HaOuWdIxvRuOgRtM,548
|
||||
uvicorn/protocols/websockets/websockets_impl.py,sha256=8Pvv2HeDDgEw09mxBgeLNGf9eJ8XGhXqv4-_qh1MCDk,13567
|
||||
uvicorn/protocols/websockets/wsproto_impl.py,sha256=nFj-v7D0LZy7uwQmaHi777BKkSvl7lSxmX80XGpSO8M,13040
|
||||
uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
||||
uvicorn/server.py,sha256=n0AKrPNoh4GaHdVILXNPj5-AqmEo0w8MEDRiQ7Z6H4k,12254
|
||||
uvicorn/supervisors/__init__.py,sha256=YSH0n2BiqyN5m3QaT_QAkS0DkFE2xXHpKDc4ORbh82o,670
|
||||
uvicorn/supervisors/__pycache__/__init__.cpython-312.pyc,,
|
||||
uvicorn/supervisors/__pycache__/basereload.cpython-312.pyc,,
|
||||
uvicorn/supervisors/__pycache__/multiprocess.cpython-312.pyc,,
|
||||
uvicorn/supervisors/__pycache__/statreload.cpython-312.pyc,,
|
||||
uvicorn/supervisors/__pycache__/watchfilesreload.cpython-312.pyc,,
|
||||
uvicorn/supervisors/__pycache__/watchgodreload.cpython-312.pyc,,
|
||||
uvicorn/supervisors/basereload.py,sha256=mVZwTaxbGCR2Jzfx60V3gEUHUWIcALoTSd15QcW4Nm8,3922
|
||||
uvicorn/supervisors/multiprocess.py,sha256=b-LzO1MiEN0HyhHJGx2gYMk9-Tuv2-tgmXzyJlnn7rA,2232
|
||||
uvicorn/supervisors/statreload.py,sha256=p4_6gR9wOWRT6k04DBiwtQl6GINwuKdoTZJz6afArT4,1580
|
||||
uvicorn/supervisors/watchfilesreload.py,sha256=zBi-AlpK7f82dQv83EqA0NRmT4mfvrL3wA1pjeq_BFw,2924
|
||||
uvicorn/supervisors/watchgodreload.py,sha256=Dg8jmR4d8S5J-ucj9-UP2MGWMzv3r1DUGr8Q3RCxE6A,5490
|
||||
uvicorn/workers.py,sha256=XKDxsZ4qrCc3adtWh6wtl3qQlExWPS0EGOsdBOvm1xg,3675
|
||||
@@ -0,0 +1,4 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.18.0
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
@@ -0,0 +1,2 @@
|
||||
[console_scripts]
|
||||
uvicorn = uvicorn.main:main
|
||||
@@ -0,0 +1,27 @@
|
||||
Copyright © 2017-present, [Encode OSS Ltd](https://www.encode.io/).
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Reference in New Issue
Block a user