celery-singleton
Prevent duplicate celery tasks
Decision gist · record as of 2026-08-14
Yes, if you are already committed to Celery and Redis and need simple deduplication without custom locking logic. However, proceed with caution: the package is abandoned (last release 2021-01-14, last commit 2023-06-09), so compatibility with recent Celery versions is unverified and no bug fixes are forthcoming. Evaluate whether a maintained fork or alternative exists before adopting for new projects.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a Redis server configured as the Celery result backend (or specified separately via singleton_backend_url config).
- All task arguments must be JSON serializable.
- Low install friction with only two runtime dependencies (celery and redis).
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing commercial and private use with minimal restrictions, making it safe from a licensing perspective for most projects.
last release 2021-01-14 (2038 days) · last repo commit 2023-06-09 · 263 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 352,762 downloads/mo, #7,310 on PyPI
Alternatives
Verify before relying
pip install celery-singleton
from celery_singleton import Singleton
@celery_app.task(base=Singleton)
def do_stuff(*args, **kwargs):
return 'result'
async_result = do_stuff.delay(1, 2, 3, a='b')
async_result2 = do_stuff.delay(1, 2, 3, a='b')
assert async_result == async_result2- Whether the package remains compatible with recent Celery versions released after 2023-06-09
- Whether Redis backend compatibility extends to modern Redis versions and Redis-compatible services
- Active community forks or maintained alternatives that address the abandoned status
What it is and what it does
Celery-Singleton is a base class for Celery tasks that enforces at-most-one-instance semantics: when you call delay() or apply_async() on a singleton task, it either queues a new task or returns the AsyncResult of an already-queued or running task with identical name and arguments. It uses Redis-backed distributed locking with task name and arguments hashed as the lock key, preventing duplicate work from clogging your message broker.
The package works transparently with standard Celery—no special exception handling needed. Locks are held until the task completes (success or failure), then released. You can configure which arguments determine uniqueness via the unique_on parameter, set lock expiry times to handle worker crashes, or raise exceptions on duplicate attempts instead of returning existing results. It requires a Redis server and JSON-serializable task arguments.
Use it for
- Prevent duplicate long-running reports or data exports from queuing when users click submit multiple times
- Ensure only one instance of a periodic cleanup or maintenance task runs at a time across distributed workers
- Rate-limit task execution by argument (e.g., one sync per user) without time-based delays
- Protect against thundering herd problems when multiple services trigger the same background job
- Simplify task deduplication logic by inheriting from Singleton instead of manual lock management
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already committed to Celery and Redis and need simple deduplication without custom locking logic.
However, proceed with caution: the package is abandoned (last release 2021-01-14, last commit 2023-06-09), so compatibility with recent Celery versions is unverified and no bug fixes are forthcoming. Evaluate whether a maintained fork or alternative exists before adopting for new projects.
Install
celery-singleton on PyPI
Before you install
Low install friction with only two runtime dependencies (celery and redis). However, the package is abandoned—last release was 2021-01-14 and last commit 2023-06-09—so no active maintenance or bug fixes should be expected.
Requires a Redis server configured as the Celery result backend (or specified separately via singleton_backend_url config). All task arguments must be JSON serializable.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions, making it safe from a licensing perspective for most projects.
Quickstart
pip install celery-singleton
from celery_singleton import Singleton
@celery_app.task(base=Singleton)
def do_stuff(*args, **kwargs):
return 'result'
async_result = do_stuff.delay(1, 2, 3, a='b')
async_result2 = do_stuff.delay(1, 2, 3, a='b')
assert async_result == async_result2
Verify before relying
- Whether the package remains compatible with recent Celery versions released after 2023-06-09
- Whether Redis backend compatibility extends to modern Redis versions and Redis-compatible services
- Active community forks or maintained alternatives that address the abandoned status
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.6,<4.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesceleryredis |
| Maintenance | Abandoned 2,038 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 352,762 / month, #7,310 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: celery_singleton-0.3.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “celery duplicate task prevention”
- celery-singletonPrevents duplicate Celery tasks from being queued or running…
- celery_oncePrevents duplicate execution and queuing of Celery tasks by enforcing…
- django-pglockProvides Postgres advisory locks, table locks, and lock management…
Give your agent the search over MCP, or paste the wish link into any chat.
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework that enables you to define and call remote procedures across network boundaries using protocol buffers for serialization.
Install it if you need RPC communication in a distributed system or are integrating with existing gRPC services.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
Cloudpickle extends Python's standard pickle module to serialize lambda functions, interactively-defined functions and classes, and other constructs that the default pickle cannot handle, making it suitable for cluster computing and remote code execution.
Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution.
Provides a unified, open()-compatible Python API for streaming large files from remote storage (S3, GCS, Azure, HDFS, SFTP, HTTP) and local filesystems, with transparent compression support.
Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
Ray is a distributed computing framework that scales Python applications from a single machine to multi-node clusters, providing abstractions for parallel tasks, stateful actors, and shared objects.
See also celery_once · celery-batches · celery · celery-redbeat · redlock · tenant-schemas-celery · arq · redlock-py · python-redis-lock · dvc-task