dramatiq is a free, open source project & work management project written in Python and released under LGPL-3.0. It has 5,311 GitHub stars, 383 forks and 65 open issues, and was last pushed 4 days ago. On this registry it ranks #20 of 62 tracked projects in Project & Work Management, with 5 head-to-head comparisons available. It gained 1 stars over the last 3 tracked days.

What is dramatiq?

What it is

dramatiq is a distributed task processing library for Python 3, released under the LGPL-3.0 license and developed in the open on GitHub, where it has accumulated roughly 5,310 stars and 383 forks over about nine years. It lives in the Python ecosystem and is published on PyPI, with documentation hosted at dramatiq.io, a changelog, and a community mailing list on groups.io. The project describes itself as a fast and reliable background task processing library, and it is catalogued under business software for project and work management.

The concrete problem it solves is the movement of slow or unreliable work out of the request path of a Python application. Rather than blocking a web request while a function performs network calls or long computation, a developer marks a function as an actor and enqueues a message describing the work; separate worker processes pick the message up and execute it. dramatiq covers both ends of that pattern: producing messages from application code and consuming them in a pool of worker processes, with RabbitMQ and Redis available as the message brokers behind the queue.

Key capabilities

  • Declares background jobs with a decorator: @dramatiq.actor turns a plain Python function into a message-consuming actor.
  • Enqueues work by message passing: calling .send() on an actor publishes a job to the configured broker with its arguments.
  • Supports RabbitMQ as the message broker through the rabbitmq install extra.
  • Supports Redis as the message broker through the redis install extra.
  • Ships a worker command-line runner: invoking dramatiq example starts workers that consume messages for the named module.
  • Provides a hot-reloading watch mode as part of the watch install extra, aimed at development workflows.
  • The project's topic list covers task scheduling, task running, task management, and distributed locking alongside the broker topics for RabbitMQ and Redis.

Who uses it and how

  • Python web applications and services that need to run slow network or CPU work outside the request and response cycle.
  • Teams running long-lived worker processes against a RabbitMQ instance, started and supervised with the dramatiq command.
  • Teams running the same pattern against a Redis instance, using the Redis broker extra instead of RabbitMQ.
  • Developers iterating locally who start workers with the watch extra enabled so code changes are picked up.
  • Background job workloads that need scheduling or a distributed lock, which the topic list indicates the project covers.

Getting started

Installation is done with pip, choosing the broker: pip install 'dramatiq[rabbitmq, watch]' for RabbitMQ, or pip install 'dramatiq[redis, watch]' for Redis. Workers run in one terminal with dramatiq example, while another terminal runs python example.py to enqueue messages, after ensuring the chosen broker is running. The README notes that the documentation, changelog, and a community mailing list are available at dramati

project readme (upstream, from github) — read inline

dramatiq

Build Status PyPI version Documentation Discuss

A fast and reliable distributed task processing library for Python 3.


Changelog: https://dramatiq.io/changelog.html
Community: https://groups.io/g/dramatiq-users
Documentation: https://dramatiq.io


Sponsors

Installation

If you want to use it with RabbitMQ

pip install 'dramatiq[rabbitmq, watch]'

or if you want to use it with Redis

pip install 'dramatiq[redis, watch]'

Quickstart

Make sure you've got RabbitMQ running, then create a new file called example.py:

import dramatiq
import requests
import sys


@dramatiq.actor
def count_words(url):
    response = requests.get(url)
    count = len(response.text.split(" "))
    print(f"There are {count} words at {url!r}.")


if __name__ == "__main__":
    count_words.send(sys.argv[1])

In one terminal, run your workers:

dramatiq example

In another, start enqueueing messages:

python example.py http://example.com
python example.py https://github.com
python example.py https://news.ycombinator.com

Check out the user guide to learn more!

License

dramatiq is licensed under the LGPL. Please see COPYING and COPYING.LESSER for licensing details.

Frequently asked questions

Is dramatiq free to use?

dramatiq is open source under the LGPL-3.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does dramatiq do?

A fast and reliable background task processing library for Python 3.

What is dramatiq written in?

dramatiq is primarily written in Python. Its source is publicly available at https://github.com/Bogdanp/dramatiq, and it has 5,311 GitHub stars.