Contents

starlette 0.39.2

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: 10153, Watchers: 10153, Forks: 915, Open Issues: 43

The encode/starlette repo was created 6 years ago and the last code push was 1 weeks ago.
The project is extremely popular with a mindblowing 10153 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://www.starlette.io/
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 43 open issues on GitHub

  • Version 0.19.0
  • Background tasks are cancelled if the client closes connection
  • Add custom URL convertor register
  • Raising Exceptions in sub-applications routes
  • Add listener for disconnect to FileResponse
  • Move exception_handlers type to starlette.types
  • Add security headers as middlewares
  • Remove manual contextvar copy logic
  • Let Request.url_for lookup routes in mounted app first
  • Make the file argument to UploadFile required
  • remove file parameter from UploadFile
  • Feature: Add size attribute to UploadFile
  • feat: fully type annotate datastructures.py
  • Add Python 3.11-dev to the pipeline
  • New exception page.

See more issues on GitHub

Related Packages & Articles

sniffio 1.3.1

Sniff out which async library your code is running under

h11 0.14.0

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

motor 3.6.0

Non-blocking MongoDB driver for Tornado or asyncio

uvloop 0.20.0

Fast implementation of asyncio event loop on top of libuv

httpie 3.2.3

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.