Skip to main content

z4j Celery-beat scheduler adapter (Apache 2.0)

Project description

z4j-celerybeat

PyPI version Python License

License: Apache 2.0 Status: v1.0.0 - first public release.

The Celery-Beat scheduler adapter for z4j. Surfaces periodic / crontab / one-shot schedules on the dashboard's Schedules page - read, create, update, enable, disable, trigger-now, delete.

Supports both of Celery's scheduling backends:

  • app.conf.beat_schedule (static config in Python)
  • django_celery_beat.models.PeriodicTask (database-backed, dynamic)

Install

pip install z4j-celery z4j-celerybeat

What it ships on day 1

Capability Status
List schedules
Read individual schedule by id
Create new schedule
Update (interval, crontab, args, kwargs, enabled flag)
Enable / disable
Trigger-now (fire the task immediately outside the schedule)
Delete
Live sync for django-celery-beat ✅ (via post_save signal on PeriodicTask)

Configure

With django-celery-beat (Django projects)

# settings.py
INSTALLED_APPS = [
    # ...
    "django_celery_beat",
    "z4j_django",
]
# The z4j-celerybeat adapter is auto-registered when django_celery_beat
# is on INSTALLED_APPS.

The Schedules page picks up every PeriodicTask row immediately. Edits flow both ways - dashboard changes are written through to the database, and changes written directly to the model surface via signals.

With static beat_schedule (non-Django or plain Celery)

# celery_app.py
from celery import Celery
from z4j_bare import install_agent
from z4j_celery import CeleryEngineAdapter
from z4j_celerybeat import CeleryBeatAdapter

app = Celery("myproject", broker="redis://localhost")
app.conf.beat_schedule = {
    "cleanup-every-5-minutes": {
        "task": "myapp.tasks.cleanup",
        "schedule": 300.0,
    },
}

install_agent(
    engines=[CeleryEngineAdapter(celery_app=app)],
    schedulers=[CeleryBeatAdapter(celery_app=app)],
    brain_url="https://z4j.internal",
    token="z4j_agent_...",
    project_id="my-project",
)

Static beat_schedule is read-only by design - you can view, enable, disable, and trigger-now, but create / update / delete are rejected because those changes would need to round-trip through a deploy. The dashboard hides buttons it can't honor.

Reliability

  • No exception from the adapter propagates to Celery Beat or Django request handlers.
  • post_save signal handlers for PeriodicTask are wrapped in a top- level try/except - even if the brain is unreachable, the database write is never affected.

Documentation

License

Apache 2.0 - see LICENSE.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z4j_celerybeat-1.3.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z4j_celerybeat-1.3.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file z4j_celerybeat-1.3.0.tar.gz.

File metadata

  • Download URL: z4j_celerybeat-1.3.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_celerybeat-1.3.0.tar.gz
Algorithm Hash digest
SHA256 9afd96414a0c0c81451411190ae81ffd9e738d98ef763dea6fcfc83a9ca58998
MD5 f7b65b2ad08cadbfd3fa1d53d81dddae
BLAKE2b-256 501203705121902075609456158561429b4b5325ed919d2191007f46900d23a7

See more details on using hashes here.

File details

Details for the file z4j_celerybeat-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: z4j_celerybeat-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_celerybeat-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7cecf11e3037930dfa4cfb52d58710a87c55c7de8eedbf012df24ce7b3e34b
MD5 30614ec5bc0ba2dfd8b49563f334aa97
BLAKE2b-256 6a6e88c5c3928b24381ab82fcf370fc051c5d30624b0511b189d8d71c879daaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page