Skip to main content

Background Processing for Python 3.

Project description

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


Franz: macOS Kafka Client


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.

Project details


Download files

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

Source Distribution

dramatiq-1.14.2.tar.gz (95.1 kB view details)

Uploaded Source

Built Distribution

dramatiq-1.14.2-py3-none-any.whl (115.6 kB view details)

Uploaded Python 3

File details

Details for the file dramatiq-1.14.2.tar.gz.

File metadata

  • Download URL: dramatiq-1.14.2.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for dramatiq-1.14.2.tar.gz
Algorithm Hash digest
SHA256 8f1a615d4c8f9ea43d60a5c85457e1ec8c0e8d3d85ba72467a959dbff483af1d
MD5 31af02bcea9b5b53635298d057fe08f5
BLAKE2b-256 5a9efd1ff7b2a85216b65a2cd114a1713dc3bf988a4d89b6bd5ce4a1d6a8c190

See more details on using hashes here.

Provenance

File details

Details for the file dramatiq-1.14.2-py3-none-any.whl.

File metadata

  • Download URL: dramatiq-1.14.2-py3-none-any.whl
  • Upload date:
  • Size: 115.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for dramatiq-1.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cbde4da5016f31fd9db3bb66f02090d6291ce4c2f2093e2783ed91da947d05f4
MD5 386c8d1e057e07e87e69cd7b6af19168
BLAKE2b-256 28849e4924afc0fcaba63d5d85b6e3f43835465c0f07b589257231f3eae0886b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page