{ "info": { "author": "Bruno Reni\u00e9", "author_email": "bruno@renie.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "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.2", "Programming Language :: Python :: 3.3" ], "description": "RACHE\n=====\n\n.. image:: https://travis-ci.org/brutasse/rache.png?branch=master\n :alt: Build Status\n :target: https://travis-ci.org/brutasse/rache\n\nA scheduler backed by `Redis`_ with a very simple interface.\n\n.. _Redis: http://redis.io/\n\nRACHE doesn't handle job execution. It only maintains a list of jobs and their\ntheoretical execution time. It's up to you to monitor pending jobs and send\nthem to an actual task queue.\n\nInstallation\n------------\n\nRACHE works with any Python version from 2.6 to 3.3. You only need a working\nRedis server.\n\n::\n\n pip install rache\n\nConfiguration\n-------------\n\nBy default RACHE connects to Redis on localhost, port 6379, database 0. To\noverride this, set a ``REDIS_URL`` environment variable::\n\n REDIS_URL=redis://redis.example.com:6379/2\n\nRACHE prefixes all its Redis keys with ``rache:``. You can override this by\nsetting the ``RACHE_REDIS_PREFIX`` environment variable.\n\nUsage\n-----\n\n::\n\n import rq\n\n from rache import schedule_job, pending_jobs\n\n # Schedule a job now\n schedule_job('http://github.com/brutasse/rache', schedule_in=0, timeout=10)\n\n # Get pending jobs\n jobs = pending_jobs()\n\n # Send them to the task queue for immediate execution\n for job in jobs:\n rq.enqueue_job(...)\n\n``schedule_job``\n````````````````\n\n::\n\n schedule_job('job id', schedule_in=, connection=None, **kwargs)\n\nA given job ID is unique from the scheduler perspective. Scheduling it twice\nresults in it being scheduled at the time decided in the last call.\n\n``**kwargs`` can be used to attach data to your jobs. For instance, if you\nhave jobs to fetch URLs and want to attach a timeout to these jobs::\n\n schedule_job('http://example.com/test', schedule_in=3600, timeout=10)\n\nThe job data is persistent. To remove a key from the data, call\n``schedule_job()`` with that key set to None::\n\n schedule_job('http://example.com/test', schedule_in=3600, timeout=None)\n\n``schedule_in`` is mandatory. This means you can't update an existing job\nwithout rescheduling it.\n\n``connection`` allows you to pass a custom Redis connection object. This is\nuseful if you have your own connection pooling and want to manage connections\nyourself.\n\n``pending_jobs``\n````````````````\n\n::\n\n jobs = pending_jobs(reschedule_in=None, limit=None, connection=None)\n\n(the returned value is a generator)\n\nFetches the pending jobs and returns a list of jobs. Each job is a dictionnary\nwith an ``id`` key and its additional data.\n\n``reschedule_in`` controls whether to auto-reschedule jobs in a given time.\nThis is useful if you have periodic jobs but also want to special-case some\njobs according to their results (``enqueue`` is `rq`_-style syntax)::\n\n jobs = pending_jobs(reschedule_in=3600)\n\n for job in jobs:\n enqueue(do_something, kwargs=job)\n\n def do_something(**kwargs):\n # \u2026 do some work\n\n if some_condition:\n # re-schedule in 30 days\n schedule_job(kwargs['id'], schedule_in=3600 * 24 * 30)\n\n.. _rq: http://python-rq.org/\n\n``limit`` allows you to limit the number of jobs returned. Remaining jobs are\nleft on schedule, even if they should have been scheduled right now.\n\n``connection`` allows you to pass a custom Redis connection object.\n\n``delete_job``\n``````````````\n\n::\n\n delete_job('', connection=None)\n\nRemoves a job completely from the scheduler.\n\n``connection`` allows you to pass a custom Redis connection object.\n\n``job_details``\n```````````````\n\n::\n\n job_details('', connection=None)\n\nReturns a dictionnary with the job data. The job ID and scheduled time are\nset in the ``id`` and ``schedule_at`` keys of the returned value.\n\n``connection`` allows you to pass a custom Redis connection object.\n\n``scheduled_jobs``\n``````````````````\n\n::\n\n scheduled_jobs(with_times=False, connection=None)\n\n(the returned value is a generator)\n\nFetches all the job IDs stored in the scheduler. This returns a list of IDs or\na list of ``(job_id, timestamp)`` tuples if ``with_times`` is set to ``True``.\n\nThis is useful for syncing jobs between the scheduler and a database, for\ninstance.\n\n``connection`` allows you to pass a custom Redis connection object.\n\nContributing\n------------\n\nCreate a local environment::\n\n virtualen env\n source env/bin/activate\n pip install -e .\n\nRun the tests::\n\n python setup.py test\n\nOr for all supported python versions::\n\n tox\n\nHack, fix bugs and submit pull requests!\n\nChangelog\n---------\n\n* **0.3.1** (2013-08-31):\n\n * Made ``pending_jobs`` work correctly with both ``Redis`` and\n ``StrictRedis`` clients.\n\n* **0.3** (2013-08-31):\n\n * Allow passing custom Redis connection objects for fine control on open\n connections.\n\n* **0.2.2** (2013-07-10):\n\n * Fixed a typo that lead to ``AttributeError`` when retrieving some jobs.\n\n* **0.2.1** (2013-07-03):\n\n * Allowed ``pending_jobs()`` to return non-unicode data if undecodable bytes\n are passed to ``schedule_job()``.\n\n* **0.2** (2013-06-02):\n\n * Added ``limit`` kwarg to ``pending_jobs()``.\n * Allowed ``schedule_in`` to be a timedelta alternatively to a number of\n seconds.\n * Added ``job_details()``.\n * Numerical data attached to jobs is cast to ``int()`` when returned.\n\n* **0.1** (2013-06-01):\n\n * Initial release", "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/brutasse/rache", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "rache", "package_url": "https://pypi.org/project/rache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rache/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/brutasse/rache" }, "release_url": "https://pypi.org/project/rache/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "A scheduler backed by Redis with a very simple interface", "version": "0.3.1" }, "last_serial": 976554, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "727de401792e2a5ffc75f228cff99fda", "sha256": "91820bbd00b4e8ed7b46b68c1e85d1092ab0c279bae85e6e368810e3cde9a852" }, "downloads": -1, "filename": "rache-0.1.tar.gz", "has_sig": false, "md5_digest": "727de401792e2a5ffc75f228cff99fda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5660, "upload_time": "2013-06-01T16:35:52", "url": "https://files.pythonhosted.org/packages/ce/23/5a8d66c013be633b52e3f8e4ee147fff9cef5824218161ed29661cea4916/rache-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "a79b1c9c5f38afcdabb9c5118eb3833d", "sha256": "325b0983ac3e11abed172173cbc6804809eaa4dd50c6827f03caf0d55a79f6e1" }, "downloads": -1, "filename": "rache-0.2.tar.gz", "has_sig": false, "md5_digest": "a79b1c9c5f38afcdabb9c5118eb3833d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6245, "upload_time": "2013-06-02T11:35:38", "url": "https://files.pythonhosted.org/packages/84/5a/8a1e8bafc3f6e6076ce01b68bb0b25ef05506522107159f87edcd1a16bd2/rache-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "c0a9f8b428f97bb27ccd9b64033fbc7d", "sha256": "d6a54c7af504eb53dcdf16d189b4867f433e0372092313c0ea2b25a78b3952e0" }, "downloads": -1, "filename": "rache-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c0a9f8b428f97bb27ccd9b64033fbc7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6405, "upload_time": "2013-07-03T13:40:56", "url": "https://files.pythonhosted.org/packages/d9/74/f920d1e59c727bd20cec56401c2b88e9d213c212a841d6f2a7a0234dc034/rache-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "464225f67e988a6975110dee90399459", "sha256": "b09aeb31c8cf89a4e13045da8c91f3b38baf8e202e390b6634ca52de9d2b6ca4" }, "downloads": -1, "filename": "rache-0.2.2.tar.gz", "has_sig": false, "md5_digest": "464225f67e988a6975110dee90399459", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6450, "upload_time": "2013-07-10T20:51:44", "url": "https://files.pythonhosted.org/packages/cc/93/af1fc684e388e484bff99849458a2ddd9898a9d0762f8d3596a3693f671a/rache-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "6966e8bb20f788f104b9b4976d29f18d", "sha256": "77e346c343c48e1db00c17e31daa5256882bbb48535ccaa8ef07607749f08d75" }, "downloads": -1, "filename": "rache-0.3.tar.gz", "has_sig": false, "md5_digest": "6966e8bb20f788f104b9b4976d29f18d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6740, "upload_time": "2013-08-31T14:31:32", "url": "https://files.pythonhosted.org/packages/0f/6f/73b266c1d43cba70ee82b3f1a92df82ded2982e4f437696fb1b35a9d2de8/rache-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "95086220b308a8dfd4e20ebb6d44403c", "sha256": "f60e2766f1003452cb4aef35cd8290c62e4395359f0e5902ce248829ef695bd5" }, "downloads": -1, "filename": "rache-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "95086220b308a8dfd4e20ebb6d44403c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8690, "upload_time": "2014-01-21T22:15:02", "url": "https://files.pythonhosted.org/packages/4f/8b/a11d19be74a4e2fb75963c0b98b8e1b6e155cc5dee839bf61b36159a9cf9/rache-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "55b1d6d612f0cbb723e42f53d954f6de", "sha256": "2cc51871831f48b68b459414957d5b4e6b6d6b85c79213bda4202b45e1db42bc" }, "downloads": -1, "filename": "rache-0.3.1.tar.gz", "has_sig": false, "md5_digest": "55b1d6d612f0cbb723e42f53d954f6de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6805, "upload_time": "2013-08-31T15:11:03", "url": "https://files.pythonhosted.org/packages/4a/77/b1cf8b556a8b630bc75606186d1fe7f567546560be2ff9d7abe43d3521b8/rache-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95086220b308a8dfd4e20ebb6d44403c", "sha256": "f60e2766f1003452cb4aef35cd8290c62e4395359f0e5902ce248829ef695bd5" }, "downloads": -1, "filename": "rache-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "95086220b308a8dfd4e20ebb6d44403c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8690, "upload_time": "2014-01-21T22:15:02", "url": "https://files.pythonhosted.org/packages/4f/8b/a11d19be74a4e2fb75963c0b98b8e1b6e155cc5dee839bf61b36159a9cf9/rache-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "55b1d6d612f0cbb723e42f53d954f6de", "sha256": "2cc51871831f48b68b459414957d5b4e6b6d6b85c79213bda4202b45e1db42bc" }, "downloads": -1, "filename": "rache-0.3.1.tar.gz", "has_sig": false, "md5_digest": "55b1d6d612f0cbb723e42f53d954f6de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6805, "upload_time": "2013-08-31T15:11:03", "url": "https://files.pythonhosted.org/packages/4a/77/b1cf8b556a8b630bc75606186d1fe7f567546560be2ff9d7abe43d3521b8/rache-0.3.1.tar.gz" } ] }