The little ASGI framework that shines. 🌟
Go to file
Tom Christie 4549d625f9 Make docs link more prominent 2018-08-29 11:33:59 +01:00
docs Drop licence footer from page content 2018-08-29 11:31:08 +01:00
scripts Initial commit 2018-06-25 14:15:32 +01:00
starlette Fix typo 2018-08-28 16:24:18 +01:00
tests client.wsconnect -> client.websocket_connect 2018-08-28 14:45:06 +01:00
.codecov.yml Add code coverage 2018-06-25 14:48:18 +01:00
.gitignore Update .gitignore 2018-06-25 15:35:43 +01:00
.travis.yml Only run linting on 3.6 2018-06-25 14:57:13 +01:00
LICENSE.md Initial commit 2018-06-25 14:15:32 +01:00
README.md Make docs link more prominent 2018-08-29 11:33:59 +01:00
mkdocs.yml Update docs 2018-08-29 11:17:09 +01:00
requirements.txt Add mkdocs 2018-08-28 16:25:32 +01:00
setup.py Fixed encoding issues on windows 2018-07-17 21:38:38 +01:00

README.md

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.