{"id":21189296,"url":"https://github.com/uptick/bronski","last_synced_at":"2025-07-10T02:31:40.243Z","repository":{"id":57416412,"uuid":"244247138","full_name":"uptick/bronski","owner":"uptick","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-06T04:14:01.000Z","size":52,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-08T15:39:35.248Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uptick.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-02T00:33:29.000Z","updated_at":"2024-08-08T15:39:35.249Z","dependencies_parsed_at":"2022-09-16T08:52:00.808Z","dependency_job_id":null,"html_url":"https://github.com/uptick/bronski","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fbronski","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fbronski/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fbronski/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptick%2Fbronski/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uptick","download_url":"https://codeload.github.com/uptick/bronski/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225615295,"owners_count":17496941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T18:51:39.048Z","updated_at":"2024-11-20T18:51:39.815Z","avatar_url":"https://github.com/uptick.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=======\nBronski\n=======\n\n.. image:: https://badge.fury.io/py/bronski.svg\n    :target: https://pypi.org/project/bronski\n    \n.. image:: https://img.shields.io/pypi/pyversions/bronski.svg\n    :target: https://pypi.org/project/bronski\n    \n.. image:: https://github.com/uptick/bronski/workflows/Test/badge.svg\n    :target: https://github.com/uptick/bronski/actions?query=workflow%3ATest\n\n.. rubric:: A beat server for Django, with cron-like syntax\n\nBronski allows you to configure periodic function calls using a Django model.\n\nIt is ideally suited to being a task \"beat\" sever, akin to celery-beat.\n\nInstall\n-------\n\n.. code-block:: sh\n\n    $ pip install bronski\n\n\nSetup\n-----\n\n1. Add 'bronski' to your ``INSTALLED_APPS``\n\n   This is only needed to enable the management command.\n\n2. Create a model in your own app that inherits from ``bronski.models.CrontabBase``\n\n3. Create and apply migrations:\n\n   .. code-block:: sh\n\n    $ manage.py makemigrations\n    $ manage.py migrate\n\n4. Specify your model in settings\n\n   .. code-block:: python\n\n    CRONTAB_MODEL = \"myapp.MyCronModel\"\n\n5. Launch your beat server:\n\n   .. code-block:: sh\n\n    $ ./manage.py bronski\n\nEach minute the ``bronski`` service will scan the model for enabled jobs that\nhaven't been run in the past 59 seconds. It will then check each to see if its\ncrontab definition matches the next minute.\n\nFor job records that match, their ``run`` method will be called. The default\n``run`` method will:\n\n- get the specified function by calling ``self.get_function()``\n- resolve the ``kwargs`` to use by calling ``self.get_kwargs()``\n- invoke the function with the ``kwargs``.\n\nYou can override ``run`` in your custom model to, for instance, enqueue jobs:\n\n.. code-block:: python\n\n    class Jobs(CrontabBase):\n\n        def run(self):\n            func = self.get_function()\n            kwargs = self.get_kwargs()\n\n            # Celery task API:\n            func.delay(**kwargs)\n            # Dramatiq actor API:\n            func.send(**kwargs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptick%2Fbronski","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuptick%2Fbronski","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptick%2Fbronski/lists"}