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.1.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.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: celery_simple_schedule-0.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 0424b10551b75fe2643808305d1dd3d4490823861d8c34bd5f34f9b21fc747ad
MD5 b22848b78620e42be012f0ab03216834
BLAKE2b-256 49b57460fcfa52a8bf73e570d9f0e7de8bacec398055dbd2c0bf4aa8d699f3ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for celery_simple_schedule-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b052739f95f117c88a7a5ad076c99a46bccd75ac4ca0a6e235f6d2381aa5a612
MD5 8cf6f0c95a767c748d19a2c0281f1652
BLAKE2b-256 577f89baf5e5a6aa1a854860322e61f88124e6982bb7ba65369a83bb5cf34669

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