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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: PyRMQ-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 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-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0905d4be3e600f411b6cf4035aa2077d8e36c7c3511319fe45c6a1d19a72da57
MD5 ca6352d446b392e07178d6cfe032b2f8
BLAKE2b-256 f354bc268e17a1cd082bf0faa3573898fc1a5e11008a55333fa7f09bbe64122c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyRMQ-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 290307dd364dc9fa1a81d0de5a9f762711c7a99a2c7d85bf84ade614525d5da4
MD5 2466bb3056998ab4c54b1ee2cbb61d19
BLAKE2b-256 ffaf5479bae3b14616a05fd7d007ed3a92f5d05b16c60cb76105e036950f023b

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