Awesome Asyncio Overview
A curated list of awesome Python asyncio frameworks, libraries, software and resources
🏠 Home · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 timofurrer/awesome-asyncio · ⭐ 3.8K · 🏷️ Programming Languages
Awesome asyncio
A carefully curated list of awesome Python asyncio frameworks, libraries, software and resources.
The Python asyncio module introduced to the standard library with Python 3.4 provides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives.
Asyncio is not really a brand-new technology however it appears to be very trending since a few years - especially in the Python community and with the release of Python 3.4 in March 2014. Thus, it's pretty hard to keep yourself up-to-date with the most awesome packages out there. Find some of those awesome packages here and if you are missing one we count on you to create an Issue or a Pull Request (⭐3.8k) with your suggestion.
Contents
- Web Frameworks
- Message Queues
- Database Drivers
- Networking
- GraphQL
- Testing
- Alternative Loops
- Misc
- Writings
- Talks
- Alternatives to asyncio
Web Frameworks
Libraries to build web applications.
- FastAPI (⭐53k) - A very high performance Python 3.6+ API framework based on type hints. Powered by Starlette and Pydantic.
- Django - An established, high-level Python web framework with a huge community and ecosystem.
- Starlette (⭐7.8k) - A lightweight ASGI framework/toolkit for building high performance services.
- aiohttp (⭐13k) - Http client/server for asyncio (PEP-3156).
- sanic (⭐17k) - Python 3.5+ web server that's written to go fast.
- Quart (⭐1.5k) - An asyncio web microframework with the same API as Flask.
- autobahn (⭐2.4k) - WebSocket and WAMP supporting asyncio and Twisted, for clients and servers.
- websockets (⭐4.3k) - A library for building WebSocket servers and clients in Python with a focus on correctness and simplicity.
- Tornado - Performant web framework and asynchronous networking library.
- uvicorn (⭐6k) - The lightning-fast ASGI server.
Message Queues
Libraries to implement applications using message queues.
- aioamqp (⭐268) - AMQP implementation using asyncio.
- pyzmq (⭐3.2k) - Python bindings for ZeroMQ.
- aiozmq (⭐394) - Alternative Asyncio integration with ZeroMQ.
- crossbar (⭐2k) - Crossbar.io is a networking platform for distributed and microservice applications.
- asyncio-nats (⭐608) - Client for the NATS messaging system.
- aiokafka (⭐820) - Client for Apache Kafka.
Database Drivers
Libraries to connect to databases.
- asyncpg (⭐5.8k) - Fast PostgreSQL Database Client Library for Python/asyncio.
- asyncpgsa (⭐404) - Asyncpg with sqlalchemy core support.
- aiopg (⭐1.3k) - Library for accessing a PostgreSQL database.
- aiomysql (⭐1.5k) - Library for accessing a MySQL database
- aioodbc (⭐253) - Library for accessing a ODBC databases.
- motor (⭐2.1k) - The async Python driver for MongoDB.
- redis-py (⭐11k) - Redis Python Client (which includes aioreadis (⭐2.3k) now).
- aiocouchdb (⭐53) - CouchDB client built on top of aiohttp (asyncio).
- aioinflux (⭐159) - InfluxDB client built on top of aiohttp.
- aioes (⭐97) - Asyncio compatible driver for elasticsearch.
- peewee-async (⭐667) - ORM implementation based on peewee (⭐9.7k) and aiopg.
- GINO (⭐2.5k) - is a lightweight asynchronous Python ORM based on SQLAlchemy core, with asyncpg (⭐5.8k) dialect.
- Tortoise ORM (⭐3.3k) - native multi-backend ORM with Django-like API and easy relations management.
- Databases (⭐3.2k) - Async database access for SQLAlchemy core, with support for PostgreSQL, MySQL, and SQLite.
- Prisma Client Python (⭐930) - An auto-generated, fully type safe ORM powered by Pydantic and tailored specifically for your schema - supports SQLite, PostgreSQL, MySQL, MongoDB, MariaDB and more.
- Piccolo (⭐925) - An ORM / query builder which can work in async and sync modes, with a nice admin GUI, and ASGI middleware.
- Beanie - An async MongoDB ODM built on motor (⭐2.1k) and Pydantic.
Networking
Libraries to communicate in your network.
- AsyncSSH (⭐1.3k) - Provides an asynchronous client and server implementation of the SSHv2 protocol.
- aiodns (⭐472) - Simple DNS resolver for asyncio.
- aioping (⭐68) - Fast asyncio implementation of ICMP (ping) protocol.
- httpx (⭐9.8k) - asynchronous HTTP client for Python 3 with requests (⭐49k) compatible API.
GraphQL
Libraries to build GraphQL servers.
- Ariadne - Schema-first Python library for implementing GraphQL servers.
- Tartiflette - Schema-first Python 3.6+ GraphQL engine built on top of
libgraphqlparser
. - Strawberry - Code-first Python 3 GraphQL server with Django, Flask and FastAPI/Starlette support.
Testing
Libraries to test asyncio based applications.
- aiomock (⭐23) - A python mock library that supports async methods.
- asynctest (⭐301) - Enhance the standard unittest package with features for testing. asyncio libraries
- pytest-asyncio (⭐1.1k) - Pytest support for asyncio.
- aresponses (⭐93) - Asyncio http mocking. Similar to the responses (⭐3.8k) library used for requests (⭐49k).
- aioresponses (⭐402) - Helper for mock/fake web requests in Python aiohttp package.
Alternative Loops
Alternative asyncio loop implementations.
- uvloop (⭐9.1k) - Ultra fast implementation of asyncio event loop on top of libuv.
Misc
Other awesome asyncio libraries.
- aiochan (⭐127) - CSP-style concurrency with channels, select and multiprocessing on top of asyncio.
- aiocache (⭐769) - Cache manager for different backends.
- aiofiles (⭐2.1k) - File support for asyncio.
- aiopath (⭐70) - Asynchronous
pathlib
for asyncio. - aiodebug (⭐56) - A tiny library for monitoring and testing asyncio programs.
- aiorun (⭐349) - A
run()
function that handles all the usual boilerplate for startup and graceful shutdown. - aiosc (⭐26) - Lightweight Open Sound Control implementation.
- aioserial (⭐109) - A drop-in replacement of pySerial (⭐2.8k).
- aiozipkin (⭐177) - Distributed tracing instrumentation for asyncio with zipkin
- asgiref (⭐1.1k) - Backend utils for ASGI to WSGI integration, includes sync_to_async and async_to_sync function wrappers.
- async_property (⭐51) - Python decorator for async properties.
- ruia (⭐1.6k) - An async web scraping micro-framework based on asyncio.
- kubernetes_asyncio (⭐253) - Asynchronous client library for Kubernetes.
- aiomisc (⭐294) - Miscellaneous utils for
asyncio
. - taskiq - Asynchronous distributed task manager (like celery, but async).
Writings
Documentation, blog posts, and other awesome writing about asyncio.
- Official asyncio documentation - Asynchronous I/O, event loop, coroutines and tasks.
- Short well-written intro to asyncio - Generators, Coroutines, Native Coroutines and async/await.
- AsyncIO for the Working Python Developer - A gentle introduction to asynchronous programming from basic examples working up to URL fetching.
- Test limits of Python aiohttp - Making 1 million requests with python-aiohttp.
- ASGI (Asynchronous Server Gateway Interface) - A spiritual successor to WSGI, intended to provide a standard interface between async-capable Python web servers, frameworks, and applications.
- First Principles Introduction to Asyncio - A no-buzzword first principles introduction to the internal workings of asyncio.
- Developing and Testing an Asynchronous API with FastAPI and Pytest - This tutorial looks at how to develop and test an asynchronous API with FastAPI using Test-Driven Development (TDD).
- Python Concurrency with asyncio - Learn how to speed up slow Python code with concurrent programming and the cutting-edge asyncio library.
Talks
Recordings of awesome talks about asyncio.
- Topics of Interest (Python Asyncio) | screencast | slides - PyCon Brasil 2015 keynote (David Beazley).
- Python Asynchronous I/O Walkthrough - 8-part code walkthrough (Philip Guo).
- Async/await in Python 3.5 and why it is awesome - EuroPython 2016 (Yury Selivanov).
- Fear and Awaiting in Async: A Savage Journey to the Heart of the Coroutine Dream | screencast - PyOhio 2016 keynote (David Beazley).
- Asynchronous Python for the Complete Beginner | slides - PyCon 2017 (Miguel Grinberg).
- Demystifying Python's Async and Await Keywords - JetBrains TV 2020 (Michael Kennedy)
Alternatives to asyncio
Alternative approaches to async programming in Python, some of which attempt to support some compatibility with asyncio
, others are not compatible at all.
- curio (⭐3.9k) - The coroutine concurrency library.
- Curio-Asyncio Bridge (⭐3.9k) - basic curio -> asyncio coroutine bridge.
- trio (⭐5k) - Pythonic async I/O for humans and snake people.
- trio-asyncio (⭐163) - re-implementation of the asyncio mainloop on top of Trio.
- AnyIO (⭐1.1k) - High level asynchronous concurrency and networking framework that works on top of either trio or asyncio.