{ "info": { "author": "Rob deCarvalho", "author_email": "unlisted@unlisted.net", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# Crontabs\nCrontabs is a small library that makes it simple to schedule python functions to run on a schedule.\nCrontabs was inspired by the excellent [schedule](https://github.com/dbader/schedule) library for python,\n\nIn addition to having a slightly different API, Crontabs differs from the schedule module in the following\nways.\n\n * You do not need to provide your own event loop.\n * Job timing is guarenteed not to drift over time. For example, if you specify to run a job every five minutes,\n you can rest assured that it will always run at 5, 10, 15, etc. passed the hour with no drift.\n * The python functions are all run in child processes. Not only does this enable asynchronous scheduling,\n it also helps mitigate python memory problems due to the\n [high watermark issue](https://hbfs.wordpress.com/2013/01/08/python-memory-management-part-ii/)\n\n\n# Installation\n```bash\npip install crontabs\n```\n# Usage\n\n### Schedule a single job\n```python\nfrom crontabs import Cron, Tab\nfrom datetime import datetime\n\n\ndef my_job(*args, **kwargs):\n print('args={} kwargs={} running at {}'.format(args, kwargs, datetime.now()))\n\n\n# Will run with a 5 minute interval synced to the top of the minute\nCron().schedule(\n Tab(name='run_my_job').every(seconds=5).run(my_job, 'my_arg', my_kwarg='hello')\n).go()\n\n```\n\n### Schedule multiple jobs\n```python\nfrom crontabs import Cron, Tab\nfrom datetime import datetime\n\n\ndef my_job(*args, **kwargs):\n print('args={} kwargs={} running at {}'.format(args, kwargs, datetime.now()))\n\n\n# All logging messages are sent to sdtout\nCron().schedule(\n # Turn of logging for job that runs every five seconds\n Tab(name='my_fast_job', verbose=False).every(seconds=5).run(my_job, 'fast', seconds=5),\n\n # Go ahead and let this job emit logging messages\n Tab(name='my_slow_job').every(seconds=20).run(my_job, 'slow', seconds=20),\n).go()\n\n```\n\n### Schedule future job to run repeatedly for a fixed amount of time\n```python\nfrom crontabs import Cron, Tab\nfrom datetime import datetime\n\n\ndef my_job(*args, **kwargs):\n print('args={} kwargs={} running at {}'.format(args, kwargs, datetime.now()))\n\n\nCron().schedule(\n Tab(\n name='future_job'\n ).every(\n seconds=5\n ).starting_at(\n '12/27/2017 16:45' # This argument can either be parsable text or datetime object.\n ).run(\n my_job, 'fast', seconds=5\n )\n# max_seconds starts from the moment go is called. Pad for future run times accordingly.\n).go(max_seconds=60)\n```\n\n# Run test suite with\n```bash\ngit clone git@github.com:robdmc/crontabs.git\ncd crontabs\npip install -e .[dev]\npy.test -s --cov -n 8\n```\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/robdmc/crontabs", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "crontabs", "package_url": "https://pypi.org/project/crontabs/", "platform": "", "project_url": "https://pypi.org/project/crontabs/", "project_urls": { "Homepage": "https://github.com/robdmc/crontabs" }, "release_url": "https://pypi.org/project/crontabs/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.1.4" }, "last_serial": 3454392, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "94c2a48663819f568baf8d2924b42f38", "sha256": "d419821322b4fa09aef6cb74feb352574b5e8bd1053b3874fe69fef893e85454" }, "downloads": -1, "filename": "crontabs-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "94c2a48663819f568baf8d2924b42f38", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9787, "upload_time": "2017-12-27T22:06:04", "url": "https://files.pythonhosted.org/packages/4a/7d/881719392bb453dc224d162f4acf1dbce10f061c45749bc6802eeeef26ba/crontabs-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b5b11ca1b78cc6d31320636a64950193", "sha256": "d589db633291cbab7ba94850b6608535cfec394621ce6553dfa0f67eb0e9a56c" }, "downloads": -1, "filename": "crontabs-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b5b11ca1b78cc6d31320636a64950193", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6750, "upload_time": "2017-12-27T22:06:02", "url": "https://files.pythonhosted.org/packages/7b/e7/dc3b7f8913b95d2dc4e49cfadea24b326d38592e79a72d9b518a757cb7cb/crontabs-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5b74a570a1a0b035ebf6a7573ed41c83", "sha256": "12475fae8314ba518c861356e65e38bc3fa6796e0743b4ee84cf2f710d99dc96" }, "downloads": -1, "filename": "crontabs-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5b74a570a1a0b035ebf6a7573ed41c83", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9866, "upload_time": "2017-12-27T22:18:52", "url": "https://files.pythonhosted.org/packages/36/f8/f32ab9e2f984778956b308b68933afddd0e7060a69b00af5e8ff0fa19d37/crontabs-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6c417592e18a186efc0a123c145c53a1", "sha256": "f5f5b1c917e4f6989c1458d1c21f62acf0e59c4aa625215f00f7673712db5794" }, "downloads": -1, "filename": "crontabs-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6c417592e18a186efc0a123c145c53a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6690, "upload_time": "2017-12-27T22:18:51", "url": "https://files.pythonhosted.org/packages/3b/69/ea621a0839c9ab418ff13463c9f298e7bae2b4dc286329381fb6d528b27a/crontabs-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "f716e0aaf6e68823ea30a695704d8993", "sha256": "bc50c9e06010c40139ea0d8e5a44c297ca93a810bc7c6bff5c3ee19abdd928ed" }, "downloads": -1, "filename": "crontabs-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f716e0aaf6e68823ea30a695704d8993", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9907, "upload_time": "2017-12-28T00:57:57", "url": "https://files.pythonhosted.org/packages/e3/46/92329b4f3c2f50050a7334167dbf1ca9ee10299f1c5f0ca52cf09cd1de6c/crontabs-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "75dfdcc5057f6986387875cb23f02821", "sha256": "0b5eccf12fb17ee632fe99fba49bf47a0ab37289fbdbd879490aca4bc5f3456e" }, "downloads": -1, "filename": "crontabs-0.1.3.tar.gz", "has_sig": false, "md5_digest": "75dfdcc5057f6986387875cb23f02821", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6719, "upload_time": "2017-12-28T00:57:56", "url": "https://files.pythonhosted.org/packages/0b/2b/ffc309f2f50e564a8c64d3655e69bf91fd6bf35a0ac5a75f91b327082272/crontabs-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "25e5f652b39b1ed89172a2788dbe7b01", "sha256": "47a735eebf5753fe27094b604ec3cda520298efca8ee4d0366c2b7448ad48c9d" }, "downloads": -1, "filename": "crontabs-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "25e5f652b39b1ed89172a2788dbe7b01", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10549, "upload_time": "2018-01-01T13:03:05", "url": "https://files.pythonhosted.org/packages/1e/1c/cb457b4dbebb2329e4304e3e65aaed6174f157aeaf103fa779730cea9483/crontabs-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eefc0a8ee56e5749c7f2fb00712f4229", "sha256": "f02473e8c7aad0fd58ae7a98a2a0f38a3d497efeb3d643935c190b9764448f9c" }, "downloads": -1, "filename": "crontabs-0.1.4.tar.gz", "has_sig": false, "md5_digest": "eefc0a8ee56e5749c7f2fb00712f4229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7186, "upload_time": "2018-01-01T13:03:03", "url": "https://files.pythonhosted.org/packages/61/07/4dc19eaec33f5dc3fd047ada47f93ed1c62f1441a214231cb65a17940744/crontabs-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "25e5f652b39b1ed89172a2788dbe7b01", "sha256": "47a735eebf5753fe27094b604ec3cda520298efca8ee4d0366c2b7448ad48c9d" }, "downloads": -1, "filename": "crontabs-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "25e5f652b39b1ed89172a2788dbe7b01", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10549, "upload_time": "2018-01-01T13:03:05", "url": "https://files.pythonhosted.org/packages/1e/1c/cb457b4dbebb2329e4304e3e65aaed6174f157aeaf103fa779730cea9483/crontabs-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "eefc0a8ee56e5749c7f2fb00712f4229", "sha256": "f02473e8c7aad0fd58ae7a98a2a0f38a3d497efeb3d643935c190b9764448f9c" }, "downloads": -1, "filename": "crontabs-0.1.4.tar.gz", "has_sig": false, "md5_digest": "eefc0a8ee56e5749c7f2fb00712f4229", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7186, "upload_time": "2018-01-01T13:03:03", "url": "https://files.pythonhosted.org/packages/61/07/4dc19eaec33f5dc3fd047ada47f93ed1c62f1441a214231cb65a17940744/crontabs-0.1.4.tar.gz" } ] }