Contents

starlette 0.52.1

0

The little ASGI library that shines.

Starlette is a lightweight ASGI (Asynchronous Server Gateway Interface) framework/toolkit, ideal for building asynchronous web services in Python. It is production-ready and offers a range of features including HTTP web framework, WebSocket support, in-process background tasks, startup and shutdown events, and a test client built on HTTPX. Starlette also supports CORS, GZIP, static files, streaming responses, and session and cookie support. It is compatible with asyncio and trio backends and boasts great overall performance against independent benchmarks. The package can be used as a complete framework or as an ASGI toolkit, allowing for the use of any of its components independently. It requires Python 3.8+ and an ASGI server such as uvicorn, daphne, or hypercorn for operation.

Stars: 11927, Watchers: 11927, Forks: 1117, Open Issues: 49

The Kludex/starlette repo was created 7 years ago and the last code push was 2 days ago.
The project is extremely popular with a mindblowing 11927 github stars!

How to Install starlette

You can install starlette using pip

pip install starlette

or add it to a project with poetry

poetry add starlette

Package Details

Author
None
License
None
Homepage
None
PyPi:
https://pypi.org/project/starlette/
Documentation:
https://starlette.dev/
GitHub Repo:
https://github.com/encode/starlette

Classifiers

  • Internet/WWW/HTTP
No  starlette  pypi packages just yet.

Errors

A list of common starlette errors.

Code Examples

Here are some starlette code examples and snippets.

  • Starlette Routing Examples

    Starlette routing can be composed in many different ways. Here is a simple example from Starlette’s documentation.

GitHub Issues

The starlette package has 49 open issues on GitHub

  • Add StarletteDeprecationWarning
  • An API that reads the request body for a specified number of bytes?
  • Fix range requests
  • Fix CORSMiddleware to return explicit origin with Authorization header
  • Add excluded_content_types parameter to GZipMiddleware
  • fix: websocket prefix for StreamingResponse and FileResponse denial (…
  • Can not use send_denial_response with StreamingResponse
  • refactor: make GZipMiddleware excluded content types configurable
  • Add digest_method to SessionMiddleware
  • Replace RuntimeError with WebSocketDisconnected
  • CORSMiddleware does not provide explicit origin although Authorization header is present

See more issues on GitHub

Related Packages & Articles

sniffio 1.3.1

Sniff out which async library your code is running under

h11 0.16.0

A pure-Python, bring-your-own-I/O implementation of HTTP/1.1

motor 3.7.1

Non-blocking MongoDB driver for Tornado or asyncio

uvloop 0.22.1

Fast implementation of asyncio event loop on top of libuv

httpie 3.2.4

The httpie Python package is a user-friendly command-line HTTP client for the API era. It aims to simplify the interaction with web services from the command line, making it an excellent tool for testing, debugging, and interacting with APIs and HTTP servers. httpie provides a range of features, including expressive syntax, colorized output, built-in JSON support, and the ability to handle forms and file uploads. This package is a key tool in the realm of Web Development and API Testing.