--- id: aio-pika version: "10.0.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aio-pika — Wrapper around the aiormq for asyncio and humans License: permissive · Maintenance: active · Downloads: 6.1M/mo ## What it is and what it does aio-pika is a Python library that wraps the lower-level aiormq AMQP client to provide a more developer-friendly, object-oriented interface for RabbitMQ messaging in asyncio applications. It handles the complexity of AMQP protocol details while exposing simple methods for declaring exchanges and queues, publishing messages, and consuming from queues. The library includes automatic reconnection with state recovery (via connect_robust), support for publisher confirms and transactions, and complete type hints for modern Python development. You use aio-pika when you need to integrate RabbitMQ into an async Python service—whether as a message publisher, consumer, or both. It abstracts away protocol-level concerns so you can focus on business logic, and it's designed for Python 3.11+ with support for current and near-future Python versions. The two core dependencies (aiormq for the AMQP protocol implementation and yarl for URL parsing) are lightweight, making installation straightforward. Use it for: - Build async microservices that publish and consume messages from a shared RabbitMQ broker. - Implement task queues or job workers that process messages asynchronously from RabbitMQ. - Create event-driven architectures where services communicate via RabbitMQ exchanges and queues. - Handle message acknowledgment and publisher confirms for reliable message delivery patterns. - Recover from connection failures automatically while preserving declared queues and bindings. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. aio-pika is an asyncio-based wrapper around aiormq that provides a high-level, object-oriented API for publishing and consuming messages on RabbitMQ via AMQP. Yes. aio-pika is actively maintained, has no known vulnerabilities, installs with minimal friction, and is widely used (top 5000 PyPI packages). It's the right choice if you're building asyncio-based services that need RabbitMQ integration. The Apache-2.0 license is permissive for any use case. Only caveat: requires Python 3.11+, so check your project's minimum version. ## Install pip install aio-pika uv add aio-pika poetry add aio-pika ## Installing aio-pika Before you install: Low friction: pure Python wheel with only two runtime dependencies (aiormq and yarl). Actively maintained with a recent release (36 days old) and consistent repository activity. License in practice: Apache-2.0 is permissive; you can use aio-pika in proprietary projects and modify it freely, with minimal obligations beyond attribution. Quickstart: pip install aio-pika import asyncio import aio_pika async def main(): connection = await aio_pika.connect_robust("amqp://guest:guest@127.0.0.1/") channel = await connection.channel() queue = await channel.declare_queue("test_queue") await connection.close() asyncio.run(main()) Requires Python 3.11 or later; a running RabbitMQ server is needed for actual message operations. Verify before relying: - Performance characteristics under high message throughput or large cluster deployments. - Specific reconnection behavior and recovery guarantees with connect_robust in edge cases. - Compatibility with RabbitMQ versions beyond the AMQP 0.9.1 protocol it targets. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 6.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags rabbitmq async client, amqp asyncio wrapper, async message queue python, rabbitmq publisher consumer, amqp 0.9.1 asyncio, async rabbitmq library, aiormq high-level api, rabbitmq, async-messaging, amqp [View on SkillFed](https://skillfed.io/packages/aio-pika) · [View on PyPI](https://pypi.org/project/aio-pika/)