edx-celeryutils

raw JSON →
2.0.0 verified Mon Apr 27 auth: no python

Utilities for using Celery in edx-platform. Version 2.0.0 supports Python 3.12, dropped Python 3.11. Maintained by Open edX.

pip install edx-celeryutils
error ModuleNotFoundError: No module named 'edx_celeryutils'
cause Package not installed or installed in wrong environment.
fix
Run 'pip install edx-celeryutils' in your virtual environment.
error ImportError: cannot import name 'TaskProgress' from 'edx_celeryutils'
cause Incorrect import path; TaskProgress is a top-level export but may be missing if running an old version.
fix
Ensure you have edx-celeryutils>=1.1.0 and use 'from edx_celeryutils import TaskProgress'.
error TypeError: 'TaskProgress' object is not callable
cause Trying to call TaskProgress as a function instead of instantiating it.
fix
Use: progress = TaskProgress('task_name', total_steps=5); then progress.update_work(steps=1).
error AttributeError: module 'edx_celeryutils.tasks' has no attribute 'get_task_session'
cause Incorrect import; get_task_session is not available in older versions or not exported.
fix
Check version (>=1.2.0) and import 'from edx_celeryutils.tasks import get_task_session'.
breaking Dropped Python 3.11 support in v2.0.0; use Python 3.12+.
fix Upgrade to Python 3.12 or later.
gotcha The package no longer includes 'arbi-bom' references; old imports related to that may break.
fix Remove any usage of 'arbi_bom' from your codebase.
deprecated The 'celery' task decorator usage with this package is deprecated in favor of class-based tasks.
fix Use Celery's @shared_task decorator or custom task classes.
gotcha If using with Django, ensure 'celery' app is properly configured before importing edx_celeryutils.
fix Configure your Django settings with CELERY_BROKER_URL and other Celery settings before importing from edx_celeryutils.

Basic usage of TaskProgress to track Celery task progress.

from edx_celeryutils import TaskProgress

# Create a task progress tracker
progress = TaskProgress('my_task', total_steps=10)
progress.update_work()