{ "info": { "author": "Geoffrey LEHEE", "author_email": "hello@socketubs.org", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3" ], "description": "Carotte\n=======\n\nCarotte is a very lightweight Celery on zmq.\n\nInstall\n-------\n\n::\n\n pip install carotte\n\n\nGetting started\n---------------\n\nCreate your ``app.py``: ::\n\n from carotte import Carotte\n\n my_app = Carotte()\n\n @my_app.task\n def hello_world(name):\n return 'Hello %s!' % name\n\nRun your worker (default on \"tcp://127.0.0.1:5550\"): ::\n\n carotte worker --app app:my_app\n\nRun tasks: ::\n\n >>> from app import hello_world\n >>> t = hello_world.delay(['Carotte'])\n >>> t.success\n >>> True\n >>> t.result\n >>> 'Hello Carotte!'\n\nOr run a client (if don't have tasks on your system): ::\n\n >>> from carotte import Client\n >>> client = Client()\n >>> task = client.run_task('hello_world', ['Carotte'])\n >>> task.success\n >>> True\n >>> task.result\n >>> 'Hello Carotte!'\n\nScheduled tasks\n---------------\n\nCarotte is not a scheduler, its an asynchronous tasks runner.\nBut you can really set up scheduled tasks with schedule_.\n\nYour ``app.py``: ::\n\n import requests\n from carotte import Carotte\n\n my_app = Carotte()\n\n @app.task\n def get(url):\n r = requests.get(url)\n if r.status_code != 200:\n #\u00a0Do stuff\n return False\n return True\n\nYour ``scheduler.py``: ::\n\n import time\n import schedule\n from app import get\n\n schedule.every(10).seconds.do(get, 'http://google.com')\n\n while True:\n schedule.run_pending()\n time.sleep(1)\n\nRun your worker and your scheduler: ::\n\n carotte worker --app app:my_app\n python scheduler.py\n\n.. _schedule: https://github.com/dbader/schedule", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/socketubs/carotte", "keywords": "python zmq pyzmq celery task async", "license": "The MIT License (MIT)\n\nCopyright (c) 2014 Geoffrey LEHEE\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.", "maintainer": null, "maintainer_email": null, "name": "carotte", "package_url": "https://pypi.org/project/carotte/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/carotte/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/socketubs/carotte" }, "release_url": "https://pypi.org/project/carotte/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Carotte is a very lightweight Celery on zmq", "version": "0.2.1" }, "last_serial": 2246764, "releases": { "0.2.0": [], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1f818ee79fe15c5085d5c40a275e482b", "sha256": "c33e9890a2224fb336b0f697811226dd790cdb26b3fa345f401c595ff05c83e9" }, "downloads": -1, "filename": "carotte-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1f818ee79fe15c5085d5c40a275e482b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8227, "upload_time": "2016-07-27T12:03:33", "url": "https://files.pythonhosted.org/packages/d3/e3/e305249d1f0ac4007084e4750654ef90f7c0ab7a2a5f9d5025875e498dba/carotte-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f818ee79fe15c5085d5c40a275e482b", "sha256": "c33e9890a2224fb336b0f697811226dd790cdb26b3fa345f401c595ff05c83e9" }, "downloads": -1, "filename": "carotte-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1f818ee79fe15c5085d5c40a275e482b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8227, "upload_time": "2016-07-27T12:03:33", "url": "https://files.pythonhosted.org/packages/d3/e3/e305249d1f0ac4007084e4750654ef90f7c0ab7a2a5f9d5025875e498dba/carotte-0.2.1.tar.gz" } ] }