Skip to main content

A pure python, thread-safe, minimalistic and pythonic RabbitMQ client library

Project description

A pure python, thread-safe, minimalistic and pythonic BSD Licensed AMQP/RabbitMQ library that supports Python 2.6+ and Python 3.2+. rabbitpy aims to provide a simple and easy to use API for interfacing with RabbitMQ, minimizing the programming overhead often found in other libraries.

Version Downloads Status Coverage License

Installation

rabbitpy may be installed via the Python package index with the tool of your choice. I prefer pip:

pip install rabbitpy

But there’s always easy_install:

easy_install rabbitpy

rmqid Compatibility

rabbitpy is API compatible with rmqid.

Documentation

https://rabbitpy.readthedocs.org

Requirements

Simple Examples

The simple methods provide quick and easy access for one-off actions with rabbitpy. In addition to the simple methods, there is extensive support for all RabbitMQ actions using the rabbitpy object methods.

Simple Publisher

The simple publisher is ideal for sending one off messages:

>>> rabbitpy.publish('amqp://guest:guest@localhost:5672/%2f',
                     exchange='test',
                     routing_key='example',
                     body='This is my test message')

Simple Getter

>>> m = rabbitpy.get('amqp://guest:guest@localhost:5672/%2f', 'test')
>>> m.json()
{u'foo': u'bar'}

Simple Consumer

>>> for message in rabbitpy.consume('amqp://guest:guest@localhost:5672/%2f', 'example', no_ack=True):
...     message.pprint(properties=True)
...
Exchange: amq.topic

Routing Key: example

Properties:

{'app_id': '',
 'cluster_id': '',
 'content_encoding': '',
 'content_type': '',
 'correlation_id': '',
 'delivery_mode': None,
 'expiration': '',
 'headers': None,
 'message_id': 'b191f7f4-4e9d-4420-b18a-2ac8783ab3c5',
 'message_type': '',
 'priority': None,
 'reply_to': '',
 'timestamp': datetime.datetime(2013, 12, 18, 21, 48, 5),
 'user_id': ''}

Body:

'This is my test message'

RabbitMQ Objects

In addition, the API offers support for more complex coding using objects that represent either the AMQ Model or RabbitMQ concepts. These include:

  • Connections

  • Channels

  • Exchanges

  • Messages

  • Policies [@TODO]

  • Queues

  • Transactions

  • Users [@TODO]

  • Virtual Hosts [ @TODO]

More complex examples and the rabbitpy API documentation are available at https://rabbitpy.readthedocs.org

Version History

Available at https://rabbitpy.readthedocs.org/en/latest/history.html

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

rabbitpy-0.21.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

rabbitpy-0.21.0-py2.py3-none-any.whl (43.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file rabbitpy-0.21.0.tar.gz.

File metadata

  • Download URL: rabbitpy-0.21.0.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rabbitpy-0.21.0.tar.gz
Algorithm Hash digest
SHA256 c5fd592ef6a44ffa6454717f09ce594991291471f53c9f5af7338e99d7e0ccce
MD5 322ed70d0bf36f08dc614751a1613f2c
BLAKE2b-256 873d68fc3a0cb9738e020e45f4600d75c829f3c76d80e7dd0441e6e2e0ee6adc

See more details on using hashes here.

File details

Details for the file rabbitpy-0.21.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for rabbitpy-0.21.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ebf00578e95ea048cd7ad600ae3cbf1d8ed1f813ee29952609a8fbf828f0c38
MD5 83613207af1db06c2e295c6a0f229165
BLAKE2b-256 516c3e607bfebf7a805c9dda7e140069d3f888c6beed1e309e1aba55403b491d

See more details on using hashes here.

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