{ "info": { "author": "Andrea Capitanelli", "author_email": "andrea.capitanelli@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Topic :: System" ], "description": "\n# Drummer\n\nDrummer is a python multi-process and multi-task job scheduler for Linux, best served as a systemd service. You can create jobs with your own tasks, and you can decide the execution flow depending on the outcome of each task.\n\nFor instance: if task A succeeds, then execute task B; if it fails, then execute task C. And, no matter the result of A, always do execute also task D.\n\nDrummer is heavily insipired by [Comodojo Extender](https://github.com/comodojo): I wish therefore to acknowledge its author.\n\n\n### Quick start\n\nInstallation is quick and easy.\n\n> \\> pip install drummer\n\nSpecify a folder where to init Drummer environment and, optionally, a filename for the internal database.\n\n> \\> drummer-admin init BASE_FOLDER [--database database_file]\n\nDuring the initialization, Drummer will ask whether it should create also the related Linux systemd service file (this is the recommended choice). It will ask also which python executable to use, should you use a Virtualenv installation.\n\nNow you are *almost* ready to start.\n\n\n### How Drummer works\n\nDrummer machinery is composed of three processes:\n1. a scheduler process, built on top of [sched module](https://docs.python.org/3/library/sched.html \"Python Event Scheduler\")\n2. a socket listener, to handle requests and responses with the Drummer cli\n3. a main process, which puts together all pieces and takes care of the overall behaviour\n\nIn order to ensure the multi-tasking capability, each task is run by a separate process.\n\nWhen you create a new environment for Drummer, you will notice several files and folders being created:\n- the **config** folder, for configuration and task file and, if you chose so, the systemd file;\n- a **database** folder, which contains the internal sqlite database with schedules;\n- a **tasks** folder, for placing your tasks;\n- the CLI launcher, **drummer-cli.py**.\n\n\n### Configuration\n\nConfiguration is stored in file *drummer-config.yml*.\n\nAmong all, you can specify where to store the log file and the database, which folder to use for your tasks (by default, Drummer looks for them inside the **tasks** folder), how many task can be runned at the same time, and so on.\n\n\n### Tasks\n\nTo be well formed, user-defined tasks should respect few basic requirements, i.e. they:\n- extend the **Task** class provided by **drummer** module\n- implement a **run** method as execution entry point\n- use the **Response** class, along with a valid **StatusCode**, for handling the task outcome (valid **StatusCode** attributes are: \"STATUS_OK\", \"STATUS_WARNING\", \"STATUS_ERROR\")\n\nA fully working example:\n\n```\nfrom drummer import Task, Response, StatusCode\n\nclass MyTask(Task):\n\n def run(self, params):\n\n # the Drummer logger, built on top of python logging facility\n logger = self.logger\n\n logger.info('Starting MyTask')\n\n response = Response()\n\n try:\n\n with open('mytask.txt', 'w') as f:\n f.write('Hello world!')\n\n logger.info('File has been updated')\n\n response.set_status(StatusCode.STATUS_OK)\n response.set_data({'result': 'Task ended OK'})\n\n except:\n\n response.set_status(StatusCode.STATUS_ERROR)\n response.set_data({'result': 'Task had an error'})\n\n finally:\n\n return response\n```\n\nThe *run* method takes a dictionary with optional task arguments. It is empty if no arguments are specified.\n\nTo complete the registration process, you have to declare the task, along with its path, inside *drummer-tasks.yml*. Drummer must know the path of python file to load (expressed as relative path with respect to base folder), and the name of the class which exposed the *run* method.\n\nYou can automatically update the task list with the **task:update** command. Drummer will parse all valid tasks found inside the *taskdir* folder.\n\nOf course you can also *__init__* your task class; in that case, you must take care of configuration and logger, as in the following:\n\n```\nfrom drummer import Task\n\nclass MyTask(Task):\n\n def __init__(self, config, logger):\n\n # init Task class\n super().__init__(config, logger)\n\n # your init code here\n # ...\n\n```\n\n### cli\n\nYou can start Drummer in two ways: as a systemd service (via *systemctl* command) or with cli, by invoking the **service:start** command.\n\n> \\> python drummer-cli.py service:start\n\nThe cli provides commands to:\n- list all jobs and get info on a single job\n- add, remove, enable, disable, or immediately execute a schedule\n- list and execute single tasks\n- automatically register valid tasks\n- import and export the schedulation table\n\nFor details see:\n\n> \\> python drummer-cli.py -h\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/acapitanelli/drummer", "keywords": "scheduler extender multi-process multi-tasking", "license": "MIT", "maintainer": "Andrea Capitanelli", "maintainer_email": "andrea.capitanelli@gmail.com", "name": "drummer", "package_url": "https://pypi.org/project/drummer/", "platform": "", "project_url": "https://pypi.org/project/drummer/", "project_urls": { "Homepage": "https://github.com/acapitanelli/drummer" }, "release_url": "https://pypi.org/project/drummer/1.3.1/", "requires_dist": [ "PTable", "PyYAML", "SQLAlchemy", "clips", "croniter", "inquirer" ], "requires_python": ">=3.6.0", "summary": "A multi-process, multi-tasking job scheduler.", "version": "1.3.1", "yanked": false, "yanked_reason": null }, "last_serial": 6040323, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "85ed626565013899ea47eae48238f7c5", "sha256": "a5573a36bd09ba607d29043480e66c4b38da6a38418f012151235031090a829d" }, "downloads": -1, "filename": "drummer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "85ed626565013899ea47eae48238f7c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19663, "upload_time": "2018-12-28T14:06:24", "upload_time_iso_8601": "2018-12-28T14:06:24.135476Z", "url": "https://files.pythonhosted.org/packages/43/a4/c0ef9cee90dc3ac5d20a8924ad24bfcec30c4608ea963df9920fafee108f/drummer-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0b781def4c3d588b5e0a2ab00630d681", "sha256": "b9d3b3cf6ae6e3827dae4ab90c4616e95d5501deb008029362792e429a17c03e" }, "downloads": -1, "filename": "drummer-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0b781def4c3d588b5e0a2ab00630d681", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19788, "upload_time": "2018-12-31T11:13:14", "upload_time_iso_8601": "2018-12-31T11:13:14.777102Z", "url": "https://files.pythonhosted.org/packages/60/d3/fc08f59d76a8dcf2ef400061d58b99e007fe69f2cc24f36027427aff230e/drummer-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "df442501c0a20d2941161b7975826baf", "sha256": "e030cb12719fca8f7cccb1acf29e164b1d6c9ce0a0aa0337505323f0b37a5138" }, "downloads": -1, "filename": "drummer-1.0.2.tar.gz", "has_sig": false, "md5_digest": "df442501c0a20d2941161b7975826baf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19832, "upload_time": "2019-01-10T13:20:18", "upload_time_iso_8601": "2019-01-10T13:20:18.274329Z", "url": "https://files.pythonhosted.org/packages/07/eb/2134283392a1b84c584ae9a6c9ebeb1ee9bba325248163cb8d53fd61421d/drummer-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "9851f66d76e76d04640185707beb768f", "sha256": "756414445228f88b969f112622dde720b601ee02c2338b9539f506ad25e5c85b" }, "downloads": -1, "filename": "drummer-1.0.3.tar.gz", "has_sig": false, "md5_digest": "9851f66d76e76d04640185707beb768f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20147, "upload_time": "2019-02-26T13:15:38", "upload_time_iso_8601": "2019-02-26T13:15:38.347850Z", "url": "https://files.pythonhosted.org/packages/67/3e/cc72afa8d8d33e039b0bc451fd079d45420443e940d381220f3776902156/drummer-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "e286b034a2f016df09a4a18036706921", "sha256": "45bd5ba14ce4784b38a527e600aba6212777069ff72cd6f7130a050538af56fc" }, "downloads": -1, "filename": "drummer-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e286b034a2f016df09a4a18036706921", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 36315, "upload_time": "2019-04-08T12:49:36", "upload_time_iso_8601": "2019-04-08T12:49:36.609589Z", "url": "https://files.pythonhosted.org/packages/55/28/5f865b97f86bf0cc187fb99eda58eed7fc8d946702b5b3826d1581cc7e42/drummer-1.1.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "6ac8496a3be2a604011cefb1a78f2658", "sha256": "442ce4dfcb2029434da3bf87d7cd285ddf0dfb1581085afb9705b11faa648fd0" }, "downloads": -1, "filename": "drummer-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6ac8496a3be2a604011cefb1a78f2658", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20194, "upload_time": "2019-04-08T12:49:38", "upload_time_iso_8601": "2019-04-08T12:49:38.390003Z", "url": "https://files.pythonhosted.org/packages/c6/5f/b1660f783a57711db5edeab849a86f80e6209df86077059bb07f6d0f2b55/drummer-1.1.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "dbb7484e97d8bee473d686f2a650895e", "sha256": "7b9fe2730e967115ea6c4f9e08aa82e9efa2b20fc2143384d12d0dff0a9ed697" }, "downloads": -1, "filename": "drummer-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "dbb7484e97d8bee473d686f2a650895e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 33874, "upload_time": "2019-05-04T23:30:00", "upload_time_iso_8601": "2019-05-04T23:30:00.988701Z", "url": "https://files.pythonhosted.org/packages/e4/2b/210101d108e206f3168d2a8679147cb0350cd5e5c3b5104390fca67dfe28/drummer-1.1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "10a0892265c763a86e5b2acac0097b9b", "sha256": "2db6fa17755821340e014368b2037784af0b4617111c636cf248f58acdf0048d" }, "downloads": -1, "filename": "drummer-1.1.1.tar.gz", "has_sig": false, "md5_digest": "10a0892265c763a86e5b2acac0097b9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19933, "upload_time": "2019-05-04T23:30:02", "upload_time_iso_8601": "2019-05-04T23:30:02.640510Z", "url": "https://files.pythonhosted.org/packages/bd/73/6a8fa518c4122ce825f21092be791432092b99a425fc3919e6fd5cf50e9d/drummer-1.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "3da7337f773c2984e5dffb01ce1df780", "sha256": "2ede60314ca312e329079edbc752fce6604d89905bfc3ca463c5eeee41aaa7e6" }, "downloads": -1, "filename": "drummer-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "3da7337f773c2984e5dffb01ce1df780", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 35999, "upload_time": "2019-09-22T15:44:33", "upload_time_iso_8601": "2019-09-22T15:44:33.735501Z", "url": "https://files.pythonhosted.org/packages/e7/9e/496c1f40595c3e417439d7ecf56fd01b69f23aeeff7234540b1fc23927d1/drummer-1.2.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5963f15bbd745e266f0ef4d222e4f695", "sha256": "6d93b28bbd38f795cc806580267f0100aabf0160230c841d5a0ea12d798f6d3f" }, "downloads": -1, "filename": "drummer-1.2.0.tar.gz", "has_sig": false, "md5_digest": "5963f15bbd745e266f0ef4d222e4f695", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 21760, "upload_time": "2019-09-22T15:44:35", "upload_time_iso_8601": "2019-09-22T15:44:35.502782Z", "url": "https://files.pythonhosted.org/packages/68/04/e08e4941b90b8e79ac4d97a1a9ad2798a5adf761541913220c4db2fade74/drummer-1.2.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "d106b30f6ff80807511106200c3f430f", "sha256": "2c0432b0c3f1f4c5533f9de73ff1334181ced88582d18a9ba6bec6d393888d59" }, "downloads": -1, "filename": "drummer-1.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d106b30f6ff80807511106200c3f430f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 37392, "upload_time": "2019-10-20T14:43:51", "upload_time_iso_8601": "2019-10-20T14:43:51.158340Z", "url": "https://files.pythonhosted.org/packages/cb/0c/72591e47e232e8707d2c62f2dc5d003c91b0487d1b580074f149bb6f3f39/drummer-1.3.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "c3e7232d95fa33010262249caec0be18", "sha256": "66a66a0b014c667608695fe5ba44ab3ed521917c26d34b1a143fab83c6526bf7" }, "downloads": -1, "filename": "drummer-1.3.0.tar.gz", "has_sig": false, "md5_digest": "c3e7232d95fa33010262249caec0be18", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 24424, "upload_time": "2019-10-20T14:43:55", "upload_time_iso_8601": "2019-10-20T14:43:55.286762Z", "url": "https://files.pythonhosted.org/packages/ea/56/7afb08ba34d3b29d06583a706bb148a14a7fc25e4749f2d9c25455c0a0b2/drummer-1.3.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "70b470128cc87c7bcf255ec64b04dfc8", "sha256": "a018b7da018bcc27186a96cfd8103f9c39e992c7b28c0d61bbf7d464fec9a174" }, "downloads": -1, "filename": "drummer-1.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "70b470128cc87c7bcf255ec64b04dfc8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 37235, "upload_time": "2019-10-28T09:33:24", "upload_time_iso_8601": "2019-10-28T09:33:24.807582Z", "url": "https://files.pythonhosted.org/packages/73/74/90fd98aa3387c2442df3c8590d7e8d031abffd65f3415f590971e6e207ee/drummer-1.3.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "616fc5ddae7a7f534ca886c1d7f4e149", "sha256": "0edd87281af6a5a86878894ba70034821e82bef19171563008485c577707e870" }, "downloads": -1, "filename": "drummer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "616fc5ddae7a7f534ca886c1d7f4e149", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 22196, "upload_time": "2019-10-28T09:33:26", "upload_time_iso_8601": "2019-10-28T09:33:26.617691Z", "url": "https://files.pythonhosted.org/packages/2f/22/642f0d6b8b9a46f68897fe28f905ff051d13414f8936a29ce40850fc031c/drummer-1.3.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70b470128cc87c7bcf255ec64b04dfc8", "sha256": "a018b7da018bcc27186a96cfd8103f9c39e992c7b28c0d61bbf7d464fec9a174" }, "downloads": -1, "filename": "drummer-1.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "70b470128cc87c7bcf255ec64b04dfc8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 37235, "upload_time": "2019-10-28T09:33:24", "upload_time_iso_8601": "2019-10-28T09:33:24.807582Z", "url": "https://files.pythonhosted.org/packages/73/74/90fd98aa3387c2442df3c8590d7e8d031abffd65f3415f590971e6e207ee/drummer-1.3.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "616fc5ddae7a7f534ca886c1d7f4e149", "sha256": "0edd87281af6a5a86878894ba70034821e82bef19171563008485c577707e870" }, "downloads": -1, "filename": "drummer-1.3.1.tar.gz", "has_sig": false, "md5_digest": "616fc5ddae7a7f534ca886c1d7f4e149", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 22196, "upload_time": "2019-10-28T09:33:26", "upload_time_iso_8601": "2019-10-28T09:33:26.617691Z", "url": "https://files.pythonhosted.org/packages/2f/22/642f0d6b8b9a46f68897fe28f905ff051d13414f8936a29ce40850fc031c/drummer-1.3.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }