Skip to main content

Engine-agnostic dynamic scheduler for the z4j stack (Apache 2.0)

Project description

z4j-scheduler

PyPI version Python License

The engine-agnostic dynamic scheduler for z4j.

One service drives Celery, RQ, Dramatiq, Huey, arq, and TaskIQ from a single dashboard. Schedules live in z4j's database, you edit them live without restarting anything, every change is recorded in an HMAC-chained audit log, and importers + exporters keep the door open in either direction. This is the canonical scheduler when you want one place to manage cron / interval / one-shot / solar schedules across mixed engines.

Compatibility

Python 3.11+. PostgreSQL 17+ for shared-database HA (SQLite supported for single-node deployments). Fans out to whichever engines you install on the same host (Celery, RQ, Dramatiq, Huey, arq, TaskIQ); each engine extra carries its own upstream version floor.

Full per-adapter matrix at https://z4j.dev/reference/compatibility/.

What makes z4j-scheduler different

z4j-scheduler is a deliberate alternative to in-language schedulers like celery-beat, rq-scheduler, and APScheduler. The differences that matter day to day:

  • Engine-agnostic. One scheduler service for every supported Python task engine. A project running Celery for legacy services and arq for a FastAPI rewrite uses the same scheduler for both, with one dashboard and one audit trail.
  • Live editing. Schedules live in z4j's Postgres database. Create, edit, pause, resume, rename, and delete from the dashboard or REST API without a daemon restart. celery-beat needs a beat-process restart for static-config edits, rq-scheduler stores schedules in Redis but has no editing UI, APScheduler edits are in-process.
  • HMAC-chained audit log. Every schedule mutation (who, what, when, from which IP) is recorded in a tamper-evident audit chain alongside the brain's other audit rows. celery-beat keeps no record. django-celery-beat keeps a partial record only if you wired up django-auditlog.
  • HA-ready. Multiple scheduler instances can run against the same Postgres database. Postgres advisory locks elect one leader to tick; followers stay warm. Rolling restarts and leader failovers are seconds, not minutes, with no missed-fire window beyond the per-schedule catch-up policy.
  • Reversible by design. Importers cover celery-beat (static and django-celery-beat), rq-scheduler, APScheduler jobstores, Huey @periodic_task, arq cron, taskiq schedule sources, and system crontab. Exporters write any schedule back to those same formats. Round-trip integrity is pinned by tests so you can leave whenever you want; the schedule definitions are yours, not ours.

What it ships

Capability Notes
Schedule kinds cron, interval, one-shot, solar (sunrise / sunset / dawn / dusk / noon / midnight at a given lat / lon)
Live editing dashboard, REST API, declarative config; no restart required
Engine fan-out Celery, RQ, Dramatiq, Huey, arq, TaskIQ
Importers celery / django-celery-beat / rq-scheduler / apscheduler / huey-periodic / arq-cron / taskiq-scheduler / cron
Exporters every native format above; round-trip integrity tested
HA leader election Postgres advisory lock, followers stay warm
Audit log every mutation HMAC-chained, tamper-evident
Catch-up policy per-schedule: skip, fire one missed, fire all missed
Timezones IANA zones validated at the boundary; DST fall-back fold fixed (no double-fires); spring-forward gap handled
Trigger surface brain dispatches trigger_now over a private gRPC channel so the scheduler's last-fire cache stays consistent

Install

Standalone (recommended for production):

pip install z4j-scheduler
z4j-scheduler serve

Embedded inside z4j (recommended for homelab and small teams):

pip install 'z4j[scheduler-embedded]'
# enable in brain settings: Z4J_EMBEDDED_SCHEDULER=true

Migrate existing schedules in:

pip install 'z4j-scheduler[celery-import]'
z4j-scheduler import \
  --from celery \
  --celery-app myapp.celery:app \
  --project myproject \
  --brain-url https://brain.example.com \
  --api-token "$Z4J_SCHEDULER_BRAIN_API_TOKEN"

The other importer subcommands follow the same shape (--from rq, --from apscheduler, --from django-celery-beat, etc.). All run in --dry-run mode by default; you review the diff before any write.

When to choose z4j-scheduler

You probably want it if:

  • You run more than one Python task engine and want one schedule surface across all of them.
  • An auditor or a security review asks who paused the nightly billing job last Tuesday and you don't have a clean answer.
  • You're tired of restarting celery-beat to change a cron expression.
  • You want HA scheduling without standing up a second control plane.
  • You're considering a one-time migration from celery-beat / rq-scheduler / APScheduler and want a reversible path.

You probably don't need it if:

  • You run a single engine (typically Celery), have no compliance pressure, and the in-language scheduler already meets your needs. Stay where you are; we ship z4j-celerybeat / z4j-rqscheduler / z4j-apscheduler as observation-only adapters that surface those schedules in the z4j dashboard without taking ownership.

Documentation

Full docs at z4j.dev/scheduler/. The migration guide at z4j.dev/scheduler/migrating-from-celery-beat/ walks the importer + dashboard verification path step by step.

License

Apache-2.0, see LICENSE. Importing z4j-scheduler does not affect your application's licensing. z4j (server + dashboard + API) is AGPL v3, isolated in its own process; the scheduler is separate.

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_scheduler-1.6.7.tar.gz (151.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_scheduler-1.6.7-py3-none-any.whl (190.4 kB view details)

Uploaded Python 3

File details

Details for the file z4j_scheduler-1.6.7.tar.gz.

File metadata

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

File hashes

Hashes for z4j_scheduler-1.6.7.tar.gz
Algorithm Hash digest
SHA256 c08293685e88a6c00ef877ac0b3b01608724fb071c52ba23ff40da4f7b9c83a9
MD5 72e3b574fa8f703d17705e9345b83575
BLAKE2b-256 0dbe02ab899e3ab4c720d7315b81dbce1e2d421eb1f4a10b18f7af2ad27f7f91

See more details on using hashes here.

File details

Details for the file z4j_scheduler-1.6.7-py3-none-any.whl.

File metadata

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

File hashes

Hashes for z4j_scheduler-1.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4a69c19e891c1f0e7d84ca16d2456558e488eadfbc084c00848dd9fb767e940f
MD5 6c9e446d2a3036c89bb6c9acdd6aab88
BLAKE2b-256 50a44c4280ac0689fbef548ab03d77ef160baba12d440d49b50100fb97747b34

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