Skip to main content

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

Project description

PyRMQ

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

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

Development Status

Note: Development status is Pre-Alpha

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

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-0.1.2.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.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: PyRMQ-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 8f5fe1d0e5092708222ebbb59339da62141a0d8ae599e826b79c9b1209e9a10c
MD5 86abe2b745601c45a06f078b3a4f78db
BLAKE2b-256 8fd90c3a6bff3c8b1d746670fee964b9435c0dea05a098f2e6d7e4063488cc43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyRMQ-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f77d3c79ed3cdc9186b3f7acee7feeaa19f26a98340eb70657d5400a589558d4
MD5 bb27aafa9b5b3ebc79e811be1cea1a6b
BLAKE2b-256 7164dd889886b90f91c7a9fc707515e2a4eee489e7fd1d0f4ca54c3693d63def

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