--- id: celery-batches version: "0.11" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # celery-batches — Experimental task class that buffers messages and processes them as a list. License: permissive · Maintenance: active · Downloads: 197.1K/mo ## What it is and what it does Celery Batches is a task extension for Celery that groups multiple task calls into a single batch before execution. Instead of processing tasks individually, you define a batch task that receives a list of accumulated task arguments and processes them together. The batch is flushed either when a configurable number of tasks accumulate or after a timer interval expires, whichever comes first. This pattern is useful when individual task execution has expensive setup costs that can be amortized across multiple items, or when you want to deduplicate similar requests, keep only the latest variant of a task, or bulk-insert data. The package was originally part of Celery's contrib module but was extracted as a standalone project to maintain compatibility with modern Celery versions (5.0+) and current Python releases (3.9–3.14). Use it for: - Bulk database inserts or updates where individual row operations are inefficient compared to batch operations. - De-duplicating or coalescing similar task requests that arrive in rapid succession. - Processing tasks with expensive initialization amortized across multiple items. - Accumulating metrics or log entries and writing them in bulk rather than individually. - Rate-limiting or throttling task execution by grouping requests into batches. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Celery Batches provides a Task class that buffers multiple Celery task calls and processes them together as a list, flushing on a timer or when a size threshold is reached. Yes, if you use Celery and have workloads where batching reduces overhead or improves throughput. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. The Alpha status is not a blocker. Install it when you have a concrete use case for task batching; it is not a general-purpose upgrade. ## Install pip install celery-batches uv add celery-batches poetry add celery-batches ## Installing celery-batches Before you install: Low install friction with a single runtime dependency on celery. Actively maintained with a recent release and ongoing repository activity. License in practice: BSD-3-Clause is a permissive license that allows commercial and private use with minimal restrictions, requiring only preservation of copyright and license notices. Quickstart: pip install celery-batches from celery_batches import batch from celery import Celery app = Celery() @app.task(base=batch) def process_batch(tasks): # tasks is a list of task arguments pass Requires Python 3.9 or later and Celery ~= 5.0; older Python or Celery versions require older celery-batches releases. Verify before relying: - Whether the package's Alpha development status reflects stability concerns or is simply a conservative classification. - Performance characteristics when batching large numbers of tasks or with high-frequency flush triggers. - Specific configuration options for flush_every and flush_interval parameters. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 197.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags celery task batching, batch processing celery tasks, celery message buffering, bulk task execution, celery deduplication, accumulate celery tasks, celery batch queue, celery-extension, task-batching, distributed-tasks [View on SkillFed](https://skillfed.io/packages/celery-batches) · [View on PyPI](https://pypi.org/project/celery-batches/)