{ "info": { "author": "Thomas Huang", "author_email": "lyanghwy@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Chronos\n#########\n\nChronos is a mutil-thread/mutil-process task scheduler drive by Tornado IOLoop.\n\n\n.. contents::\n :depth: 4\n\n\nInstall\n==============\n\nInstall the extension with the following command::\n\n $ easy_install chronospy\n\nor alternatively if you have pip installed::\n\n\n $ pip install chronospy\n\n\nor clone it form github then run the command in shell:\n\n.. code-block:: bash\n\n cd chronos # the path to the project\n python setup.py install\n\n\n\nHello World\n=============\n\n\n.. code-block:: python\n\n\timport tornado\n\timport chronos\n\timport os\n\timport urllib2\n\n\n\tdef test_process():\n\t print(\"process pid %s\" % (os.getpid()))\n\n\n\tdef test(word):\n\t print(\"an other task, say '%s'\" % (word))\n\n\n\tdef say():\n\t response = urllib2.urlopen('https://www.google.com/')\n\t html = response.read()\n\t print(html[:10])\n\n\n\tdef init():\n\n\t # bind a ioloop or use default ioloop\n\t chronos.setup() # chronos.setup(tornado.ioloop.IOLoop())\n\t chronos.schedule('say', chronos.every_second(1), say)\n\t chronos.schedule('say2', chronos.every_second(1), test_process, once=True, process=True)\n\t chronos.schedule('say3', chronos.every_second(1), lambda: test(\"test3\"))\n\t chronos.start(True)\n\n\tif __name__ == '__main__':\n\n\t init()\n\n\nAPI\n============\n\nsetup\n-----------------------\nsetup(io_loop=None)\n\nbind a io_loop or use default ioloop.\n\n\nschedule\n--------------------------------------------------------------------------------------------\n\nschedule(name, timer, func, once=False, start=False, process=False, max_executor=5)\n\nadd task into chronos:\n\n\n:name: uniqe task name,\n:timer: every timer object\n:func: the task function\n:once: set True will run only once time.\n:start: when chronos start and schedule a new task, if set to True will add to Tornado IOLoop and schedule to run at time.\n:process: if process is True, then the job will run in on a procees, otherwise defaultly running in thread.\n:max_executor: the max threads(or processes) to run a task.\n\n\nremove_task\n------------------------------\n\nremove_task(task_name)\n\nstop and remove the task from chronos\n\n\n\nstart_task\n--------------------------\n\nstart_task(task_name)\n\nstart the task in chronos\n\n\nstop_task\n----------------------------\nstop_task(task_name)\n\nstop the task in chronos\n\nstart\n----------------------------\nstart(start_ioloop=False)\n\nadd tasks in ioloop, if you use chronos in a tornado web server, you can set start_ioloop to \"False\", then start your custom ioloop later.\n\n\nstop\n----------------------------------------------\nstop(stop_ioloop=False, clear=True)\n\nstop the task in ioloop\n\n:stop_ioloop: will stop the ioloop if set to \"True\".\n:clear: will remove tasks from chrons if set to \"True\".\n\nhow to use every tools\n==========================\n\nevery_second\n-----------------\n\n\nset eveny seconds to run a job:\n\n\tevery_second(5) # run job every 5 seconds\n\n\nevery_at\n----------------\n\n\nset every hourly or mintuely run a job::\n\n\tevery_at(hour=1, minute=10, second=0) # run at 01:10:00 every day\n\tevery_at(minute=10, second=0) # run at run at 10 mintue every hour\n\n\nevery\n-------------\n\n.. code-block:: python\n\n\tevery(10).minutes\n\tevery().hour\n\tevery().day.at(\"10:30\")\n\tevery().monday\n\tevery().wednesday.at(\"13:15\")\n\n\nLICENSE\n=======\n\n Copyright (C) 2015 Thomas Huang\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, version 2 of the License.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .", "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/whiteclover/chronos", "keywords": "schedule,periodic,jobs,scheduling,clockwork,cron", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "chronospy", "package_url": "https://pypi.org/project/chronospy/", "platform": "any", "project_url": "https://pypi.org/project/chronospy/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/whiteclover/chronos" }, "release_url": "https://pypi.org/project/chronospy/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "Mutil-thread/mutil-process task scheduler drive by Tornado IOLoop for human.", "version": "0.1.7" }, "last_serial": 2108568, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "970ecdb02abdda134f47edfb3002d42d", "sha256": "e17a7389e5d1f1f3f7280ae97ecedfdef69bda97150fe0729207ca09e6f08251" }, "downloads": -1, "filename": "chronospy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "970ecdb02abdda134f47edfb3002d42d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7573, "upload_time": "2015-07-26T05:38:44", "url": "https://files.pythonhosted.org/packages/d0/59/37303d23d084ea279ea9963cfb959750296fc012d775ed328311454c4242/chronospy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d2081efd3cb25bbb930acd067d5275d1", "sha256": "59129a4a7a38ccc3395c77a72ebeb6cb20d9f111f11c6db3f4cd893240afe50c" }, "downloads": -1, "filename": "chronospy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d2081efd3cb25bbb930acd067d5275d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7572, "upload_time": "2015-07-26T05:37:38", "url": "https://files.pythonhosted.org/packages/55/dd/542521e610644d6867bc78d0e420099eb3ed2dee667ed24801e2fff77186/chronospy-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "16b06d7a26697f0c47cc4b49a4a54463", "sha256": "a88c81ca9ebaeb5dd9f7a74274f27b2b33d096268baa7274cf9d5f5e5cc6fc70" }, "downloads": -1, "filename": "chronospy-0.1.1.zip", "has_sig": false, "md5_digest": "16b06d7a26697f0c47cc4b49a4a54463", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13149, "upload_time": "2015-07-26T05:24:54", "url": "https://files.pythonhosted.org/packages/f0/e4/deb433967975ff44ab2386553750a8f1c2958fa345f81283d569f42467b3/chronospy-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "20e90015d1b28c97b25f013ff9630fb8", "sha256": "7b7ade47b946240c742511e85edc1b25e74cc4316891b26b9d1696ad1fa9a354" }, "downloads": -1, "filename": "chronospy-0.1.2.tar.gz", "has_sig": false, "md5_digest": "20e90015d1b28c97b25f013ff9630fb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7570, "upload_time": "2015-07-26T05:48:26", "url": "https://files.pythonhosted.org/packages/fc/c1/1cdf74d9d5a90b472d97857c6b34f132000508e5fe32e3ab8390b7ef55ee/chronospy-0.1.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "a76bf2354dc93994caaffda39fd1b477", "sha256": "df31b9115ee051be5059f11333b86aa0551f90f9ca11a516d1b2d76dba25a437" }, "downloads": -1, "filename": "chronospy-0.1.2.zip", "has_sig": false, "md5_digest": "a76bf2354dc93994caaffda39fd1b477", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13158, "upload_time": "2015-07-26T05:48:22", "url": "https://files.pythonhosted.org/packages/c2/e9/ad5bdd9abc3db81bd10891b95e8205bcad67674b776da7a59164b1596115/chronospy-0.1.2.zip" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "9a9d6d6761fb53298fc64a9eca2cd4e3", "sha256": "04e690741581cad4e01c5e00d6574dd38f68045c48d2f49affbb1b38b1ce9cbd" }, "downloads": -1, "filename": "chronospy-0.1.3.tar.gz", "has_sig": false, "md5_digest": "9a9d6d6761fb53298fc64a9eca2cd4e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7693, "upload_time": "2015-07-26T07:24:29", "url": "https://files.pythonhosted.org/packages/8b/68/1d75db3517680e81e08021940de7175f5b839b71bc0160a736143d2c002a/chronospy-0.1.3.tar.gz" }, { "comment_text": "", "digests": { "md5": "6a635a99fed0d537928e4edacaab262c", "sha256": "f8fb04bdf3f31530a822d3144a045cbd2ecc6c9b78191e2e605ad9a931ed8986" }, "downloads": -1, "filename": "chronospy-0.1.3.zip", "has_sig": false, "md5_digest": "6a635a99fed0d537928e4edacaab262c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13382, "upload_time": "2015-07-26T07:24:32", "url": "https://files.pythonhosted.org/packages/01/77/4067bc58b92eed47062253bab91bfa7508c119a90c2be10dc18278f6ab38/chronospy-0.1.3.zip" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "d37654a26c339f69078c56710713839c", "sha256": "8eace82d7d5f31ae6b5e135c9bdcd7dd7b6844577929e24e10162b4042ee50b9" }, "downloads": -1, "filename": "chronospy-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d37654a26c339f69078c56710713839c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7946, "upload_time": "2015-07-27T13:51:03", "url": "https://files.pythonhosted.org/packages/d0/a1/e36fed78882d1ebc81bf4a5f02b28417d24182ba86c1222bed454291abc3/chronospy-0.1.4.tar.gz" }, { "comment_text": "", "digests": { "md5": "da5c27d89b1848179aab76812a393c4a", "sha256": "dd04ba7fd8e4dbfe34fdac26317e2cf04bf770ae7785bfef9717c73e90e00b72" }, "downloads": -1, "filename": "chronospy-0.1.4.zip", "has_sig": false, "md5_digest": "da5c27d89b1848179aab76812a393c4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13644, "upload_time": "2015-07-27T13:50:59", "url": "https://files.pythonhosted.org/packages/bd/72/5a83d884f25feffe0c36efe4b20bedc3fa8d162a59b5862033ae43c87157/chronospy-0.1.4.zip" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "96126703e6b06d1336b76a0fd3873f21", "sha256": "480c1510b06bafeca69fb945689edee55e817ee25ede57a7262f54372832c3f7" }, "downloads": -1, "filename": "chronospy-0.1.5.tar.gz", "has_sig": false, "md5_digest": "96126703e6b06d1336b76a0fd3873f21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7759, "upload_time": "2015-07-31T15:16:08", "url": "https://files.pythonhosted.org/packages/ba/06/8101fb09b6a8ea85468aca4e64d2c23044f1691e5a39c55a4aab196d3e7e/chronospy-0.1.5.tar.gz" }, { "comment_text": "", "digests": { "md5": "29fc7a2a83017b67a744d565326ff3ae", "sha256": "120a25759605c57f0b9371fcd44f276061b7829bfc47bd70a88d8097d00040fb" }, "downloads": -1, "filename": "chronospy-0.1.5.zip", "has_sig": false, "md5_digest": "29fc7a2a83017b67a744d565326ff3ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13167, "upload_time": "2015-07-31T15:16:04", "url": "https://files.pythonhosted.org/packages/72/33/a0768cc0a81048de7d3eb5ad8bc4edba1e9cb69ca8e099383aba5de7a7e3/chronospy-0.1.5.zip" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "073515bb0e60d4c6e58096c3b15ea41a", "sha256": "6189575db6f408c4892e0f760152e39e461d846d131565c62947b6fa15b00e6a" }, "downloads": -1, "filename": "chronospy-0.1.6-py2.7.egg", "has_sig": false, "md5_digest": "073515bb0e60d4c6e58096c3b15ea41a", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15089, "upload_time": "2016-04-10T03:59:04", "url": "https://files.pythonhosted.org/packages/a0/7f/25d8191d7bac690dab2403198fe9d54c9256e79f2bb1146299e07b043cc1/chronospy-0.1.6-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "c1f1a0e1824bdbe61654cdddab6f386f", "sha256": "44b6aefd3bc9b2bbc9ac9118c3ef50ff8b77366dcfed1222d7a1545f5477f9e2" }, "downloads": -1, "filename": "chronospy-0.1.6.tar.gz", "has_sig": false, "md5_digest": "c1f1a0e1824bdbe61654cdddab6f386f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7704, "upload_time": "2016-04-10T03:25:20", "url": "https://files.pythonhosted.org/packages/4b/b6/e9d90b5f791a6ac7e3565045e033cc13585ae0fcba169c67ce8fae7bf270/chronospy-0.1.6.tar.gz" }, { "comment_text": "", "digests": { "md5": "971851972a2b3cdb22085335997810a7", "sha256": "beb145b256bb6ee297a407ac37004f88bb3f71109187429a5142fa8808ad88f6" }, "downloads": -1, "filename": "chronospy-0.1.6.zip", "has_sig": false, "md5_digest": "971851972a2b3cdb22085335997810a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12950, "upload_time": "2016-04-10T03:25:15", "url": "https://files.pythonhosted.org/packages/e2/36/e496e440142566f86cf8ee8f6a199a26520f88a11bf231a2218a1dd13134/chronospy-0.1.6.zip" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "da961e0c98f6b659b7fd7718fa2f36fa", "sha256": "3ad8047fb7f01d3ed1baacebbe97babe085a7e159b7ff1b35b6a7a258a37b480" }, "downloads": -1, "filename": "chronospy-0.1.7.tar.gz", "has_sig": false, "md5_digest": "da961e0c98f6b659b7fd7718fa2f36fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8978, "upload_time": "2016-05-10T13:57:19", "url": "https://files.pythonhosted.org/packages/74/d8/8c9bf9b08c66ce6683baccd0b28a3114db8e69092c72b9f3c67ad223f692/chronospy-0.1.7.tar.gz" }, { "comment_text": "", "digests": { "md5": "05ea456b4ee43dd25c8b6421883fb7a0", "sha256": "db1732835abf2d118e75ef875470095ff149a1ec1c3392c79d83b9b232e86edf" }, "downloads": -1, "filename": "chronospy-0.1.7.zip", "has_sig": false, "md5_digest": "05ea456b4ee43dd25c8b6421883fb7a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14187, "upload_time": "2016-05-10T13:54:27", "url": "https://files.pythonhosted.org/packages/18/25/21fb6a63ffe3026773b33665a7fa80c35795eea525d8e3c2b21ef2d04ad6/chronospy-0.1.7.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "da961e0c98f6b659b7fd7718fa2f36fa", "sha256": "3ad8047fb7f01d3ed1baacebbe97babe085a7e159b7ff1b35b6a7a258a37b480" }, "downloads": -1, "filename": "chronospy-0.1.7.tar.gz", "has_sig": false, "md5_digest": "da961e0c98f6b659b7fd7718fa2f36fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8978, "upload_time": "2016-05-10T13:57:19", "url": "https://files.pythonhosted.org/packages/74/d8/8c9bf9b08c66ce6683baccd0b28a3114db8e69092c72b9f3c67ad223f692/chronospy-0.1.7.tar.gz" }, { "comment_text": "", "digests": { "md5": "05ea456b4ee43dd25c8b6421883fb7a0", "sha256": "db1732835abf2d118e75ef875470095ff149a1ec1c3392c79d83b9b232e86edf" }, "downloads": -1, "filename": "chronospy-0.1.7.zip", "has_sig": false, "md5_digest": "05ea456b4ee43dd25c8b6421883fb7a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14187, "upload_time": "2016-05-10T13:54:27", "url": "https://files.pythonhosted.org/packages/18/25/21fb6a63ffe3026773b33665a7fa80c35795eea525d8e3c2b21ef2d04ad6/chronospy-0.1.7.zip" } ] }