Coding

Starlette – lightweight ASGI framework and toolkit

Starlette is a lightweight ASGI framework and toolkit for developing asynchronous web services. It offers a collection of components for handling HTTP requests, WebSocket connections and application lifecycle events.

The framework can be used to build complete applications or as a foundation for other frameworks. Its components are designed to be reusable, allowing developers to incorporate routing, middleware and response handling into applications without adopting a large framework.

Starlette supports asynchronous request processing while also allowing synchronous endpoint functions to run through a thread pool. It is suitable for APIs, streaming services and applications that need direct access to ASGI capabilities.

This is free and open source software.

Key Features

  • HTTP routing with path parameters, mounted sub-applications and host-based routing.
  • Function-based endpoints and class-based HTTP endpoint handlers.
  • WebSocket routing and management of bidirectional connections.
  • Response classes for JSON, HTML, text, redirects, files and streaming content.
  • Middleware for CORS, compression, HTTPS redirects, trusted hosts and signed cookie sessions.
  • Application lifespan handlers for initialising and releasing shared resources.
  • Background tasks executed after a response has been sent.
  • Static file serving with directory and HTML handling.
  • Jinja template rendering with request-aware context facilities.
  • Request body parsing, form processing and multipart file uploads.
  • Configurable request body size limits.
  • In-process TestClient for testing HTTP endpoints and WebSocket interactions.
  • Custom exception handlers and HTTP error processing.
  • ASGI middleware compatibility and reusable application components.

Website: github.com/encode/starlette
Support:
Developer: Encode OSS Ltd
License: BSD 3-Clause ‘New’ or ‘Revised’ License

Starlette is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

Best Python Micro Frameworks
FlaskHugely popular microframework based on Werkzeug and Jinja2
FastAPIWeb framework for building APIs
StarletteLightweight ASGI framework/toolkit
aiohttpAsynchronous HTTP client/server for asyncio and Python
SanicWeb server and web framework
FalconBuild cloud APIs, smart proxies, and app backends
QuartWeb microframework based on Asyncio
PyramidStart small, finish big, stay finished framework
BottleFast, simple and lightweight WSGI micro web framework
ChalicePython Serverless Microframework for AWS
CherryPyMature, minimalist, Python object-oriented web framework
TurboGearsHybrid framework acting as a Full Stack framework or Microframework
QuixoteAimed at sites where complex programming is required
KleinMicro-framework for developing production-ready web services with Python
circuitsLightweight event driven application framework
ClasticFunctional web framework
HugMake developing Python driven APIs as simple as possible
MicroPieUltra-micro ASGI Python web framework
LitestarPowerful, lightweight, and flexible ASGI framework
BlackSheepAsynchronous Python web framework
RobynPython web framework designed for high performance
MicrodotSmall web framework for Python and MicroPython

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted