thehardwarestore.ai

where AI agents shop for the right tools

$ show celery/django-celery-beat

[account ↗] [repo ↗] APPLICATION ★ 1952 496 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

django-celery-beat is a Django library that provides a database-backed scheduler for Celery Beat, allowing periodic task schedules to be stored and managed in a Django database. It offers models for interval, crontab, solar, and clocked schedules, with a full Django admin interface for CRUD operations. The core scheduler (`DatabaseScheduler`) reads enabled periodic tasks from the database and manages their execution, with change detection via a dedicated `PeriodicTasks` model. The codebase is production-stable, well-tested, and actively maintained, supporting recent Django (6.1) and Python (3.14) versions.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS150
VELOCITY0.81
OPEN ISSUES154
CLOSED ISSUES366
LAST COMMIT1 month ago
Files by Type (count)
Python
50
reStructuredText
16
Text
10
Other (no ext)
7
YAML
7
Other (.mo)
7
Other (.po)
7
Dockerfile
3
Config
2
Makefile
2
HTML
2
Shell
2
Files by Type (size)
Python
211KB
Other (.po)
105KB
Other (.ico)
97KB
Other (.mo)
70KB
Other (.png)
25KB
Other (no ext)
18KB
reStructuredText
15KB
Makefile
11KB
Text
11KB
YAML
10KB
Other (.bat)
7KB
TOML
3KB

The LLM identified 4 files worth highlighting for reuse:

Implements `DatabaseScheduler` (a custom Celery Beat scheduler) and `ModelEntry` (schedule entry from DB rows). The scheduler reads enabled periodic tasks, detects changes via `PeriodicTasks.last_change()`, manages a heap of due times, and syncs state back to the database. The `ModelEntry` class handles schedule conversion (interval, crontab, solar, clocked) and due-date logic including start_time, one-off, and expiry. This is the core orchestration layer and is reusable in any project needing a dynamic DB-backed scheduler.

file: django_celery_beat/schedulers.py ↗ | tags: #database-backed-scheduler #change-detection #task-entry

Provides custom field validators for crontab fields (minute, hour, day_of_month, etc.) using a custom `_CronSlices` subclass that raises `ValidationError` on invalid cron expressions. The validators are reusable for any Django model with cron expression fields and demonstrate careful handling of edge cases (zero-padded hours, ranges, steps).

file: django_celery_beat/validators.py ↗ | tags: #cron-validation #custom-validators #CronSlices

Defines `TzAwareCrontab`, a subclass of Celery's `crontab` that respects a specific timezone for schedule calculation. It overrides `nowfunc` and `is_due` to convert `last_run_at` to the target timezone before computing due states. This is a clean, self-contained pattern for adding timezone support to any recurring schedule.

file: django_celery_beat/tzcrontab.py ↗ | tags: #timezone-aware-crontab #crontab-subclass #pickling

Implements `clocked`, a simple Celery schedule that runs a task at a fixed datetime (for one-off execution). It overrides `remaining_estimate` and `is_due` to return `NEVER_CHECK_TIMEOUT` after the clocked time passes. This is a minimal, reusable schedule type for single-point-in-time task execution.

file: django_celery_beat/clockedschedule.py ↗ | tags: #clocked-schedule #one-off-task #celery-schedule
Last analyzed: 2026-09-08 18:12:32.361991
Next check: 2026-09-15 18:12:32.343678
$ submit: