Skip to main content

A lightweight Python utility that simplifies defining Celery Beat schedules using a clean, declarative function-based API.

Project description

celery-simple-schedule

A lightweight Python utility that simplifies defining Celery Beat schedules using a clean, declarative function-based API.

Just return a list of (task_path, schedule, optional_args) tuples — and get a fully compatible CELERY_BEAT_SCHEDULE dictionary.

Installation

pip install celery-simple-schedule

Usage

  1. Define your task schedule in a separate module, e.g. celery_tasks.py::
from celery_simple_schedule import simplify_schedules
from datetime import timedelta
from celery.schedules import crontab

@simplify_schedules
def provide_tasks():
    return (
        ('server.apps.math_news.tasks.create_news_task', crontab(hour=7, minute=30)),
        ('server.apps.notifications.tasks.clear_expired_deleted_notifications', timedelta(days=3)),
    )
  1. Wire it into your Celery app (celery.py):
from celery import Celery
from server.apps.celery_tasks import provide_tasks

app = Celery('my_project', broker=broker)
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
app.conf.beat_schedule = provide_tasks()  # 🧠 This is the magic

And that's it! You now have a clean and maintainable way to manage your periodic task schedule — with zero boilerplate and maximum clarity.

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

celery_simple_schedule-0.2.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

celery_simple_schedule-0.2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file celery_simple_schedule-0.2.0.tar.gz.

File metadata

  • Download URL: celery_simple_schedule-0.2.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for celery_simple_schedule-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6b7fe777d3dd595a03b875227e8af0bffae61d4abb6da69c6e4fe647b1cbe9d6
MD5 b5f1a35a2565d3c3f7cc4cd5bd4fa0d9
BLAKE2b-256 49485f80cb875f1c944d13effdd84e83b6a6361dba9f5e39fe49149fd1247aac

See more details on using hashes here.

File details

Details for the file celery_simple_schedule-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for celery_simple_schedule-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02e4b8c9c62878866c87322f03ba328fdee57a4be6a225f61afc5e9977eb927f
MD5 93ea32cf88f64e6c49b35cdcca27b9fd
BLAKE2b-256 f30872715b3ca9da642635e0c9d3305344e68efeb3c401d541233e29e920e86f

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