Debian Codegraph @

README.rst

raw ◀ ▶
1 Debian patch touch this file
•1 .. image:: ./docs/images/celery-banner-small.png
2
3 |build-status| |coverage| |license| |wheel| |semgrep| |pyversion| |pyimp| |ocbackerbadge| |ocsponsorbadge|
4
5 :Version: 5.6.3 (recovery)
6 :Web: https://docs.celeryq.dev/en/stable/index.html
7 :Download: https://pypi.org/project/celery/
8 :Source: https://github.com/celery/celery/
9 :DeepWiki: |deepwiki|
10 :Keywords: task, queue, job, async, rabbitmq, amqp, redis,
11 python, distributed, actors
12
13 Donations
14 =========
15
16 Open Collective
17 ---------------
18
19 `Open Collective <https://opencollective.com/celery>`_ is our community-powered funding platform that fuels Celery's
20 ongoing development. Your sponsorship directly supports improvements, maintenance, and innovative features that keep
21 Celery robust and reliable.
22
23 For enterprise
24 ==============
25
26 Available as part of the Tidelift Subscription.
27
28 The maintainers of ``celery`` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. `Learn more. <https://tidelift.com/subscription/pkg/pypi-celery?utm_source=pypi-celery&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_
29
30 Sponsors
31 ========
32
33 Blacksmith
34 ----------
35
36 `Official Announcement <https://www.linkedin.com/pulse/celery-now-powered-blacksmith-tomer-nosrati-ew68e/?trackingId=DWHH49WqS2iOW8Jf5N1kEg%3D%3D>`_
37
38 CloudAMQP
39 ---------
40
41 `CloudAMQP <https://www.cloudamqp.com/>`_ is an industry leading RabbitMQ as a service provider.
42 If you need highly available message queues, a perfect choice would be to use CloudAMQP.
43 With 24,000+ running instances, CloudAMQP is the leading hosting provider of RabbitMQ,
44 with customers all over the world.
45
46 Upstash
47 -------
48
49 `Upstash <http://upstash.com/?code=celery>`_ offers a serverless Redis database service,
50 providing a seamless solution for Celery users looking to leverage
51 serverless architectures. Upstash's serverless Redis service is designed
52 with an eventual consistency model and durable storage, facilitated
53 through a multi-tier storage architecture.
54
55 Dragonfly
56 ---------
57
58 `Dragonfly <https://www.dragonflydb.io/>`_ is a drop-in Redis replacement that cuts costs and boosts performance.
59 Designed to fully utilize the power of modern cloud hardware and deliver on the data demands of modern applications,
60 Dragonfly frees developers from the limits of traditional in-memory data stores.
61
62
63
64 What's a Task Queue?
65 ====================
66
67 Task queues are used as a mechanism to distribute work across threads or
68 machines.
69
70 A task queue's input is a unit of work, called a task, dedicated worker
71 processes then constantly monitor the queue for new work to perform.
72
73 Celery communicates via messages, usually using a broker
74 to mediate between clients and workers. To initiate a task a client puts a
75 message on the queue, the broker then delivers the message to a worker.
76
77 A Celery system can consist of multiple workers and brokers, giving way
78 to high availability and horizontal scaling.
79
80 Celery is written in Python, but the protocol can be implemented in any
81 language. In addition to Python there's node-celery_ for Node.js,
82 a `PHP client`_, `gocelery`_, gopher-celery_ for Go, and rusty-celery_ for Rust.
83
84 Language interoperability can also be achieved by using webhooks
85 in such a way that the client enqueues an URL to be requested by a worker.
86
87 .. _node-celery: https://github.com/mher/node-celery
88 .. _`PHP client`: https://github.com/gjedeer/celery-php
89 .. _`gocelery`: https://github.com/gocelery/gocelery
90 .. _gopher-celery: https://github.com/marselester/gopher-celery
91 .. _rusty-celery: https://github.com/rusty-celery/rusty-celery
92
93 What do I need?
94 ===============
95
96 Celery version 5.5.x runs on:
97
98 - Python (3.8, 3.9, 3.10, 3.11, 3.12, 3.13)
99 - PyPy3.9+ (v7.3.12+)
100
101
102 This is the version of celery which will support Python 3.8 or newer.
103
104 If you're running an older version of Python, you need to be running
105 an older version of Celery:
106
107 - Python 3.7: Celery 5.2 or earlier.
108 - Python 3.6: Celery 5.1 or earlier.
109 - Python 2.7: Celery 4.x series.
110 - Python 2.6: Celery series 3.1 or earlier.
111 - Python 2.5: Celery series 3.0 or earlier.
112 - Python 2.4: Celery series 2.2 or earlier.
113
114 Celery is a project with minimal funding,
115 so we don't support Microsoft Windows but it should be working.
116 Please don't open any issues related to that platform.
117
118 *Celery* is usually used with a message broker to send and receive messages.
119 The RabbitMQ, Redis transports are feature complete,
120 but there's also experimental support for a myriad of other solutions, including
121 using SQLite for local development.
122
123 *Celery* can run on a single machine, on multiple machines, or even
124 across datacenters.
125
126 Get Started
127 ===========
128
129 If this is the first time you're trying to use Celery, or you're
130 new to Celery v5.6.x coming from previous versions then you should read our
131 getting started tutorials:
132
133 - `First steps with Celery`_
134
135 Tutorial teaching you the bare minimum needed to get started with Celery.
136
137 - `Next steps`_
138
139 A more complete overview, showing more features.
140
141 .. _`First steps with Celery`:
142 https://docs.celeryq.dev/en/stable/getting-started/first-steps-with-celery.html
143
144 .. _`Next steps`:
145 https://docs.celeryq.dev/en/stable/getting-started/next-steps.html
146
147 You can also get started with Celery by using a hosted broker transport CloudAMQP. The largest hosting provider of RabbitMQ is a proud sponsor of Celery.
148
149 Celery is...
150 =============
151
152 - **Simple**
153
154 Celery is easy to use and maintain, and does *not need configuration files*.
155
156 It has an active, friendly community you can talk to for support,
157 like at our `mailing-list`_, or the IRC channel.
158
159 Here's one of the simplest applications you can make:
160
161 .. code-block:: python
162
163 from celery import Celery
164
165 app = Celery('hello', broker='amqp://guest@localhost//')
166
167 @app.task
168 def hello():
169 return 'hello world'
170
171 - **Highly Available**
172
173 Workers and clients will automatically retry in the event
174 of connection loss or failure, and some brokers support
175 HA in way of *Primary/Primary* or *Primary/Replica* replication.
176
177 - **Fast**
178
179 A single Celery process can process millions of tasks a minute,
180 with sub-millisecond round-trip latency (using RabbitMQ,
181 py-librabbitmq, and optimized settings).
182
183 - **Flexible**
184
185 Almost every part of *Celery* can be extended or used on its own,
186 Custom pool implementations, serializers, compression schemes, logging,
187 schedulers, consumers, producers, broker transports, and much more.
188
189 It supports...
190 ================
191
192 - **Message Transports**
193
194 - RabbitMQ_, Redis_, Amazon SQS, Google Pub/Sub
195
196 - **Concurrency**
197
198 - Prefork, Eventlet_, gevent_, single threaded (``solo``)
199
200 - **Result Stores**
201
202 - AMQP, Redis
203 - memcached
204 - SQLAlchemy, Django ORM
205 - Apache Cassandra, IronCache, Elasticsearch
206 - Google Cloud Storage
207
208 - **Serialization**
209
210 - *pickle*, *json*, *yaml*, *msgpack*.
211 - *zlib*, *bzip2* compression.
212 - Cryptographic message signing.
213
214 .. _`Eventlet`: http://eventlet.net/
215 .. _`gevent`: http://gevent.org/
216
217 .. _RabbitMQ: https://rabbitmq.com
218 .. _Redis: https://redis.io
219 .. _SQLAlchemy: http://sqlalchemy.org
220
221 Framework Integration
222 =====================
223
224 Celery is easy to integrate with web frameworks, some of which even have
225 integration packages:
226
227 +--------------------+------------------------+
228 | `Django`_ | not needed |
229 +--------------------+------------------------+
230 | `Pyramid`_ | `pyramid_celery`_ |
231 +--------------------+------------------------+
232 | `Pylons`_ | `celery-pylons`_ |
233 +--------------------+------------------------+
234 | `Flask`_ | not needed |
235 +--------------------+------------------------+
236 | `web2py`_ | `web2py-celery`_ |
237 +--------------------+------------------------+
238 | `Tornado`_ | `tornado-celery`_ |
239 +--------------------+------------------------+
240 | `FastAPI`_ | not needed |
241 +--------------------+------------------------+
242
243 The integration packages aren't strictly necessary, but they can make
244 development easier, and sometimes they add important hooks like closing
245 database connections at ``fork``.
246
247 .. _`Django`: https://djangoproject.com/
248 .. _`Pylons`: http://pylonsproject.org/
249 .. _`Flask`: https://flask.palletsprojects.com/
250 .. _`web2py`: http://web2py.com/
251 .. _`Bottle`: https://bottlepy.org/
252 .. _`Pyramid`: https://docs.pylonsproject.org/projects/pyramid/en/latest/
253 .. _`pyramid_celery`: https://pypi.org/project/pyramid_celery/
254 .. _`celery-pylons`: https://pypi.org/project/celery-pylons/
255 .. _`web2py-celery`: https://code.google.com/p/web2py-celery/
256 .. _`Tornado`: https://www.tornadoweb.org/
257 .. _`tornado-celery`: https://github.com/mher/tornado-celery/
258 .. _`FastAPI`: https://fastapi.tiangolo.com/
259
260 .. _celery-documentation:
261
262 Documentation
263 =============
264
265 The `latest documentation`_ is hosted at Read The Docs, containing user guides,
266 tutorials, and an API reference.
267
268 .. _`latest documentation`: https://docs.celeryq.dev/en/latest/
269
270 .. _celery-installation:
271
272 Installation
273 ============
274
275 You can install Celery either via the Python Package Index (PyPI)
276 or from source.
277
278 To install using ``pip``:
279
280 ::
281
282
283 $ pip install -U Celery
284
285 .. _bundles:
286
287 Bundles
288 -------
289
290 Celery also defines a group of bundles that can be used
291 to install Celery and the dependencies for a given feature.
292
293 You can specify these in your requirements or on the ``pip``
294 command-line by using brackets. Multiple bundles can be specified by
295 separating them by commas.
296
297 ::
298
299
300 $ pip install "celery[redis]"
301
302 $ pip install "celery[redis,auth,msgpack]"
303
304 The following bundles are available:
305
306 Serializers
307 ~~~~~~~~~~~
308
309 :``celery[auth]``:
310 for using the ``auth`` security serializer.
311
312 :``celery[msgpack]``:
313 for using the msgpack serializer.
314
315 :``celery[yaml]``:
316 for using the yaml serializer.
317
318 Concurrency
319 ~~~~~~~~~~~
320
321 :``celery[eventlet]``:
322 for using the ``eventlet`` pool.
323
324 :``celery[gevent]``:
325 for using the ``gevent`` pool.
326
327 Transports and Backends
328 ~~~~~~~~~~~~~~~~~~~~~~~
329
330 :``celery[amqp]``:
331 for using the RabbitMQ amqp python library.
332
333 :``celery[redis]``:
334 for using Redis as a message transport or as a result backend.
335
336 :``celery[sqs]``:
337 for using Amazon SQS as a message transport.
338
339 :``celery[tblib``]:
340 for using the ``task_remote_tracebacks`` feature.
341
342 :``celery[memcache]``:
343 for using Memcached as a result backend (using ``pylibmc``)
344
345 :``celery[pymemcache]``:
346 for using Memcached as a result backend (pure-Python implementation).
347
348 :``celery[cassandra]``:
349 for using Apache Cassandra/Astra DB as a result backend with the DataStax driver.
350
351 :``celery[azureblockblob]``:
352 for using Azure Storage as a result backend (using ``azure-storage``)
353
354 :``celery[s3]``:
355 for using S3 Storage as a result backend.
356
357 :``celery[gcs]``:
358 for using Google Cloud Storage as a result backend.
359
360 :``celery[couchbase]``:
361 for using Couchbase as a result backend.
362
363 :``celery[arangodb]``:
364 for using ArangoDB as a result backend.
365
366 :``celery[elasticsearch]``:
367 for using Elasticsearch as a result backend.
368
369 :``celery[riak]``:
370 for using Riak as a result backend.
371
372 :``celery[cosmosdbsql]``:
373 for using Azure Cosmos DB as a result backend (using ``pydocumentdb``)
374
375 :``celery[zookeeper]``:
376 for using Zookeeper as a message transport.
377
378 :``celery[sqlalchemy]``:
379 for using SQLAlchemy as a result backend (*supported*).
380
381 :``celery[pyro]``:
382 for using the Pyro4 message transport (*experimental*).
383
384 :``celery[slmq]``:
385 for using the SoftLayer Message Queue transport (*experimental*).
386
387 :``celery[consul]``:
388 for using the Consul.io Key/Value store as a message transport or result backend (*experimental*).
389
390 :``celery[django]``:
391 specifies the lowest version possible for Django support.
392
393 You should probably not use this in your requirements, it's here
394 for informational purposes only.
395
396 :``celery[gcpubsub]``:
397 for using Google Pub/Sub as a message transport.
398
399
400
401 .. _celery-installing-from-source:
402
403 Downloading and installing from source
404 --------------------------------------
405
406 Download the latest version of Celery from PyPI:
407
408 https://pypi.org/project/celery/
409
410 You can install it by doing the following:
411
412 ::
413
414
415 $ tar xvfz celery-0.0.0.tar.gz
416 $ cd celery-0.0.0
417 $ python setup.py build
418 # python setup.py install
419
420 The last command must be executed as a privileged user if
421 you aren't currently using a virtualenv.
422
423 .. _celery-installing-from-git:
424
425 Using the development version
426 -----------------------------
427
428 With pip
429 ~~~~~~~~
430
431 The Celery development version also requires the development
432 versions of ``kombu``, ``amqp``, ``billiard``, and ``vine``.
433
434 You can install the latest snapshot of these using the following
435 pip commands:
436
437 ::
438
439
440 $ pip install https://github.com/celery/celery/zipball/main#egg=celery
441 $ pip install https://github.com/celery/billiard/zipball/main#egg=billiard
442 $ pip install https://github.com/celery/py-amqp/zipball/main#egg=amqp
443 $ pip install https://github.com/celery/kombu/zipball/main#egg=kombu
444 $ pip install https://github.com/celery/vine/zipball/main#egg=vine
445
446 With git
447 ~~~~~~~~
448
449 Please see the Contributing section.
450
451 .. _getting-help:
452
453 Getting Help
454 ============
455
456 .. _mailing-list:
457
458 Mailing list
459 ------------
460
461 For discussions about the usage, development, and future of Celery,
462 please join the `celery-users`_ mailing list.
463
464 .. _`celery-users`: https://groups.google.com/group/celery-users/
465
466 .. _irc-channel:
467
468 IRC
469 ---
470
471 Come chat with us on IRC. The **#celery** channel is located at the
472 `Libera Chat`_ network.
473
474 .. _`Libera Chat`: https://libera.chat/
475
476 .. _bug-tracker:
477
478 Bug tracker
479 ===========
480
481 If you have any suggestions, bug reports, or annoyances please report them
482 to our issue tracker at https://github.com/celery/celery/issues/
483
484 .. _wiki:
485
486 Wiki
487 ====
488
489 https://github.com/celery/celery/wiki
490
491 Credits
492 =======
493
494 .. _contributing-short:
495
496 Contributors
497 ------------
498
499 This project exists thanks to all the people who contribute. Development of
500 `celery` happens at GitHub: https://github.com/celery/celery
501
502 You're highly encouraged to participate in the development
503 of `celery`. If you don't like GitHub (for some reason) you're welcome
504 to send regular patches.
505
506 Be sure to also read the `Contributing to Celery`_ section in the
507 documentation.
508
509 .. _`Contributing to Celery`:
510 https://docs.celeryq.dev/en/stable/contributing.html
511
512 Backers
513 -------
514
515 Thank you to all our backers! 🙏 [`Become a backer`_]
516
517 .. _`Become a backer`: https://opencollective.com/celery#backer
518
519 .. _license:
520
521 License
522 =======
523
524 This software is licensed under the `New BSD License`. See the ``LICENSE``
525 file in the top distribution directory for the full license text.
526
527 .. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround