Skip to main content

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

Project description

PyRMQ

GitHub Workflow Status PyPI Documentation Status Codecov Supports Python >= 3.5 License Code style: black

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

Features

Stop worrying about boilerplating and implementing retry logic for your queues. PyRMQ already does it for you.

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

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 = Consumer(
    exchange_name="exchange_name",
    queue_name="queue_name",
    routing_key="routing_key",
    callback=callback
)
consumer.start()

Documentation

Visit https://pyrmq.readthedocs.io for the most up-to-date documentation.

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-1.1.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyRMQ-1.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file PyRMQ-1.1.0.tar.gz.

File metadata

  • Download URL: PyRMQ-1.1.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for PyRMQ-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d4fb2cfd5467829de305e16ef382f0dbdfbf8edb84efea8e6e1b5a222ee91579
MD5 338f7ab028587726f3f373bcf4a219bd
BLAKE2b-256 8f6aa784ee1c90175d9a30a63c5798be081c0b31184c18411c551990867fd073

See more details on using hashes here.

File details

Details for the file PyRMQ-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: PyRMQ-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for PyRMQ-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddbcfa3c80c245a6bb15eb9b0211994a83d26a8580639d507749c643c75d95e1
MD5 1c0deffc7a13640939c771f6b9cbfe53
BLAKE2b-256 fd6c2cd767facc5da5b6dbb50b49ab973072cc03ddee891169da44150bf75c68

See more details on using hashes here.

Supported by

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