Skip to main content

Celery Director logo

Tests Python versions License Code style: black

Celery Director


Director is a simple and rapid framework used to manage tasks and build workflows using Celery.

The objective is to make Celery easier to use by providing :

  • a WebUI, an API and a CLI to manage and execute the workflows,
  • a WebUI to track the tasks states,
  • a YAML syntax used to combine tasks into workflows,
  • the ability to periodically launch a whole workflow,
  • and many others.

See how to use Director with the quickstart and guides in the documentation.

Installation

Install the latest version of Director with pip (requires at least Python 3.7):

pip install celery-director

Usage

Write your code in Python

# tasks/orders.py
from director import task
from .utils import Order, Mail

@task(name="ORDER_PRODUCT")
def order_product(*args, **kwargs):
    order = Order(
      user=kwargs["payload"]["user"],
      product=kwargs["payload"]["product"]
    ).save()
    return {"id": order.id}

@task(name="SEND_MAIL")
def send_mail(*args, **kwargs):
    order_id = args[0]["id"]
    mail = Mail(
      title=f"Your order #{order_id} has been received",
      user=kwargs["payload"]["user"]
    )
    mail.send()

Build your workflows in YAML

# workflows.yml
product.ORDER:
  tasks:
    - ORDER_PRODUCT
    - SEND_MAIL

Run it

You can simply test your workflow in local :

$ director workflow run product.ORDER '{"user": 1234, "product": 1000}'

And run it in production using the director API :

$ curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"project": "product", "name": "ORDER", "payload": {"user": 1234, "product": 1000}}' \
  http://localhost:8000/api/workflows

Read the documentation to try the quickstart and see advanced usages of Celery Director.

Project layout

.env                # The configuration file.
workflows.yml       # The workflows definition.
tasks/
    example.py      # A file containing some tasks.
    ...             # Other files containing other tasks.

Commands

  • director init [path] - Create a new project.
  • director celery [worker|beat|flower] - Start Celery daemons.
  • director webserver - Start the webserver.
  • director workflow [list|show|run] - Manage your project workflows.

License

See https://github.com/ovh/celery-director/blob/master/LICENSE

Release files for celery-director 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celery-director 0.10.0
File Size Uploaded
celery-director-0.10.0.tar.gz 45.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for celery-director 0.10.0
File Interpreter ABI Platform
celery_director-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.7 kB

Release files / celery-director-0.10.0.tar.gz

Download URL celery-director-0.10.0.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
51cc097db4700a19b7aba0f102606590971b493c26b06db42c689c82a7839d44
BLAKE2b-256 checksum
How to use checksums
ddd2469f0b99c22e62851493d352c5aa827ef5e7361be64fe1940c497e8a56a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0rc1

Release files / celery_director-0.10.0-py3-none-any.whl

Download URL celery_director-0.10.0-py3-none-any.whl
Size 58.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58e2bcde6fac9ea23bdd0809c6f5d07bc6af41ec1ec0968ddb2867cf8bca8064
BLAKE2b-256 checksum
How to use checksums
83b8220bd4d27e78a5d417d9f27d83600c636380239249fb1ff68e96836a700e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page