{ "info": { "author": "EasyPost", "author_email": "oss@easypost.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: System Administrators", "License :: OSI Approved :: ISC License (ISCL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Database" ], "description": "**`pystalk`** is an extremely simple client for [beanstalkd](http://kr.github.io/beanstalkd/). It is\ncompatible with both Python 2 and Python 3.\n\nThis project was initially created for [beancmd](https://github.com/EasyPost/beancmd). You may also be interested in that tool!\n\n[![TravisCI Build Status](https://travis-ci.org/EasyPost/pystalk.svg?branch=master)](https://travis-ci.org/EasyPost/pystalk)\n[![ReadTheDocs](https://readthedocs.org/projects/pip/badge/?version=latest)](http://pystalk.readthedocs.io/en/latest/)\n\n## Requirements / Installing\n\nThis software works with Python 2.7, and 3.3+.\n\nIt does not support any asynchronous event loops and has not been tested with gevent. It's designed for simple,\nsynchronous use.\n\nYou should be able to install it from [PyPI](https://pypi.python.org) with `pip install pystalk`.\n\n## Example Usage\n\n### Creating Jobs\n\n```python\n#!/usr/bin/python\n\nimport json\n\nfrom pystalk import BeanstalkClient\n\nclient = BeanstalkClient('10.0.0.1', 11300)\nclient.put_job(json.dumps({\"foo\": \"bar\"}), delay=30)\n```\n\nThis will create a job with a 30-second delay on it. Note that the data for a job must be UTF-8 encodable.\n\n#### Creating Jobs in Specific Tubes\n\nBeanstalk has a notion of `tube`s (which is to say, named queues). There are several ways to put a\njob into a specific tube using pystalk:\n\n```python\n#!/usr/bin/python\n\nfrom pystalk import BeanstalkClient\n\nclient = BeanstalkClient('10.0.0.1', 11300)\n\n# method 1, matches the upstream protocol\nclient.use(\"some_tube\")\nclient.put_job(\"some message\")\n\n# method 2, using an external guard object like you would in C++ or Rust\nwith client.using(\"some_tube\") as inserter:\n inserter.put_job(\"some message\")\n\n\n# method 3\nclient.put_job_into(\"some_tube\", \"some message\")\n```\n\n### Consuming All Available Jobs\n\nThe following script will walk through all currently-READY jobs and then exit:\n\n```python\n#!/usr/bin/python\n\nfrom pystalk import BeanstalkClient\n\nclient = BeanstalkClient('10.0.0.1', 11300)\nfor job in client.reserve_iter():\n try:\n execute_job(job)\n except Exception:\n client.release_job(job.job_id)\n raise\n client.delete_job(job.job_id)\n```\n\nNote that, even though we require that job data be UTF-8 encodeable in the `put_job` method, we do not decode for you -- the job data that comes out is a byte-string in Python 3.5. You should call `.decode(\"utf-8\")` on it if you want to get the input data back out. If you would like that behavior, pass `auto_decode=True` to the `BeanstalkClient` constructor; note that this might make it difficult for you to consume data injected by other systems which don't assume UTF-8.\n\n### Multiple Job Servers\n\nThe following will reserve jobs from a group of Beanstalk servers, fairly rotating between them.\n\n```python\n#!/usr/bin/python\n\nfrom myapp import execute_job\nfrom pystalk import BeanstalkClient, BeanstalkTimedOutError\n\nhosts = ('10.0.0.1', '10.0.0.2')\nclients = dict((h, BeanstalkClient(h, 11300)) for h in hosts)\n\ni = 0\nwhile True:\n i += 1\n client = clients[hosts[i % len(hosts)]]\n try:\n job = client.reserve_job(1)\n except BeanstalkError as e:\n if e.message == 'TIMED_OUT':\n continue\n else:\n raise\n execute_job(job)\n client.delete_job(job.job_id)\n```\n\n## Development\n\nPretty straightforward. Develop in branches, send PRs, land on master. All tests must pass before landing.\n\n### Releasing a new version\n\n 1. Land all requisite changes\n 1. Bump the version in `setup.py` and `pystalk/__init__.py` to the stable version (e.g., `0.2`)\n 1. Update [`CHANGES.rst`](docs/source/CHANGES.rst) with the changes and the new version number\n 1. Update [`conf.py`](docs/source/conf.py) with the new version number\n 1. Commit\n 1. Tag the version (e.g., `git tag -s pystalk-0.2`)\n 1. Push up to Github\n 1. Upload to PyPI with `python setup.py sdist upload`\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/easypost/pystalk", "keywords": "", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "pystalk", "package_url": "https://pypi.org/project/pystalk/", "platform": "", "project_url": "https://pypi.org/project/pystalk/", "project_urls": { "CI": "https://travis-ci.org/EasyPost/pystalk", "Homepage": "https://github.com/easypost/pystalk" }, "release_url": "https://pypi.org/project/pystalk/0.6.0/", "requires_dist": [ "PyYAML (>=3.0)", "attrs (>=17.4)", "six" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "summary": "Very simple beanstalkd client", "version": "0.6.0" }, "last_serial": 5921038, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "4576ee68de3ab65d01c1d03706b3bd6e", "sha256": "96e41857d5cf30cd5bca7a32e84da0901a20209336435def39b15c5e4882e90f" }, "downloads": -1, "filename": "pystalk-0.2.tar.gz", "has_sig": false, "md5_digest": "4576ee68de3ab65d01c1d03706b3bd6e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7917, "upload_time": "2016-07-18T20:45:33", "url": "https://files.pythonhosted.org/packages/e1/ce/46a8066f795bc3ccf5ad5669d5802240d671687507860d044818448dd16f/pystalk-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "0692db50c1f3631ad982dd73d920ca05", "sha256": "33b161b735432c0a4c4a325d1073b07db37b269424111981d6e4c7ee4fd18c6d" }, "downloads": -1, "filename": "pystalk-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0692db50c1f3631ad982dd73d920ca05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9092, "upload_time": "2016-08-01T18:58:17", "url": "https://files.pythonhosted.org/packages/eb/69/fd814f71dc317488e91fa160e754944ae48cb0ff74fecc549cff2c959661/pystalk-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "a788403a9b97558b01cb5b29506b377b", "sha256": "932cdfc1a5e8f0e5f2ecfb3361a0518848073173d00ceb951e39805febc1be21" }, "downloads": -1, "filename": "pystalk-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a788403a9b97558b01cb5b29506b377b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10334, "upload_time": "2017-08-03T20:18:09", "url": "https://files.pythonhosted.org/packages/63/ca/96327add7cce9f4fdc8002b4e4b7f4ae14ba06c6d6498291a965ef8addd6/pystalk-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ca2971d155a2978ed0bde9b534f5fc6", "sha256": "85c9364ac4f2e95f9ab73112bd4a1c7df814f5f265686ee7e9ff7961f81ea6ac" }, "downloads": -1, "filename": "pystalk-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7ca2971d155a2978ed0bde9b534f5fc6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10330, "upload_time": "2017-08-03T20:18:10", "url": "https://files.pythonhosted.org/packages/93/c6/ba75508fdd301480a0652b87b30e33f3f7a20a5f28aac18e83000393ce94/pystalk-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "30eb5c6db8845daeeba359faa3ba61eb", "sha256": "40cf91439298e06f14fb88423c2ea902c29bb2b27c1ded0c387c63c10b15b6b5" }, "downloads": -1, "filename": "pystalk-0.3.0.tar.gz", "has_sig": false, "md5_digest": "30eb5c6db8845daeeba359faa3ba61eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10238, "upload_time": "2017-08-03T20:18:12", "url": "https://files.pythonhosted.org/packages/2a/31/20713ebc0e8833ecd824877ea61e377467b9688ab24fe5877e3218313120/pystalk-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "51cbf492c6ba9f1eb7d31af6af1b0f4d", "sha256": "e8f496052621fbe8cf5318baeba24704a1d51195df7eb27a81d8b169353b0415" }, "downloads": -1, "filename": "pystalk-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "51cbf492c6ba9f1eb7d31af6af1b0f4d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10436, "upload_time": "2017-08-22T22:55:04", "url": "https://files.pythonhosted.org/packages/ae/19/a1eb4de5f1976d84fd3cb0468c403f65055a160031ed4a5f22b33dff9467/pystalk-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3727c15ea42ee863430af9fb7955539e", "sha256": "5d09e671a03d9a453547867b70f14cff15759ab85751c63095359fdb36247ea9" }, "downloads": -1, "filename": "pystalk-0.3.1.tar.gz", "has_sig": false, "md5_digest": "3727c15ea42ee863430af9fb7955539e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10303, "upload_time": "2017-08-22T22:55:07", "url": "https://files.pythonhosted.org/packages/91/36/26dfd62e07b82959887054b17fac88d00f59f6c942c25d7a77b43088b71a/pystalk-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "a74acc00b9a1abc84d83ca1320c8648c", "sha256": "89599e640e47814f88981491473e7b2a8f1c1830063d9dc363114426abe24fa6" }, "downloads": -1, "filename": "pystalk-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a74acc00b9a1abc84d83ca1320c8648c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10784, "upload_time": "2017-12-06T21:45:22", "url": "https://files.pythonhosted.org/packages/b6/6b/02c62907ad16bbbd3a8747e2499c6bc23d05cce86a0da66a8d38a625363c/pystalk-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "805ad63bdb343be8ba82d813d6227c64", "sha256": "57b25bf9a9e15ea73fa140b21a239c490b59eed42d5d01df8b1bc6709f4a95db" }, "downloads": -1, "filename": "pystalk-0.4.0.tar.gz", "has_sig": false, "md5_digest": "805ad63bdb343be8ba82d813d6227c64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10634, "upload_time": "2017-12-06T21:45:23", "url": "https://files.pythonhosted.org/packages/c7/c2/4f6340ab62576f5f5b9e3134f3ad0b32d15c9d42459cf52180a74a6bd6a9/pystalk-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "714be0ece65e4678198d346220ae563c", "sha256": "e35d3a96cb99424d4e8e2d840aea4da1cdfcb512ca7a3d57b2143e40d401e9c1" }, "downloads": -1, "filename": "pystalk-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "714be0ece65e4678198d346220ae563c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 11460, "upload_time": "2018-06-06T23:43:08", "url": "https://files.pythonhosted.org/packages/c7/b7/add2a6b18fa3fbb7f5937cb9130a63062058b0c7fb63f37e8ea592d12b57/pystalk-0.5.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c9fd3a347e42b8ccd94a7d8dc0306d3", "sha256": "8e76936cacce3b97a9c2a0cebe3ba5064aa93fb1184dc6d4d1a5507000d94fd7" }, "downloads": -1, "filename": "pystalk-0.5.0.tar.gz", "has_sig": false, "md5_digest": "6c9fd3a347e42b8ccd94a7d8dc0306d3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 11234, "upload_time": "2018-06-06T23:43:09", "url": "https://files.pythonhosted.org/packages/e4/d1/cba806c6546b2cb1caee4914150979ea7fd4c0494e76bc2a5e38e6d8962b/pystalk-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "7e1807fff5358d9d7e29b3c5d7cd50c3", "sha256": "656b2012faa7fff73a7b44fd3af5c02cfd1a63b10f5e4110b7fa98a629eb1c35" }, "downloads": -1, "filename": "pystalk-0.5.1-py2-none-any.whl", "has_sig": false, "md5_digest": "7e1807fff5358d9d7e29b3c5d7cd50c3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 12210, "upload_time": "2019-01-12T00:11:52", "url": "https://files.pythonhosted.org/packages/1f/d0/0ce6cba0583e701a46a699074b8b75549101187aac3cba96b8b467ea6663/pystalk-0.5.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a41f1dddf0bd4619358965b8c1aae9a1", "sha256": "183ff62e5ea27f4075c73674685d7746188888ba8c8e68dfe2d35710bba0d338" }, "downloads": -1, "filename": "pystalk-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a41f1dddf0bd4619358965b8c1aae9a1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 12862, "upload_time": "2019-01-12T00:11:54", "url": "https://files.pythonhosted.org/packages/e8/c4/12fd5eb5346024c32775b4dfe6bf000ef8d020d0eb4c5914e79a402d5019/pystalk-0.5.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a781b110a1c8a92b5e62bf0998d78abf", "sha256": "16133a39f4be69f59961397e35c8c8e6d99f8813dda8c90696e2ac0647f2a86e" }, "downloads": -1, "filename": "pystalk-0.5.1.tar.gz", "has_sig": false, "md5_digest": "a781b110a1c8a92b5e62bf0998d78abf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4", "size": 12288, "upload_time": "2019-01-12T00:11:55", "url": "https://files.pythonhosted.org/packages/12/de/d998bacb622b5d2c576c0857da13a503198a596c49a8ddebb3ef28b2eb02/pystalk-0.5.1.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "0855aa2ec735282949145d900f276550", "sha256": "811c8f930521d334e7718df130e89a4969fae5c86efdfc61cca668185ca78142" }, "downloads": -1, "filename": "pystalk-0.6.0-py2-none-any.whl", "has_sig": false, "md5_digest": "0855aa2ec735282949145d900f276550", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12286, "upload_time": "2019-10-02T23:31:12", "url": "https://files.pythonhosted.org/packages/8b/42/893be8c8f8dd5b840f0982ea487b00e5892d2293fa841a8e17bbc229de89/pystalk-0.6.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42a383e0cc92e1bc012b0cfbe641be84", "sha256": "521686920d06f99dbac3fc414f4562c15a4f4e87f457195c9352739fd90d2562" }, "downloads": -1, "filename": "pystalk-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "42a383e0cc92e1bc012b0cfbe641be84", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12938, "upload_time": "2019-10-02T23:31:14", "url": "https://files.pythonhosted.org/packages/22/2a/495a3ae7e9eddce390aff6d244afad61d193ced032fce5a2bc962b21e135/pystalk-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ab53ca83c85bea699d21275c12b346c", "sha256": "8096e4c78ed401d8f6a4859da0012f2030e2c16db2704c00410584d511c94010" }, "downloads": -1, "filename": "pystalk-0.6.0.tar.gz", "has_sig": false, "md5_digest": "9ab53ca83c85bea699d21275c12b346c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12428, "upload_time": "2019-10-02T23:31:16", "url": "https://files.pythonhosted.org/packages/65/c5/2bec62a1eab0e8bc7f5c797bfac5943161a1c4b8c17718cbd545bb8a617f/pystalk-0.6.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0855aa2ec735282949145d900f276550", "sha256": "811c8f930521d334e7718df130e89a4969fae5c86efdfc61cca668185ca78142" }, "downloads": -1, "filename": "pystalk-0.6.0-py2-none-any.whl", "has_sig": false, "md5_digest": "0855aa2ec735282949145d900f276550", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12286, "upload_time": "2019-10-02T23:31:12", "url": "https://files.pythonhosted.org/packages/8b/42/893be8c8f8dd5b840f0982ea487b00e5892d2293fa841a8e17bbc229de89/pystalk-0.6.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42a383e0cc92e1bc012b0cfbe641be84", "sha256": "521686920d06f99dbac3fc414f4562c15a4f4e87f457195c9352739fd90d2562" }, "downloads": -1, "filename": "pystalk-0.6.0-py3-none-any.whl", "has_sig": false, "md5_digest": "42a383e0cc92e1bc012b0cfbe641be84", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12938, "upload_time": "2019-10-02T23:31:14", "url": "https://files.pythonhosted.org/packages/22/2a/495a3ae7e9eddce390aff6d244afad61d193ced032fce5a2bc962b21e135/pystalk-0.6.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9ab53ca83c85bea699d21275c12b346c", "sha256": "8096e4c78ed401d8f6a4859da0012f2030e2c16db2704c00410584d511c94010" }, "downloads": -1, "filename": "pystalk-0.6.0.tar.gz", "has_sig": false, "md5_digest": "9ab53ca83c85bea699d21275c12b346c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4", "size": 12428, "upload_time": "2019-10-02T23:31:16", "url": "https://files.pythonhosted.org/packages/65/c5/2bec62a1eab0e8bc7f5c797bfac5943161a1c4b8c17718cbd545bb8a617f/pystalk-0.6.0.tar.gz" } ] }