{ "info": { "author": "Marek Majkowski", "author_email": "marek@popcount.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Puka - the opinionated RabbitMQ client\n======================================\n\nPuka is yet-another Python client library for RabbitMQ. But as opposed\nto similar libraries, it does not try to expose a generic AMQP\nAPI. Instead, it takes an opinionated view on how the user should\ninteract with RabbitMQ.\n\n\nPuka is simple\n--------------\n\nPuka exposes a simple, easy to understand API. Take a look at the\n`publisher` example:\n\n import puka\n\n client = puka.Client(\"amqp://localhost/\")\n\n promise = client.connect()\n client.wait(promise)\n\n promise = client.queue_declare(queue='test')\n client.wait(promise)\n\n promise = client.basic_publish(exchange='', routing_key='test',\n body='Hello world!')\n client.wait(promise)\n\n\nPuka is asynchronous\n--------------------\n\nPuka is fully asynchronous. Although, as you can see in example\nabove, it can behave synchronously. That's especially useful for\nsimple tasks when you don't want to introduce callbacks.\n\nHere's the same code written in an asynchronous way:\n\n import puka\n\n def on_connection(promise, result):\n client.queue_declare(queue='test', callback=on_queue_declare)\n\n def on_queue_declare(promise, result):\n client.basic_publish(exchange='', routing_key='test',\n body=\"Hello world!\",\n callback=on_basic_publish)\n\n def on_basic_publish(promise, result):\n print \" [*] Message sent\"\n client.loop_break()\n\n client = puka.Client(\"amqp://localhost/\")\n client.connect(callback=on_connection)\n client.loop()\n\nYou can mix synchronous and asynchronous programming styles if you want\nto.\n\n\nPuka never blocks\n-----------------\n\nIn the pure asynchronous programming style Puka never blocks your\nprogram waiting for network. However it is your responsibility to\nnotify when new data is available on the network socket. To allow that\nPuka allows you to access the raw socket descriptor. With that in hand\nyou can construct your own event loop. Here's an the event loop that\nmay replace `wait_for_any` from previous example:\n\n fd = client.fileno()\n while True:\n client.run_any_callbacks()\n\n r, w, e = select.select([fd],\n [fd] if client.needs_write() else [],\n [fd])\n if r or e:\n client.on_read()\n if w:\n client.on_write()\n\n\nPuka is fast\n------------\n\nPuka is asynchronous and has no trouble in handling many requests at a\ntime. This can be exploited to achieve a degree of parallelism. For\nexample, this snippet creates 1000 queues in parallel:\n\n promises = [client.queue_declare(queue='a%04i' % i) for i in range(1000)]\n for promise in promises:\n client.wait(promise)\n\nPuka also has a nicely optimized AMQP codec, but don't expect miracles\n- it can't go faster than Python.\n\nPuka is sensible\n----------------\n\nPuka does expose only a sensible subset of AMQP, as judged by the author.\n\nThe major differences between Puka and normal AMQP libraries include:\n\n - Puka doesn't expose AMQP channels to the users.\n - Puka treats `basic_publish` as a synchronous method. You can wait\n on it and make sure that your data is delivered. Alternatively,\n you may ignore the promise and treat it as an asynchronous command.\n - Puka tries to cope with the AMQP exceptions and expose them\n to the user in a predictable way. Unlike other libraries it's\n possible (and recommended!) to recover from AMQP errors.\n\n\nPuka is experimental\n--------------------\n\nPuka is a side project, written mostly to prove if it is possible to\ncreate a reasonable API on top of the AMQP protocol.\n\n\nI like it! Show me more!\n------------------------\n\nThe best examples to start with are in the\n[rabbitmq-tutorials repo](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/python-puka).\n\nMore code can be found in the `./examples` directory. Some\ninteresting bits:\n\n - `./examples/send.py`: sends one message\n - `./examples/receive_one.py`: receives one message\n - `./examples/stress_amqp_consume.py`: a script used to\n benchmark the throughput of the server\n\n\nThere is also a bunch of fairly complicated examples hidden in the\ntests (see the `./tests` directory).\n\n\nI want to install Puka\n----------------------\n\nPuka works with Python 2.6 and 2.7.\n\nYou can install Puka system-wide using pip:\n\n sudo pip install puka\n\nAlternatively to install it in the `virtualenv` local environment:\n\n virtualenv my_venv\n pip -E my_venv install puka\n\nOr if you need the code from trunk:\n\n sudo pip install -e git+http://github.com/majek/puka.git#egg=puka\n\n\nI want to run the examples\n--------------------------\n\nGreat. Make sure you have `rabbitmq` server installed and follow this\nsteps:\n\n git clone https://github.com/majek/puka.git\n cd puka\n make\n cd examples\n\nNow you're ready to run the examples, start with:\n\n python send.py\n\n\nI want to see the API documentation\n-----------------------------------\n\nThe easiest way to get started is to take a look at the examples and\ntweak them to your needs. Detailed documentation doesn't exist\nnow. If it existed it would live here:\n\n[http://majek.github.com/puka/](http://majek.github.com/puka/)\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/majek/puka#readme", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "puka", "package_url": "https://pypi.org/project/puka/", "platform": "any", "project_url": "https://pypi.org/project/puka/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/majek/puka#readme" }, "release_url": "https://pypi.org/project/puka/0.0.7/", "requires_dist": null, "requires_python": null, "summary": "Puka - the opinionated RabbitMQ client", "version": "0.0.7" }, "last_serial": 1186589, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e3502c970d1d1626ffbbc82260c59d32", "sha256": "d2e4f7846102c6ef5525e8cbd008ebdd727cb6a22b659563fc6078b94ff9542e" }, "downloads": -1, "filename": "puka-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e3502c970d1d1626ffbbc82260c59d32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24906, "upload_time": "2011-07-05T12:42:22", "url": "https://files.pythonhosted.org/packages/6f/a1/79c38c5285c91c621ae84b2138ccdd5d8b2c206cac3ad313e432fe2f23b0/puka-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "ff3cba07c3a6a1d39ad185e9c8f57e46", "sha256": "c826cadadd42381241edc24abb8213724be82a6899db23b00bb41594c1156c72" }, "downloads": -1, "filename": "puka-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ff3cba07c3a6a1d39ad185e9c8f57e46", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25110, "upload_time": "2011-07-06T18:40:43", "url": "https://files.pythonhosted.org/packages/19/6f/272f3771b77d37a0e34612913b8d47552baa5bcd4b93288a1b03c554e4dd/puka-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "40f86dcf9adbf6ab1c5decff0a901168", "sha256": "88bc63278fa263e39bfe88bebf2980c518818b5c8bbfd8d4700823a651df72e2" }, "downloads": -1, "filename": "puka-0.0.3.tar.gz", "has_sig": false, "md5_digest": "40f86dcf9adbf6ab1c5decff0a901168", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25387, "upload_time": "2011-08-05T13:27:57", "url": "https://files.pythonhosted.org/packages/8f/6b/179b1526adabed2b356960a36f3e3311221cc4d64579f65da8eff1305034/puka-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "3d311894af06c6cc4aaecc724aefc63d", "sha256": "4451b6e9a2dc0b92c1019480336382c9a0d36d43daaf12557a52727401224a3f" }, "downloads": -1, "filename": "puka-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3d311894af06c6cc4aaecc724aefc63d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27299, "upload_time": "2012-03-20T11:34:23", "url": "https://files.pythonhosted.org/packages/64/d3/20ac9f69c4b70439bb55c02dae64d012a21af2d85af720d292d988f3e097/puka-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "dd8d2ffa63d9e2f8226cff43ec9d8e8e", "sha256": "98bb6d9eddbbbe4688778362f25c312b33e811f68e7155a9451faf2008828ace" }, "downloads": -1, "filename": "puka-0.0.5.tar.gz", "has_sig": false, "md5_digest": "dd8d2ffa63d9e2f8226cff43ec9d8e8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27625, "upload_time": "2012-05-09T17:48:51", "url": "https://files.pythonhosted.org/packages/f0/85/3645beaeffd67ab5d97e08fb725a431dca8f7f356bcfae26ba01ffd5af77/puka-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "7d95042e783d2e17a2c37828e56d8256", "sha256": "d3c857aba8eeb6b0f355e96d1c02359993e1a0b384b1c27cc69d685fb7cf91dd" }, "downloads": -1, "filename": "puka-0.0.6.tar.gz", "has_sig": false, "md5_digest": "7d95042e783d2e17a2c37828e56d8256", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29296, "upload_time": "2012-11-21T09:58:00", "url": "https://files.pythonhosted.org/packages/d9/fd/fabb826c93d99b34aad34b4a2e19926b49128ba01531b155d286801fbcd3/puka-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "9c00f961ca182f605430b7058960cb68", "sha256": "e7890d51f9bb52dca3ced08bd1734c29562b6c2f02aa2cff579ef59c6789d2ad" }, "downloads": -1, "filename": "puka-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9c00f961ca182f605430b7058960cb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31534, "upload_time": "2014-08-11T15:24:06", "url": "https://files.pythonhosted.org/packages/2a/1c/eee054efe75a92397849075d0d9cff6a9b8bdf67ab3964cf931de4509542/puka-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c00f961ca182f605430b7058960cb68", "sha256": "e7890d51f9bb52dca3ced08bd1734c29562b6c2f02aa2cff579ef59c6789d2ad" }, "downloads": -1, "filename": "puka-0.0.7.tar.gz", "has_sig": false, "md5_digest": "9c00f961ca182f605430b7058960cb68", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31534, "upload_time": "2014-08-11T15:24:06", "url": "https://files.pythonhosted.org/packages/2a/1c/eee054efe75a92397849075d0d9cff6a9b8bdf67ab3964cf931de4509542/puka-0.0.7.tar.gz" } ] }