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.1.0.tar.gz (24.7 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.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: z4j_celerybeat-1.1.0.tar.gz
  • Upload date:
  • Size: 24.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 064158c3498bf63b4142e549250e623647b451b21c178f554472d7d4baf99cfb
MD5 615e72d6aa32d3ff5d12e72fcf7a3cbe
BLAKE2b-256 7d53b57d952d689e29078ca5d51b635c0035e1d577f3cd4a8b56727c7f9ee6b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: z4j_celerybeat-1.1.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2184dce25c14ce06839c45ff0bc8a5ae4dfd8cb967d1301996e7812eb1b0ddc7
MD5 e7efdc6de6b7834b56719c71d6533022
BLAKE2b-256 ae5f0687cd021ae8e76d8a255ee4bbb57ae7032315a2127d9045a58b6f61e4ca

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