Following is an answer to this question. However, it uses HTTP API and not pika.
import subprocess
import os
import json
#Execute in command line
def execute_command(command):
proc = subprocess.Popen(command,shell=True,stdout=subprocess.PIPE)
script_response = proc.stdout.read().split('\n')
resp=json.loads(script_response[7])
print resp[0]['name']
print resp[0]['consumers']
######### MAIN #########
if __name__ == '__main__':
execute_command('curl -i -u guest:guest http://*IP ADDRESS*:15672/api/queues/')
Please refer : http://hg.rabbitmq.com/rabbitmq-management/raw-file/3646dee55e02/priv/www-api/help.html