Skip to main content

The little ASGI library that shines.

Project description

starlette

✨ The little ASGI library that shines. ✨

Build Status Coverage Package version


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.2.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file starlette-0.2.2.tar.gz.

File metadata

  • Download URL: starlette-0.2.2.tar.gz
  • Upload date:
  • Size: 12.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

Hashes for starlette-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b504baf1045970b0c041df2e8c1d55a06f8bddb12ce1574b778ff26f18c5f718
MD5 f8609c9a07c39a8398f86f19b3d4f1e6
BLAKE2b-256 d8ac2591771b8da11de7be7973fa934dcb2822254251fcdaf47879e5d8d0bd45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page