Celery
Distributed task queue for Python executing jobs asynchronously across workers.
3. Used by agents' projects
Dependency in 37 public GitHub projects set up for AI coding agents that we scanned (0.6%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Celery does
Celery passes task messages through a broker you choose, keeps results off unless you add a result backend, and uses a message protocol that the README says other languages can implement.
Celery popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Celery is used
- Celery is a dependency in 37 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.3% of the 1,623 Python ones), #4 of 48 in jobs, queues and workflows.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 162; those are left out of every share on this page.
- The most used alternative in our scan is arq (4 projects).
- Projects that use it most often also use redis (Python) (83.8%), Uvicorn (75.7%), FastAPI (73.0%).
By coding agent
Often used with
Celery in practice
Strengths
The README says the message protocol "can be implemented in any language". It lists other implementations: node-celery for Node.js, a PHP client, gocelery and gopher-celery for Go, and rusty-celery for Rust.
<code>delay()</code> is a shortcut. <code>apply_async()</code> lets you set the target queue and a countdown for each call, as in <code>add.apply_async((2, 2), queue='lopri', countdown=10)</code>.
Wolt's engineering post recommends <code>chord</code> for jobs that collect data from several sources and then build a report. It argues this runs collection in parallel and lets each piece be retried on its own.
Wolt's post gives an example that sets <code>autoretry_for</code>, <code>retry_backoff</code> and <code>max_retries</code> on the task decorator, so a failing third-party API call is retried with growing delays.
Watch out for
The maintainers say Windows "should be working" but is not supported, and they ask users not to open issues about it.
The README says 5.6.x is the last series to support Python 3.9. Older Pythons need older Celery releases.
The docs call Redis feature-complete as a broker. They also say it is more exposed to data loss than RabbitMQ.
One of the simplest Celery apps
from celery import Celery
app = Celery('hello', broker='amqp://guest@localhost//')
@app.task
def hello():
return 'hello world'More about Celery
Funding
- GitHub Sponsors: https://github.com/celery
- Open Collective: https://opencollective.com/celery
- Tidelift: https://tidelift.com/funding/github/pypi/celery
- 5 GitHub sponsors
Packages around it
- redis: Redis client
- python-dotenv: .env config loading
- uvicorn: ASGI server
- fastapi: Web API framework
- pydantic: Data validation
- requests: HTTP client
More in Jobs, queues and workflows
Alternatives
Celery This page
Job queue for Python with asyncio and Redis.
Small task queue for Python with Redis or SQLite.
Get started
Install it.
pip install celeryRules for your agent
## Celery
- Create the Celery app where other modules can import it. For larger projects use a dedicated module such as `proj/celery.py`, and list task modules in `include=[...]` so the worker can find them.
- Results are disabled by default. Only set a `backend` when you need state or return values. Otherwise leave results off, or set `@task(ignore_result=True)` on single tasks.
- With a result backend, call `get()` or `forget()` on every `AsyncResult`. Do not rely on `result.get()` in normal flow, because it turns the asynchronous call into a synchronous one.
- Use `apply_async()` instead of `delay()` when a call needs a specific `queue` or `countdown`.
- Keep periodic task intervals and task routing options in a central configuration module instead of hard-coding them.
- When raising worker concurrency with `-c`, note the docs say more than twice the number of CPUs is rarely effective.
- In production, run workers in the background with `celery multi` or a tool like supervisord. Use `celery multi stopwait` so running tasks complete before exit.