This document describes the current stable version of Celery (4.2). For development docs, go here.


Utility functions.

Don’t import from here directly anymore, as these are only here for backwards compatibility.


Return the kombu.Queue being a direct route to a worker.

Parameters:hostname (str, Queue) – The fully qualified node name of a worker (e.g., If passed a kombu.Queue instance it will simply return that instead.
celery.utils.gen_task_name(app, name, module_name)[source]

Generate task name from name/module pair.

celery.utils.nodename(name, hostname)[source]

Create node name from name/hostname pair.


Split node name into tuple of name/hostname.

class celery.utils.cached_property(fget=None, fset=None, fdel=None, doc=None)[source]

Cached property descriptor.

Caches the return value of the get method on first call.


def connection(self):
    return Connection()

@connection.setter  # Prepares stored value
def connection(self, value):
    if value is None:
        raise TypeError('Connection must be a connection')
    return value

def connection(self, value):
    # Additional action to do at del(self.attr)
    if value is not None:
        print('Connection {0!r} deleted'.format(value)
celery.utils.uuid(_uuid=<function uuid4>)[source]

Generate unique id in UUID4 format.

See also

For now this is provided by uuid.uuid4().