starlette/docs/index.md

1.7 KiB
Raw Blame History

starlette

The little ASGI library that shines.

Build Status Coverage Package version


Introduction

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 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.

Starlette is BSD licensed code. Designed & built in Brighton, England.