Skip to content
Python client for IronMQ.
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Python language binding for IronMQ. IronMQ is an elastic message queue for managing data and event flow within cloud applications and between systems. See How It Works

Getting Started

Get credentials

To start using iron_mq_python, you need to sign up and get an OAuth2 token.

  1. Go to and sign up.
  2. Get an OAuth2 Token at

Install iron_mq_python

pip install iron_mq_python

or just copy and include it in your script:

from iron_mq import *


ironmq = IronMQ()

will try reasonable defaults, accepting following optionally:

ironmq = IronMQ(host="",
                protocol="https", port=443,

The Basics

Listing queues


returns list of queues names

we get queue by name:

queue = ironmq.queue("test_queue")

Push a message(s) on the queue:"Hello world")

Message can be described by dict:

message = {
    "body" : "Test Message",
    "timeout" : 120, # Timeout, in seconds. After timeout, item will be placed back on queue. Defaults to 60.
    "delay" : 5, # The item will not be available on the queue until this many seconds have passed. Defaults to 0.
    "expires_in" : 2*24*3600 # How long, in seconds, to keep the item on the queue before it is deleted.

We can post several messages at once:"more", "and more", "and more")*[str(i) for i in range(10)])

Pop a message off the queue:


When you pop/get a message from the queue, it will NOT be deleted. It will eventually go back onto the queue after a timeout if you don't delete it (default timeout is 60 seconds).

Delete a message from the queue:


Delete a message from the queue when you're done with it.

Clear a queue:


Get queue size, id, total_messages and whole info
 # {u'id': u'502d03d3211a8f5e7742d224',
 # u'name': u'queue12',
 # u'reserved': 0,
 # u'size': 15,
 # u'total_messages': 17}
queue.size() # 15
queue.total_messages() # 17 # u'502d03d3211a8f5e7742d224'

Full Documentation

You can find more documentation here:

Something went wrong with that request. Please try again.