skillfed

celery-batches

Experimental task class that buffers messages and processes them as a list.

celery-batches v0.11 197.1K downloads/30d#9,769 on PyPI101
Permissive license BSD-3-Clause Active released

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-batches

uv

uv add celery-batches

poetry

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 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

Development Status :: 3 - AlphaOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Object BrokeringTopic :: System :: Distributed Computing

Tags

celery task batchingbatch processing celery taskscelery message bufferingbulk task executioncelery deduplicationaccumulate celery taskscelery batch queue
celery-extensiontask-batchingdistributed-tasks

More Distributed Computing packages