Update 2025-04-13_16:26:34

This commit is contained in:
root
2025-04-13 16:26:35 +02:00
commit 0e49903693
2239 changed files with 407432 additions and 0 deletions

View File

@ -0,0 +1,176 @@
Metadata-Version: 2.4
Name: starlette
Version: 0.46.1
Summary: The little ASGI library that shines.
Project-URL: Homepage, https://github.com/encode/starlette
Project-URL: Documentation, https://www.starlette.io/
Project-URL: Changelog, https://www.starlette.io/release-notes/
Project-URL: Funding, https://github.com/sponsors/encode
Project-URL: Source, https://github.com/encode/starlette
Author-email: Tom Christie <tom@tomchristie.com>
License-Expression: BSD-3-Clause
License-File: LICENSE.md
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: AnyIO
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: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.9
Requires-Dist: anyio<5,>=3.6.2
Requires-Dist: typing-extensions>=3.10.0; python_version < '3.10'
Provides-Extra: full
Requires-Dist: httpx<0.29.0,>=0.27.0; extra == 'full'
Requires-Dist: itsdangerous; extra == 'full'
Requires-Dist: jinja2; extra == 'full'
Requires-Dist: python-multipart>=0.0.18; extra == 'full'
Requires-Dist: pyyaml; extra == 'full'
Description-Content-Type: text/markdown
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette_dark.svg" width="420px">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.svg" width="420px">
<img alt="starlette-logo" src="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette_dark.svg">
</picture>
</p>
<p align="center">
<em>✨ The little ASGI framework that shines. ✨</em>
</p>
---
[![Build Status](https://github.com/encode/starlette/workflows/Test%20Suite/badge.svg)](https://github.com/encode/starlette/actions)
[![Package version](https://badge.fury.io/py/starlette.svg)](https://pypi.python.org/pypi/starlette)
[![Supported Python Version](https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058)](https://pypi.org/project/starlette)
---
**Documentation**: <a href="https://www.starlette.io/" target="_blank">https://www.starlette.io</a>
**Source Code**: <a href="https://github.com/encode/starlette" target="_blank">https://github.com/encode/starlette</a>
---
# Starlette
Starlette is a lightweight [ASGI][asgi] framework/toolkit,
which is ideal for building async web services in Python.
It is production-ready, and gives you the following:
* A lightweight, low-complexity HTTP web framework.
* WebSocket support.
* In-process background tasks.
* Startup and shutdown events.
* Test client built on `httpx`.
* CORS, GZip, Static Files, Streaming responses.
* Session and Cookie support.
* 100% test coverage.
* 100% type annotated codebase.
* Few hard dependencies.
* Compatible with `asyncio` and `trio` backends.
* Great overall performance [against independent benchmarks][techempower].
## Installation
```shell
$ pip install starlette
```
You'll also want to install an ASGI server, such as [uvicorn](https://www.uvicorn.org/), [daphne](https://github.com/django/daphne/), or [hypercorn](https://hypercorn.readthedocs.io/en/latest/).
```shell
$ pip install uvicorn
```
## Example
```python title="main.py"
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
async def homepage(request):
return JSONResponse({'hello': 'world'})
routes = [
Route("/", endpoint=homepage)
]
app = Starlette(debug=True, routes=routes)
```
Then run the application using Uvicorn:
```shell
$ uvicorn main:app
```
## Dependencies
Starlette only requires `anyio`, and the following are optional:
* [`httpx`][httpx] - Required if you want to use the `TestClient`.
* [`jinja2`][jinja2] - Required if you want to use `Jinja2Templates`.
* [`python-multipart`][python-multipart] - Required if you want to support form parsing, with `request.form()`.
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.
You can install all of these with `pip install starlette[full]`.
## Framework or Toolkit
Starlette is designed to be used either as a complete framework, or as
an ASGI toolkit. You can use any of its components independently.
```python
from starlette.responses import PlainTextResponse
async def app(scope, receive, send):
assert scope['type'] == 'http'
response = PlainTextResponse('Hello, world!')
await response(scope, receive, send)
```
Run the `app` application in `example.py`:
```shell
$ uvicorn example:app
INFO: Started server process [11509]
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
Run uvicorn with `--reload` to enable auto-reloading on code changes.
## Modularity
The modularity that Starlette is designed on promotes building re-usable
components that can be shared between any ASGI framework. This should enable
an ecosystem of shared middleware and mountable applications.
The clean API separation also means it's easier to understand each component
in isolation.
---
<p align="center"><i>Starlette is <a href="https://github.com/encode/starlette/blob/master/LICENSE.md">BSD licensed</a> code.<br/>Designed & crafted with care.</i></br>&mdash; ⭐️ &mdash;</p>
[asgi]: https://asgi.readthedocs.io/en/latest/
[httpx]: https://www.python-httpx.org/
[jinja2]: https://jinja.palletsprojects.com/
[python-multipart]: https://multipart.fastapiexpert.com/
[itsdangerous]: https://itsdangerous.palletsprojects.com/
[sqlalchemy]: https://www.sqlalchemy.org
[pyyaml]: https://pyyaml.org/wiki/PyYAMLDocumentation
[techempower]: https://www.techempower.com/benchmarks/#hw=ph&test=fortune&l=zijzen-sf

View File

@ -0,0 +1,74 @@
starlette-0.46.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
starlette-0.46.1.dist-info/METADATA,sha256=cB56W0GRI6QiRwvGh8A9jZ1xRwH25O_yrzWJZbf3U3U,6167
starlette-0.46.1.dist-info/RECORD,,
starlette-0.46.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
starlette-0.46.1.dist-info/licenses/LICENSE.md,sha256=3LlWd6AiQCQxh-lk-UGEfRmxeCHPmeWvrmhPqzKMGb8,1518
starlette/__init__.py,sha256=mFmwJPEwG1jNjQaGSh3_xNo8JgOV3wGtKGQxe0qvmTo,23
starlette/__pycache__/__init__.cpython-311.pyc,,
starlette/__pycache__/_exception_handler.cpython-311.pyc,,
starlette/__pycache__/_utils.cpython-311.pyc,,
starlette/__pycache__/applications.cpython-311.pyc,,
starlette/__pycache__/authentication.cpython-311.pyc,,
starlette/__pycache__/background.cpython-311.pyc,,
starlette/__pycache__/concurrency.cpython-311.pyc,,
starlette/__pycache__/config.cpython-311.pyc,,
starlette/__pycache__/convertors.cpython-311.pyc,,
starlette/__pycache__/datastructures.cpython-311.pyc,,
starlette/__pycache__/endpoints.cpython-311.pyc,,
starlette/__pycache__/exceptions.cpython-311.pyc,,
starlette/__pycache__/formparsers.cpython-311.pyc,,
starlette/__pycache__/requests.cpython-311.pyc,,
starlette/__pycache__/responses.cpython-311.pyc,,
starlette/__pycache__/routing.cpython-311.pyc,,
starlette/__pycache__/schemas.cpython-311.pyc,,
starlette/__pycache__/staticfiles.cpython-311.pyc,,
starlette/__pycache__/status.cpython-311.pyc,,
starlette/__pycache__/templating.cpython-311.pyc,,
starlette/__pycache__/testclient.cpython-311.pyc,,
starlette/__pycache__/types.cpython-311.pyc,,
starlette/__pycache__/websockets.cpython-311.pyc,,
starlette/_exception_handler.py,sha256=OM4H48d5iyv8_ofxBDYy1PflsJGlr40jFZPI3DYZTQg,2219
starlette/_utils.py,sha256=Lg65uXpJ3Tq0lqik0t-A6nQDNhxMl9NttI7fjxY0hxM,2764
starlette/applications.py,sha256=hNiaF39WBGRPt8Ht6Zw67XJ5B1CzCUj2cC-8KIZGddk,10678
starlette/authentication.py,sha256=9dlyeykDMhoxgmI9hFVZ38uu8Nl6k2NZiaoa607Z8hc,4948
starlette/background.py,sha256=50zBQ_50lV9YGRGevBUFQ4DOwisU47pUV_PfiBG9Cg4,1257
starlette/concurrency.py,sha256=zjBYz9UPaXpUKx1qVzocVQHlxDDi90wOOUKubXjXWTI,1746
starlette/config.py,sha256=xCXgQTgMaeuyXaHRFor7EJiAVMUdjnu6Hgwz4rr6sUU,4445
starlette/convertors.py,sha256=RBd7q6UynlJl4xP_MXDrRmtH8N55re8d_SQaztmwPQw,2302
starlette/datastructures.py,sha256=7IkoXZ5b0EaieymYa46Sncwd7GVAnyJ5RI-LQvKLFx0,22262
starlette/endpoints.py,sha256=RgFXHAw8_Ktgqea5T5e4jEWY73LbB822odx6LXI-_6I,5098
starlette/exceptions.py,sha256=tIphlZa8EsQfKw3-xw5J3ZN1GjaR4UcxfJK69Ad2hG8,1066
starlette/formparsers.py,sha256=GxhueF4HrJeLJDFGpPFm5WZn7C90VBGS2Faz90JP1gY,11045
starlette/middleware/__init__.py,sha256=3WljcfADnSltJrVUuFgpvJiZKcjsjC1Ih9aqYUvSknk,1224
starlette/middleware/__pycache__/__init__.cpython-311.pyc,,
starlette/middleware/__pycache__/authentication.cpython-311.pyc,,
starlette/middleware/__pycache__/base.cpython-311.pyc,,
starlette/middleware/__pycache__/cors.cpython-311.pyc,,
starlette/middleware/__pycache__/errors.cpython-311.pyc,,
starlette/middleware/__pycache__/exceptions.cpython-311.pyc,,
starlette/middleware/__pycache__/gzip.cpython-311.pyc,,
starlette/middleware/__pycache__/httpsredirect.cpython-311.pyc,,
starlette/middleware/__pycache__/sessions.cpython-311.pyc,,
starlette/middleware/__pycache__/trustedhost.cpython-311.pyc,,
starlette/middleware/__pycache__/wsgi.cpython-311.pyc,,
starlette/middleware/authentication.py,sha256=ftWVVbETxrr0gOwtxwULww362Wkt1s9iOVu4s1LJ53I,1791
starlette/middleware/base.py,sha256=s6n9Dx_R5bR29nVwWwq3vVJVqP3IRhn0a2X7KWIltQA,8792
starlette/middleware/cors.py,sha256=-ih4JxmeRaKhmv076DcJE-wd0K2FJbo23gzZdLrJb00,7051
starlette/middleware/errors.py,sha256=bomTUfQIo7CIwnZQ8fFz4BCDY5idQnrsrhGSpZNiH-s,8066
starlette/middleware/exceptions.py,sha256=Q96acXz9bRIUZORAKjlsbcaFuI0-m61cSXmfFq_ND60,2791
starlette/middleware/gzip.py,sha256=VaNOHZleGS_YWueBFVFZ-RboWQmcQI8hjgZDKLVklOM,5697
starlette/middleware/httpsredirect.py,sha256=SNTleaYALGoITV7xwbic4gB6VYdM8Ylea_ykciUz31g,848
starlette/middleware/sessions.py,sha256=Cpbql_BTanVqDbhPGdoUrNvHIKf9D3Yuc48cJZerFTU,3566
starlette/middleware/trustedhost.py,sha256=dXbW22C3RYNp3TsdfCuE0MNS-VZFcN8B_S3wYrzETm8,2203
starlette/middleware/wsgi.py,sha256=0vLstcalV-kq2YyqQR9NCLiPNgokW7nDvyRqQpj_5iQ,5386
starlette/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
starlette/requests.py,sha256=X_rmfl_pgnndvqk0Kxd_bCjxIe_PUO0N64DJMpeOUBE,11693
starlette/responses.py,sha256=_9PWDCpoqZzT9iVTwLNuQ47RuMTzp6NbSknaW4lpJwM,20226
starlette/routing.py,sha256=mKt5XcuSBg_08__XdXp5WVh3qCJMPLMaYfe1bXFzI8w,34550
starlette/schemas.py,sha256=kKVRFG_kicD8geEnlfHoEsBCE-8MsdXyPE0VM4f2Q24,5181
starlette/staticfiles.py,sha256=pmxmrueM67-X16sYAVHEIu61BJr221XNfq5d1UbFls4,8474
starlette/status.py,sha256=e70xV6wYFR5bdmkYkgYCSwZk1L2FdKDwA6u4zCjmypQ,2820
starlette/templating.py,sha256=c88GphUDWcLiUKSVJNvnHI5Xp6cZe9HYX7Vb_r-pVEk,8408
starlette/testclient.py,sha256=G0Db7thEEaE6unArj34D_qG3NT_OI_1Io-3P4z_psFM,27987
starlette/types.py,sha256=I2yIP5R1qyVD1GBiJZQ_I9dprcYUOVVK8fHa6UQVsqg,1048
starlette/websockets.py,sha256=M_8gmQmthBHvqdVfLIzs4yuQpup7B853tPSaNQB_UMo,8332

View File

@ -0,0 +1,4 @@
Wheel-Version: 1.0
Generator: hatchling 1.27.0
Root-Is-Purelib: true
Tag: py3-none-any

View File

@ -0,0 +1,27 @@
Copyright © 2018, [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.