Debian Codegraph @

README.rst

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