skillfed

pika

Pika Python AMQP Client Library

pika v1.4.4 13.8M downloads/30d#1,263 on PyPI3,876
Permissive license BSD-3-Clause Active released

What it is and what it does

Pika is a pure-Python implementation of the AMQP 0-9-1 protocol with RabbitMQ extensions, allowing Python applications to publish and consume messages from RabbitMQ brokers. It supports Python 3.7 and later on CPython and PyPy, with no external runtime dependencies.

The library provides multiple connection adapters to suit different application patterns: BlockingConnection for synchronous code, SelectConnection for asynchronous I/O without external frameworks, and specialized adapters for AsyncIO, Gevent, Tornado, and Twisted. It handles connection recovery, multi-host failover, and thread-safe callback mechanisms for delegating work across threads while maintaining the single-threaded constraint of individual connection instances.

Use it for:

  • Publish messages to RabbitMQ queues from Python services using BlockingConnection for simple synchronous workflows.
  • Consume and process messages from RabbitMQ with automatic acknowledgment handling and error recovery.
  • Build asynchronous message-driven applications using AsyncIO or Tornado adapters for high-concurrency scenarios.
  • Implement fault-tolerant RabbitMQ clients with multi-host connection parameters and automatic retry logic.
  • Delegate message processing to background threads while maintaining AMQP heartbeat and I/O servicing in the main thread.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Pika is a pure-Python AMQP 0-9-1 client library for RabbitMQ that enables you to publish and consume messages over AMQP connections.

Yes. Pika is a mature, actively maintained library with no security vulnerabilities, zero runtime dependencies, and broad Python version support. It is the standard choice for RabbitMQ integration in Python and suitable for both simple and complex messaging patterns. Install it if you need to communicate with RabbitMQ.

Install

pika on PyPI

pip

pip install pika

uv

uv add pika

poetry

poetry add pika

Installing pika

Before you install

Installation is straightforward with no runtime dependencies and a pure-Python wheel. The project is actively maintained with a recent release and has been in production use since 2010.

License in practice

BSD-3-Clause is a permissive license that allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects.

Quickstart

import pika

connection = pika.BlockingConnection()
channel = connection.channel()
channel.basic_publish(exchange='test', routing_key='test', body=b'Test message.')
connection.close()

Requires a running RabbitMQ server accessible at the connection parameters.

Verify before relying

  • Performance characteristics and throughput limits under load conditions.
  • Thread-safety guarantees and recommended patterns for multi-threaded applications.
  • Compatibility details with specific RabbitMQ server versions beyond AMQP 0-9-1 protocol support.
  • Default connection host and port when not explicitly specified.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 8 days since the last release
Last repo commit
First released
Downloads 13,782,804/month — #1,263 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pika-1.4.4-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyTopic :: CommunicationsTopic :: InternetTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Networking

Tags

rabbitmq client pythonamqp 0-9-1 protocolmessage queue publisher consumerrabbitmq python libraryamqp client libraryblocking connection adapterasynchronous message broker
message-queuerabbitmqamqp

More Libraries packages