Giter VIP home page Giter VIP logo

awesome-asgi's Introduction

awesome-asgi

Awesome Versioning Build Status

A curated list of awesome ASGI servers, frameworks, apps, libraries, and other resources.

This list should help you keep yourself up to date with the most awesome ASGI projects and resources. You can watch releases on this repo to be notified about new entries. If you find anything missing, please contribute. ❣️

ASGI is a standard interface positioned as a spiritual successor to WSGI. It enables communication and interoperability across the whole Python async web stack: servers, applications, middleware, and individual components.

Born in 2016 to power the Django Channels project, ASGI and its ecosystem have been expanding ever since, boosted by the arrival of projects such as Starlette and Uvicorn in 2018.

Contents

Application frameworks

Frameworks for building ASGI web applications.

  • Asgineer - A really thin ASGI web framework, which includes support for long polling, SSE and websockets.
  • BlackSheep - BlackSheep is an asynchronous web framework to build event based web applications with Python. It is inspired by Flask, ASP.NET Core, and the work by Yury Selivanov.
  • Channels - Asynchronous support for Django, and the original driving force behind the ASGI project. Supports HTTP and WebSockets with Django integration, and any protocol with ASGI-native code.
  • Django - The web framework for perfectionists with deadlines. Has native ASGI support since version 3.0.
  • Falcon - The minimalist REST and app backend framework for Python, with a focus on reliability, correctness, and performance at scale. Native ASGI support since version 3.0.
  • FastAPI - A modern, high-performance web framework for building APIs with Python 3.6+ based on standard Python type hints. Powered by Starlette and Pydantic. Supports HTTP and WebSockets.
  • Guillotina - Full-featured ASGI-compatible REST application framework, designed for high performance and horizontally scaling solutions.
  • Litestar - A high-performance ASGI framework, which offers msgspec-based message parsing, Depdency-Injection, Authentication, OpenAPI docs, and more. Supports HTTP and Websockets. Supports asyncio and trio.
  • Pyotr - A server framework, as well as a client library, for serving and consuming OpenAPI-based Web services. Based on Starlette and HTTPX.
  • Quart - A Python ASGI web microframework whose API is a superset of the Flask API. Supports HTTP (incl. SSE and HTTP/2 server push) and WebSockets.
  • Responder - A familiar HTTP Service Framework for Python, powered by Starlette.
  • Sanic - Sanic is a Python 3.6+ web server and web framework that's written to go fast. It allows the usage of the async/await syntax added in Python 3.5, which makes your code non-blocking and speedy. Supports HTTP and WebSockets.
  • Starlette - The little ASGI framework that shines. Starlette is also an ASGI toolkit -- its modular design and reusable components made it foundational in the ASGI ecosystem. Supports HTTP and WebSockets. Supports asyncio and trio.
  • Tonberry - Tonberry is an ASGI framework that takes a class based approach to routing. Influenced by CherryPy but made compatible with asyncio and WebSockets.

Authentication

Packages for adding authentication and managing users in ASGI web applications.

  • asgi-auth-github - GitHub OAuth authentication for ASGI apps. Supports restricting to specific users or member of specific teams or organizations.
  • SessionAuth - Authenticate using sessions and cookies. (Shipped with Piccolo API, and requires Piccolo ORM.)
  • TokenAuth - Authenticate using tokens in request headers. (Shipped with Piccolo API, and requires Piccolo ORM.)

End-user applications

Real-world applications that run on ASGI.

  • ASGIWebDAV - An asynchronous WebDAV server implementation. Support multi-provider, multi-account and permission control.
  • Datasette - A tool for exploring and publishing data, including ASGI-compatible components and plugins.

GraphQL

Packages for building GraphQL APIs via ASGI.

  • Ariadne - A schema first Python library for implementing GraphQL servers.
  • Strawberry - A code first Python library for implementing GraphQL servers, inspired by dataclasses.
  • tartiflette-asgi - ASGI support for the Tartiflette GraphQL engine.

Monitoring

Packages for monitoring ASGI web applications.

  • asgi-correlation-id - Request/Correlation ID logging middleware
  • New Relic ASGI - New Relic integration for ASGI applications. (Shipped with newrelic.)
  • opentelemetry-python - ASGI middleware and helpers for collecting application metrics via the (currently alpha) OpenTelemetry standard. Supports HTTP and WebSocket.
  • Scout APM Starlette - Scout APM integration with Starlette and Starlette-based frameworks. (Shipped with scout-apm.)
  • Sentry ASGI - Sentry integration for ASGI frameworks. (Shipped with sentry-sdk.)
  • timing-asgi - ASGI middleware to record and emit timing metrics.

Proxies

Packages for use when running ASGI web applications behind proxies, or proxying other servers via ASGI applications.

  • asgi-proxy-lib - An ASGI function for proxying to a backend over HTTP.
  • asgiproxy – Tools for building HTTP and Websocket proxies for ASGI.
  • ProxyHeadersMiddleware - Use X-Forwarded-Proto and X-Forwarded-For headers set by a known and trusted proxy to make client and scheme reference the connecting client (shipped with Uvicorn).

Real-time web

Packages for use when building real-time-capable ASGI web applications.

  • python-socketio - WebSocket clients and servers using Socket.IO. Includes an ASGI application wrapper.

Resources

Content about ASGI itself: concepts, history, usage, etc.

Publications

Articles, blog posts and other publications about ASGI.

Reference

Reference documentation and implementation for ASGI.

  • ASGI Documentation - Documentation site for the ASGI specification.
  • asgiref - ASGI reference implementation, including function wrappers, server base classes, type hints, and a WSGI-to-ASGI adapter.

Talks

Talks about ASGI.

Experiments and examples

Software that experiments with ASGI or otherwise provides "No maintenance intended" code.

  • asgi-background - Background tasks for any ASGI framework.
  • asgi-lifespan-middleware - ASGI middlewate to support ASGI lifespans using a simple async context manager interface.
  • asgi-routing - A high performance router written in Rust for the ASGI ecosystem. Built on top of routrie and path-tree.
  • nanoasgi - A tiny zero-dependency ASGI web framework.
  • proxyx - Proof of concept for a lightweight HTTP/1.1 proxy service built with ASGI and HTTPX.
  • py-frameworks-bench - A benchmark for (mostly-ASGI) Python async frameworks.

Tutorials

Tutorials about working with ASGI applications and components.

Security

Packages and components for managing the security of ASGI web applications.

  • asgi-csrf - ASGI middleware for protecting against CSRF attacks.
  • asgi-ratelimit - A customizable rate limiting ASGI middleware, with regex path matching support.
  • CORSMiddleware - Allow cross-origin requests from browsers. (Shipped with Starlette.)
  • CSPMiddleware - Tell browsers to only run Javascript from the same origin. (Shipped with Piccolo API.)
  • CSRFMiddleware - Protect against CSRF attacks when using cookies for authentication. (Shipped with Piccolo API.)
  • HTTPSRedirectMiddleware - Redirect HTTP/WS traffic to HTTPS/WSS. (Shipped with Starlette.)
  • RateLimitingMiddleware - Protect sensitive endpoints from brute force attacks. (Shipped with Piccolo API.)
  • TrustedHostMiddleware - Guard against host header attacks by validating the Host header of requests. (Shipped with Starlette.)

Serialization

Packages and components for converting the format of data in and out of ASGI web applications.

  • brotli-asgi - Response content compression using Brotli.
  • GZipMiddleware - Response content compression using GZip. (Shipped with Starlette.)
  • msgpack-asgi - Drop-in MessagePack support for ASGI apps and frameworks.

Serverless

Packages for building serverless web applications with ASGI.

  • Mangum - AWS Lambda & API Gateway support for ASGI.

Servers

Web servers for ASGI applications.

  • Daphne - An HTTP, HTTP2 and WebSocket protocol server for ASGI, developed to power Django Channels.
  • Hypercorn - An ASGI server based on the sans-io hyper, h11, h2, and wsproto libraries. Supports HTTP/1, HTTP/2, WebSockets, ASGI 2.0 and ASGI 3.0. Compatible with asyncio, uvloop and trio worker types.
  • NGINX Unit - A universal web app server that supports ASGI.
  • Uvicorn - A fast ASGI server based on uvloop and httptools. Supports HTTP/1 and WebSockets.

Testing

Packages for testing ASGI applications.

  • asgi-lifespan - Programmatic startup/shutdown of ASGI apps. Allows testing an ASGI app without having to spin up a server.
  • async-asgi-testclient - A framework-agnostic library for testing ASGI web applications.
  • HTTPX - Next generation HTTP client, including async support and ability to call ASGI apps directly.

awesome-asgi's People

Contributors

abersheeran avatar adamchainz avatar akx avatar almarklein avatar ayehavgunne avatar berislavlopac avatar dantownsend avatar davidbrochart avatar dongreenberg avatar euri10 avatar florimondmanca avatar fullonic avatar i404788 avatar jordaneremieff avatar kludex avatar masipcat avatar mmaybeno avatar patrick91 avatar paurakhsharma avatar pgjones avatar qweeze avatar rr0214 avatar sanderfoobar avatar simonw avatar sondrelg avatar taoufik07 avatar vytas7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-asgi's Issues

Section categories

First, I just want to save thank you for creating this repo! It is really exciting to see how the ASGI ecosystem is progressing, and I think this will be a useful addition.

My issue relates to the sections, particularly the placement of Bonnette and Mangum. They are similar in usage to ASGI middleware (wrapping an application), but they actually provide adapter classes - not middleware.

Should these projects be listed under the "Libraries" section, or should there be a new section created labeled "Adapters"? I'd be happy to PR the changes based on discussion in this issue.

Project proposal: ASGI profiling middleware using yappi

(Apologies in advance if this isn't an appropriate place to start a discussion like this!)


It looks like yappi support for coroutine profiling is just about complete: fastapi/fastapi#701 (comment)

This should enable ASGI-compatible request-specific profiling (during development at least; yappi probably adds too much overhead to make sense during production). In particular, I think this could make it relatively easy to perform performance regression testing, etc.

If you look in that thread, you'll also see it can be used to display profiling info directly inside the browser. 🔥


I think it would be great if we could throw together a small ASGI middleware profiling package similar to the proposal from this comment, making use of the new yappi capabilities once they are released.

Eventually, I think it might make sense to try to package up functionality similar to what you'd expect from pytest --profile-svg in a non-asyncio context, as described in this comment.


If anyone is interested in collaborating on this let me know! I don't have experience publishing packages on PyPI so it would be great if someone more knowledgeable about that process could help out.

more frameworks and other stuff

hi @florimondmanca , please find some stuff I came by when looking at the environnement for a new project. If I'm not making a mistake I didnt see them here yet:

frameworks:
https://github.com/abersheeran/baize
https://github.com/starlite-api/starlite
https://github.com/adriangb/xpresso

di systems, not purely asgi related but those have integration with frameworks so worth mentionning imho:
https://github.com/meadsteve/lagom
https://github.com/adriangb/di

some goodies I'm using all the time, not sure where it fits in your classification:
https://github.com/alex-oleshkevich/starsessions
https://github.com/alex-oleshkevich/starception

An ASGI toy example

Hi!
I wrote a very tiny ASGI web framework as an experiment and I thought maybe I could share it here. It is not for production usage of course but it could be useful as a learning resource to grasp the concept of how does ASGI work and to demystify how asyncio frameworks operate under the hood on a toy example. I'm not sure if it fits in this list so if it doesn't - please close this :)

Usage-centric classification

Discussion in #24 (comment) brought up to me that the categories in this list may not be optimal right now.

Eg. we have "applications", "libraries", and "middleware", and the separation between the three may not be clear enough.

If this list is aimed at promoting projects that help work with ASGI (i.e. mainly building web apps), then perhaps we could switch to a more use-case-centric classification, where each section is an answer to "how do I XYZ with ASGI?".

(We have this for "application frameworks" vs "servers", which respectively address "how do I build an ASGI web app" and "how do I serve it on the internet", and I think it works well.)

add a release when README gets updated

Thanks for maintaining this awesome list. I'd like to suggest to add a release when a change is made to the README file. With this, we can watch the project without getting lots of activity emails.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.