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

Uploaded Python 3

File details

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

File metadata

  • Download URL: z4j_celerybeat-1.0.2.tar.gz
  • Upload date:
  • Size: 24.9 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.0.2.tar.gz
Algorithm Hash digest
SHA256 bb9769b63114d3f8f9412cd01d435b73813089954055261c06681aa9cbd5de38
MD5 2cb17ee58d99aff9905d447d328ae57a
BLAKE2b-256 8fa4a2352c11bf1703604befb862fd23482fe896c75cd17116037b5382e860f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: z4j_celerybeat-1.0.2-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.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43fb20cbcf05a627b626d47833a80e860d69cc347311cb7a9da74d7d6bce2179
MD5 7d24d1abfd4613beabf222e5e632034c
BLAKE2b-256 237be4d2cff125b25d5b4dd62a0ac0b874f3b5e4b5fe5f44c0476c8e08a678d9

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