Update 2025-04-24_11:44:19
This commit is contained in:
@ -0,0 +1 @@
|
||||
pip
|
@ -0,0 +1,186 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: uvicorn
|
||||
Version: 0.34.2
|
||||
Summary: The lightning-fast ASGI server.
|
||||
Project-URL: Changelog, https://www.uvicorn.org/release-notes
|
||||
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>, Marcelo Trylesinski <marcelotryle@gmail.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.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: Programming Language :: Python :: 3.13
|
||||
Classifier: Programming Language :: Python :: Implementation :: CPython
|
||||
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
||||
Classifier: Topic :: Internet :: WWW/HTTP
|
||||
Requires-Python: >=3.9
|
||||
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.6.3; 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)
|
||||
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
### Granian
|
||||
|
||||
[Granian][granian] is an ASGI compatible Rust HTTP server which supports HTTP/2, TLS and WebSockets.
|
||||
|
||||
---
|
||||
|
||||
<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
|
||||
[trio]: https://trio.readthedocs.io
|
||||
[mangum]: https://github.com/jordaneremieff/mangum
|
||||
[granian]: https://github.com/emmett-framework/granian
|
@ -0,0 +1,85 @@
|
||||
../../../bin/uvicorn,sha256=EdR0RbrFzxR_S65Dowo8b_zfDJWJad4UVrfODEBz1bQ,245
|
||||
uvicorn-0.34.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
uvicorn-0.34.2.dist-info/METADATA,sha256=kUM_FZJJlmpGa7hrum4L1EHIkhbs-vhpPCPRMSBD8QY,6549
|
||||
uvicorn-0.34.2.dist-info/RECORD,,
|
||||
uvicorn-0.34.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn-0.34.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
||||
uvicorn-0.34.2.dist-info/entry_points.txt,sha256=FW1w-hkc9QgwaGoovMvm0ZY73w_NcycWdGAUfDsNGxw,46
|
||||
uvicorn-0.34.2.dist-info/licenses/LICENSE.md,sha256=7-Gs8-YvuZwoiw7HPlp3O3Jo70Mg_nV-qZQhTktjw3E,1526
|
||||
uvicorn/__init__.py,sha256=jcZ4XeMQu13Rqvp-TeOhLhZn26yKMbfQ9lr6heDAsO8,147
|
||||
uvicorn/__main__.py,sha256=DQizy6nKP0ywhPpnCHgmRDYIMfcqZKVEzNIWQZjqtVQ,62
|
||||
uvicorn/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/__main__.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/_subprocess.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/_types.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/config.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/importer.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/logging.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/main.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/server.cpython-311.pyc,,
|
||||
uvicorn/__pycache__/workers.cpython-311.pyc,,
|
||||
uvicorn/_subprocess.py,sha256=HbfRnsCkXyg7xCWVAWWzXQTeWlvLKfTlIF5wevFBkR4,2766
|
||||
uvicorn/_types.py,sha256=5FcPvvIfeKsJDjGhTrceDv8TmwzYI8yPF7mXsXTWOUM,7775
|
||||
uvicorn/config.py,sha256=zg-UX2vu3Zy0e7jXOJKoY1mPhsbIuq-3IwwKy9yERkg,20894
|
||||
uvicorn/importer.py,sha256=nRt0QQ3qpi264-n_mR0l55C2ddM8nowTNzT1jsWaam8,1128
|
||||
uvicorn/lifespan/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/lifespan/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/lifespan/__pycache__/off.cpython-311.pyc,,
|
||||
uvicorn/lifespan/__pycache__/on.cpython-311.pyc,,
|
||||
uvicorn/lifespan/off.py,sha256=nfI6qHAUo_8-BEXMBKoHQ9wUbsXrPaXLCbDSS0vKSr8,332
|
||||
uvicorn/lifespan/on.py,sha256=1KYuFNNyQONIjtEHhKZAJp-OOokIyjj74wpGCGBv4lk,5184
|
||||
uvicorn/logging.py,sha256=-eCE4nOJmFbtB9qfNJuEVNF0Y13LGUHqvFzemYT0PaQ,4235
|
||||
uvicorn/loops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/loops/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/loops/__pycache__/asyncio.cpython-311.pyc,,
|
||||
uvicorn/loops/__pycache__/auto.cpython-311.pyc,,
|
||||
uvicorn/loops/__pycache__/uvloop.cpython-311.pyc,,
|
||||
uvicorn/loops/asyncio.py,sha256=qPnQLT2htZkcGG_ncnTyrSH38jEkqjg8guwP0lA146A,301
|
||||
uvicorn/loops/auto.py,sha256=BWVq18ce9SoFTo3z5zNW2IU2850u2tRrc6WyK7idsdI,400
|
||||
uvicorn/loops/uvloop.py,sha256=K4QybYVxtK9C2emDhDPUCkBXR4XMT5Ofv9BPFPoX0ok,148
|
||||
uvicorn/main.py,sha256=5TFzub2UbSk4LOQ_UeQ3PZLiTRG51KIQ0sSY9SZUMN8,17234
|
||||
uvicorn/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/middleware/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/middleware/__pycache__/asgi2.cpython-311.pyc,,
|
||||
uvicorn/middleware/__pycache__/message_logger.cpython-311.pyc,,
|
||||
uvicorn/middleware/__pycache__/proxy_headers.cpython-311.pyc,,
|
||||
uvicorn/middleware/__pycache__/wsgi.cpython-311.pyc,,
|
||||
uvicorn/middleware/asgi2.py,sha256=YQrQNm3RehFts3mzk3k4yw8aD8Egtj0tRS3N45YkQa0,394
|
||||
uvicorn/middleware/message_logger.py,sha256=IHEZUSnFNaMFUFdwtZO3AuFATnYcSor-gVtOjbCzt8M,2859
|
||||
uvicorn/middleware/proxy_headers.py,sha256=f1VDAc-ipPHdNTuLNHwYCeDgYXoCL_VjD6hDTUXZT_U,5790
|
||||
uvicorn/middleware/wsgi.py,sha256=N6fWyOnHoeHbUevX0mDYFNmI4lsMv7Y0qnd7Y3fJVL4,7105
|
||||
uvicorn/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/protocols/__pycache__/utils.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/http/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/auto.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/flow_control.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/h11_impl.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/__pycache__/httptools_impl.cpython-311.pyc,,
|
||||
uvicorn/protocols/http/auto.py,sha256=YfXGyzWTaaE2p_jkTPWrJCXsxEaQnC3NK0-G7Wgmnls,403
|
||||
uvicorn/protocols/http/flow_control.py,sha256=050WVg31EvPOkHwynCoMP1zXFl_vO3U4durlc5vyp4U,1701
|
||||
uvicorn/protocols/http/h11_impl.py,sha256=4b-KswK57FBaRPeHXlK_oy8pKM6vG1haALCIeRH-1bA,20694
|
||||
uvicorn/protocols/http/httptools_impl.py,sha256=tuQBCiD6rf5DQeyQwHVc45rxH9ouojMpkXi9KG6NRBk,21805
|
||||
uvicorn/protocols/utils.py,sha256=rCjYLd4_uwPeZkbRXQ6beCfxyI_oYpvJCwz3jEGNOiE,1849
|
||||
uvicorn/protocols/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
uvicorn/protocols/websockets/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/auto.cpython-311.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/websockets_impl.cpython-311.pyc,,
|
||||
uvicorn/protocols/websockets/__pycache__/wsproto_impl.cpython-311.pyc,,
|
||||
uvicorn/protocols/websockets/auto.py,sha256=kNP-h07ZzjA9dKRUd7MNO0J7xhRJ5xVBfit7wCbdB0A,574
|
||||
uvicorn/protocols/websockets/websockets_impl.py,sha256=E0e7aX4ICmSIuytfc4d5RhWvjH37Ed8ZgXwAH2f8oog,15504
|
||||
uvicorn/protocols/websockets/wsproto_impl.py,sha256=2OB4E6OsQ1KPiETkHYi2UQDxY9sUzTr0LLZQJxlXPxo,15375
|
||||
uvicorn/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
||||
uvicorn/server.py,sha256=Kd2S0UarzwJyt9YHZzTghMPxxRVa1zIVA8Cqy6AuT9A,12879
|
||||
uvicorn/supervisors/__init__.py,sha256=wT8eOEIqT1yWQgytZtv5taWMul7xoTIY0xm1m4oyPTw,507
|
||||
uvicorn/supervisors/__pycache__/__init__.cpython-311.pyc,,
|
||||
uvicorn/supervisors/__pycache__/basereload.cpython-311.pyc,,
|
||||
uvicorn/supervisors/__pycache__/multiprocess.cpython-311.pyc,,
|
||||
uvicorn/supervisors/__pycache__/statreload.cpython-311.pyc,,
|
||||
uvicorn/supervisors/__pycache__/watchfilesreload.cpython-311.pyc,,
|
||||
uvicorn/supervisors/basereload.py,sha256=MAXSQ3ckZPwqzJ8Un9yDhk3W0yyAArQtZLuOE0OInSc,4036
|
||||
uvicorn/supervisors/multiprocess.py,sha256=Opt0XvOUj1DIMXYwb4OlkJZxeh_RjweFnTmDPYItONw,7507
|
||||
uvicorn/supervisors/statreload.py,sha256=uYblmoxM3IbPbvMDzr5Abw2-WykQl8NxTTzeLfVyvnU,1566
|
||||
uvicorn/supervisors/watchfilesreload.py,sha256=41FGNMXPKrKvPr-5O8yRWg43l6OCBtapt39M-gpdk0E,3010
|
||||
uvicorn/workers.py,sha256=7KGgGAapxGkGeXUcBGunOjSNdI9R44KCoWTGEAqAdfs,3895
|
@ -0,0 +1,4 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.27.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