aio-pika
Wrapper around the aiormq for asyncio and humans
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 on this page — 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
aio-pika on PyPI
pip
pip install aio-pikauv
uv add aio-pikapoetry
poetry add aio-pikaInstalling 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 the current Python release (<4,>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — aiormq, yarl |
| Maintenance | actively maintained — 36 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,065,468/month — #1,975 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aio_pika-10.0.1-py3-none-any.whl
Keywords: rabbitmq, asyncio, amqp, amqp 0.9.1, aiormq
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
aiormqaiormq is a pure Python AMQP 0.9.1 client…
permissive · top 5,000 on PyPI
asyncsleepiqAsyncSleepIQ provides async Python access to…
permissive · top 15,000 on PyPI
pikaPika is a pure-Python AMQP 0-9-1 client library…
permissive · top 5,000 on PyPI
taskiq-aio-pikaProvides a RabbitMQ broker implementation for…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-aio-pikaAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
pyrabbit2Pyrabbit2 provides a Python interface to the…
permissive · top 15,000 on PyPI
pamqppamqp encodes and decodes AMQP 0-9-1 protocol…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-pikaAdds distributed tracing to pika (RabbitMQ…
permissive · top 5,000 on PyPI
amqpPure-Python AMQP 0.9.1 client library for…
permissive · top 1,000 on PyPI
pika-stubsProvides type stubs for the pika RabbitMQ…
permissive · top 15,000 on PyPI