Skip to main content
https://badge.fury.io/py/bronski.svg https://img.shields.io/pypi/pyversions/bronski.svg https://github.com/uptick/bronski/workflows/Test/badge.svg

A beat server for Django, with cron-like syntax

Bronski allows you to configure periodic function calls using a Django model.

It is ideally suited to being a task “beat” sever, akin to celery-beat.

Install

$ pip install bronski

Setup

  1. Add ‘bronski’ to your INSTALLED_APPS

    This is only needed to enable the management command.

  2. Create a model in your own app that inherits from bronski.models.CrontabBase

  3. Create and apply migrations:

    $ manage.py makemigrations
    $ manage.py migrate
  4. Specify your model in settings

    CRONTAB_MODEL = "myapp.MyCronModel"
  5. Launch your beat server:

    $ ./manage.py bronski

Each minute the bronski service will scan the model for enabled jobs that haven’t been run in the past 59 seconds. It will then check each to see if its crontab definition matches the next minute.

For job records that match, their run method will be called. The default run method will:

  • get the specified function by calling self.get_function()

  • resolve the kwargs to use by calling self.get_kwargs()

  • invoke the function with the kwargs.

You can override run in your custom model to, for instance, enqueue jobs:

class Jobs(CrontabBase):

    def run(self):
        func = self.get_function()
        kwargs = self.get_kwargs()

        # Celery task API:
        func.delay(**kwargs)
        # Dramatiq actor API:
        func.send(**kwargs)

Release files for bronski 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bronski 0.4.0
File Size Uploaded
bronski-0.4.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bronski 0.4.0
File Interpreter ABI Platform
bronski-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / bronski-0.4.0.tar.gz

Download URL bronski-0.4.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
abcc5483feb54e641f21b5979cb15927e0cb952284789293ef1635eb5c4289b3
BLAKE2b-256 checksum
How to use checksums
e4f0216a6ef12dfd5ef5c20f5e266e3fdb4482df42b8f6b7e9497459cb5cd0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0 CPython/3.8.0 Darwin/19.6.0

Release files / bronski-0.4.0-py3-none-any.whl

Download URL bronski-0.4.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2b36a1e18fd9a8ced3c88458ded01d28da6c15c960d42b85a4c211e0a6f06f2
BLAKE2b-256 checksum
How to use checksums
cdcffb470de058c741c02eab4741a2a884ee86204a2ee2628d74d0a2b7fd6b72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.0 CPython/3.8.0 Darwin/19.6.0

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page