Skip to main content

Simple Python client library for RabbitMQ

Project description

pyrabbitmq

Scenarios

The library is not proposed with same functions as 'pika'. It helps to initialize a rabbitmq instance via its native API in following cases:

  • Many rabbitmq instances to be kicked via scripts but not its management UI, or
  • For some reason you need reset rabbitmq instances more often.

Good Luck.

Usage

from pyrabbitmq import connection

# rmq = connection.Instance(
#     rabbitmq_host="127.0.0.1",
#     rabbitmq_port="5673",
#     rabbitmq_admin_user="guest",
#     rabbitmq_admin_password="guest",
#     rabbitmq_tls_enabled=False
# )

# It reads the rabbitmq os $env values. 
# If no $env variables find, default values used..
rmq = connection.Instance()

# Virtual Hosts
v = rmq.VirtualHost
v.create('a-vhost-name')
v.delete('a-vhost-name')

# Users
u = rmq.User
u.create('test-user','test-user-password')
u.delete('test-user')

# Queues
q = rmq.Queue
q.create(vhost='vhost01', queue='queue01')
q.delete(vhost='vhost01', queue='queue01')

# Bindings
b = rmq.Binding
b.create(vhost='vhost01',exchange='exchange01', queue='queue01')
b.delete(vhost='vhost01',exchange='exchange01',queue='queue01',routing_key='routing_key-queue01')

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

pyrabbitmq-0.0.5.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

pyrabbitmq-0.0.5-py3-none-any.whl (3.1 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