Skip to main content
rabbitmq
========

Python bindings to librabbitmq using CFFI

This is fairly rudimentary so far but does allow using librabbitmq on Python 3 to a basic degree, which was my primary motivation for this work.

Currently tested against librabbitmq 0.8.0 on Python 3.6 and 2.7. It is in production on Python 3.6 on two fairly heavily-loaded message queues.

Available [on PyPI](https://pypi.python.org/pypi/rabbitmq), just `pip install rabbitmq`.

Proper documentation coming soon. Example usage:

```python
import rabbitmq

conn = rabbitmq.Connection()
conn.open(AMQP_BROKER_HOST, AMQP_BROKER_PORT)
conn.login(AMQP_BROKER_VHOST, 0, AMQP_BROKER_USER, AMQP_BROKER_PASSWORD)
conn.open_channel(1)
conn.declare_exchange(1, "queuename", "direct")
conn.declare_queue(1, "queuename")
conn.bind_queue(1, "queuename", "queuename", "queuename")
conn.consume(1, "queuename")

publish_conn = rabbitmq.Connection()
publish_conn.open(AMQP_BROKER_HOST, AMQP_BROKER_PORT)
publish_conn.login(AMQP_BROKER_VHOST, 0, AMQP_BROKER_USER, AMQP_BROKER_PASSWORD)
publish_conn.open_channel(1)
publish_conn.declare_exchange(1, "exchangename", "direct")

while True:
envelope = conn.consume_message()
conn.ack(1, envelope.delivery_tag)

props = rabbitmq.Properties(content_type="...", delivery_mode=1)
body = b"..."
if len(body) > 8192:
# example of compressing large message bodies
from bz2 import compress
body = compress(body)
props.content_encoding = "bzip2"
publish_conn.publish(1, "exchangename", envelope.message.properties.reply_to, body, props)
```


Metadata

Release files for rabbitmq 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rabbitmq 0.2.0
File Interpreter ABI Platform
rabbitmq-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / rabbitmq-0.2.0-py2.py3-none-any.whl

Download URL rabbitmq-0.2.0-py2.py3-none-any.whl
Size 7.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
74cfbc0f365019a8f318cd1ad9b1f85682768568fa3816740df37509a6dfbc2d
BLAKE2b-256 checksum
How to use checksums
bc1d6b4397309786eaba2dee82285773c383d41ab4b3ffdb933d9af48de52025
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for rabbitmq 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page