Skip to main content

Flask-Dramatiq

Flask-Dramatiq plugs Dramatiq task queue in your Flask web application.

// Features //

  • Configure Dramatiq from Flask configuration.
  • Ensure Flask app is available to Dramatiq actor.
  • Add worker command to Flask CLI.
  • Enable Flask Application factory.
  • Handle multiple brokers with configurable prefix.
  • Integrates periodiq. Optionnal.

Full documentation at flask-dramatiq.readthedocs.io.

// Installation and Usage //

Flask-Dramatiq is licensed under BSD-3-Clause. Add flask-dramatiq to your project:

$ uv add flask-dramatiq

Then use Dramatiq object as a regular Flask extension:

from flask import Flask
from flask_dramatiq import Dramatiq

app = Flask(__name__)
dramatiq = Dramatiq(app)

@dramatiq.actor()
def my_actor():
    ...

@app.route("/")
def myhandler():
    my_actor.send()

Flask-Dramatiq adds two configuration keys:

  • DRAMATIQ_BROKER, points to broker class like dramatiq.brokers.rabbitmq:RabbitmqBroker or dramatiq.brokers.redis:RedisBroker.
  • DRAMATIQ_BROKER_URL is passed as url keyword argument to broker class.

Now run worker program to consume messages and execute tasks in the background:

$ flask worker --processes=1

A complete flask app is available in project source tree example.py.

// Credit and Support //

Feel free to open an issue or suggest a merge request on Github project page. Contribution welcome!

The project is based on Bogdanp/flask_dramatiq_example.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_dramatiq-0.8.0.tar.gz (601.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_dramatiq-0.8.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file flask_dramatiq-0.8.0.tar.gz.

File metadata

  • Download URL: flask_dramatiq-0.8.0.tar.gz
  • Upload date:
  • Size: 601.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flask_dramatiq-0.8.0.tar.gz
Algorithm Hash digest
SHA256 6a5b2d6c8b1689021e3c868c15e260bc185c7da67f75c807d6a5d10b91882d08
MD5 936995240028bf3c9744ac5f5b46cb62
BLAKE2b-256 b83355765919e7b3cf2a643b841d45f3c3b78c277173994921d4f6ba63972bcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_dramatiq-0.8.0.tar.gz:

Publisher: publish.yml on pallets-eco/flask-dramatiq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flask_dramatiq-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: flask_dramatiq-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flask_dramatiq-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79e085781cc591e37cd5406e28b7c6ffb6ffdae9fa7cbf4b1dfb974446cfef8a
MD5 17bcd2f141f66c03819d615f2ccc57ed
BLAKE2b-256 8fbf3ca5bcf892daf95d282d6c398f7c4173126b6861c9e050db317c8a6b30df

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_dramatiq-0.8.0-py3-none-any.whl:

Publisher: publish.yml on pallets-eco/flask-dramatiq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page