精心挑选的很棒的 Python 异步框架、库、软件和资源列表。
在 Python 3.4 中引入标准库的 Python asyncio 模块为使用协程编写单线程并发代码、通过套接字和其他资源多路复用 I/O 访问、运行网络客户端和服务器以及其他相关原语提供了基础设施。
Asyncio 并不是真正的全新技术,但它似乎从几年前就开始流行——尤其是在 Python 社区和 2014 年 3 月发布的 Python 3.4 中。因此,很难让自己保持最新状态 那里有最棒的软件包。 在这里找到一些很棒的包,如果你缺少一个,我们指望你根据你的建议创建一个问题或拉取请求。
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.
- aiohttp - Http client/server for asyncio (PEP-3156).
- sanic - Python 3.5+ web server that's written to go fast.
- Quart - An asyncio web microframework with the same API as Flask.
- Vibora - Performant web framework inspired by Flask.
- cirrina - Opinionated asynchronous web framework based on aiohttp.
- autobahn - WebSocket and WAMP supporting asyncio and Twisted, for clients and servers.
- websockets - 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.
- Japronto! - Experimental http toolkit built on top of uvloop and picohttpparser.
- Starlette - A lightweight ASGI framework/toolkit for building high performance services.
- uvicorn - The lightning-fast ASGI server.
- FastAPI - A very high performance Python 3.6+ API framework based on type hints. Powered by Starlette and Pydantic.
Message Queues
Libraries to implement applications using message queues.
- aioamqp - AMQP implementation using asyncio.
- pyzmq - Python bindings for ZeroMQ.
- aiozmq - Alternative Asyncio integration with ZeroMQ.
- crossbar - Crossbar.io is a networking platform for distributed and microservice applications.
- asyncio-nats - Client for the NATS messaging system.
- aiokafka - Client for Apache Kafka.
Database Drivers
Libraries to connect to databases.
- asyncpg - Fast PostgreSQL Database Client Library for Python/asyncio.
- asyncpgsa - Asyncpg with sqlalchemy core support.
- aiopg - Library for accessing a PostgreSQL database.
- aiomysql - Library for accessing a MySQL database
- aioodbc - Library for accessing a ODBC databases.
- motor - The async Python driver for MongoDB.
- aioredis - aio-libs Redis client (PEP 3156).
- asyncio-redis - Redis client for Python asyncio (PEP 3156).
- aiocouchdb - CouchDB client built on top of aiohttp (asyncio).
- aioinflux - InfluxDB client built on top of aiohttp.
- aioes - Asyncio compatible driver for elasticsearch.
- peewee-async - ORM implementation based on peewee and aiopg.
- GINO - is a lightweight asynchronous Python ORM based on SQLAlchemy core, with asyncpg dialect.
- Tortoise ORM - native multi-backend ORM with Django-like API and easy relations management.
- Databases - Async database access for SQLAlchemy core, with support for PostgreSQL, MySQL, and SQLite.
Networking
Libraries to communicate in your network.
- AsyncSSH - Provides an asynchronous client and server implementation of the SSHv2 protocol.
- aiodns - Simple DNS resolver for asyncio
- httpx - asynchronous HTTP client for Python 3 with requests 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
.
Testing
Libraries to test asyncio based applications.
- aiomock - A python mock library that supports async methods.
- asynctest - Enhance the standard unittest package with features for testing. asyncio libraries
- pytest-asyncio - Pytest support for asyncio.
- aresponses - Asyncio http mocking. Similar to the responses library used for requests
- aioresponses - Helper for mock/fake web requests in Python aiohttp package.
Alternative Loops
Alternative asyncio loop implementations.
- uvloop - Ultra fast implementation of asyncio event loop on top of libuv.
Misc
Other awesome asyncio libraries.
- aiocache - Cache manager for different backends.
- aiofiles - File support for asyncio.
- aiodebug - A tiny library for monitoring and testing asyncio programs.
- aiorun - A
run()
function that handles all the usual boilerplate for startup and graceful shutdown. - aioserial - A drop-in replacement of pySerial.
- aiozipkin - Distributed tracing instrumentation for asyncio with zipkin
- asgiref - Backend utils for ASGI to WSGI integration, includes sync_to_async and async_to_sync function wrappers.
- ruia - An async web scraping micro-framework based on asyncio.
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 | blog post - 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).
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 - The coroutine concurrency library.
- Curio-Asyncio Bridge - basic curio -> asyncio coroutine bridge
- trio - Pythonic async I/O for humans and snake people.
- trio-asyncio - re-implementation of the asyncio mainloop on top of Trio
原文:https://github.com/timofurrer/awesome-asyncio
- 登录 发表评论