The little ASGI library that shines.
Project description
✨ The little ASGI library that shines. ✨
Documentation: https://www.starlette.io/
Starlette is a small library for working with ASGI.
It gives you Request
and Response
classes, request routing, websocket support,
static files support, and a test client.
Requirements
Python 3.6+
Installation
$ pip3 install starlette
Example
from starlette.response import Response
class App:
def __init__(self, scope):
self.scope = scope
async def __call__(self, receive, send):
response = Response('Hello, world!', media_type='text/plain')
await response(receive, send)
You can run the application with any ASGI server, including uvicorn, daphne, or hypercorn.
Install the Uvicorn ASGI server:
$ pip3 install uvicorn
[...]
Successfully installed uvicorn
Run the App
application in example.py
:
$ uvicorn run example:App
INFO: Started server process [11509]
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
— ⭐️ —
Starlette is BSD licensed code. Designed & built in Brighton, England.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
starlette-0.2.3.tar.gz
(13.6 kB
view details)
File details
Details for the file starlette-0.2.3.tar.gz
.
File metadata
- Download URL: starlette-0.2.3.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3db7eb4400f3605dddb661d3220a90f9112cb49e495c448dd7cd3414cf6505 |
|
MD5 | 9c5ff6c9dadf64eb356b52c2fb134ae8 |
|
BLAKE2b-256 | f04ffd7353372d52b5a3836b717f89fe12d18af4ec0ec8a59e8f7ced2ff05a63 |