celery-batches
Experimental task class that buffers messages and processes them as a list.
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 on this page — 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
celery-batches on PyPI
pip
pip install celery-batchesuv
uv add celery-batchespoetry
poetry add celery-batchesInstalling 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 the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — celery |
| Maintenance | actively maintained — 210 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 197,110/month — #9,769 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: celery_batches-0.11-py3-none-any.whl
Keywords: task, job, queue, distributed, messaging, actor, celery
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
celeryCelery is a distributed task queue that lets…
permissive · top 1,000 on PyPI
celery-stubsProvides type stubs for Celery to enable static…
permissive · top 15,000 on PyPI
celery-singletonPrevents duplicate Celery tasks from being…
permissive · top 15,000 on PyPI
dvc-taskdvc-task queues and runs background jobs from…
permissive · top 5,000 on PyPI
celery_oncePrevents duplicate execution and queuing of…
permissive · top 15,000 on PyPI
django-celery-emailRoutes Django email sending through Celery task…
permissive · top 15,000 on PyPI
taskiqTaskiq is an asynchronous distributed task…
permissive · top 5,000 on PyPI
apache-airflow-providers-celeryIntegrates Celery distributed task execution…
permissive · top 5,000 on PyPI
celery-progressProvides drop-in progress bars for Django views…
permissive · top 15,000 on PyPI
mixpanel-py-asyncProvides asynchronous event batching and…
permissive · top 15,000 on PyPI