Skip to main content

Python with RabbitMQ—simplified so you won't have to.

Project description

PyRMQ

GitHub Workflow Status Documentation Status Codecov License Code style: black

Python with RabbitMQ—simplified so you won't have to.

Development Status

Note: Currently under active development.

Features

  • Use out-of-the-box and thread-safe Consumer and Publisher classes created from pika for your projects and tests.
  • Built-in retry-backoff logic for connecting, consuming, and publishing.
  • Works with Python 3.

Getting Started

Installation

PyRMQ is available at PyPi.

pip install pyrmq

Usage

Publishing

Just instantiate the feature you want with their respective settings. PyRMQ already works out of the box with RabbitMQ's default initialization settings.

from pyrmq import Publisher
publisher = Publisher(
    exchange_name="exchange_name",
    queue_name="queue_name",
    routing_key="routing_key",
)
publisher.publish({"pyrmq": "My first message"})

Consuming

Intantiating a Consumer automatically starts it in its own thread making it non-blocking by default. When run after the code from before, you should be able to receive the published data.

from pyrmq import Consumer

def callback(data):
    print(f"Received {data}!")

Consumer(
    exchange_name="exchange_name",
    queue_name="queue_name",
    routing_key="routing_key",
    callback=callback
)

Documentation

Complete document is found at https://pyrmq.readthedocs.io

run build and generate coverage report.

Testing

For development, just run:

pytest

To test for all the supported Python versions:

pip install tox
tox

To test for a specific Python version:

tox -e py38

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyRMQ-0.1.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

PyRMQ-0.1.1-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page