Skip to main content

A package for updating queue items in a Django service

Project description

Queue Updater

A simple Python package for updating queue items in a Django service.

Installation

pip install anzu

Usage

Using the QueueClient class (recommended)

from anzu import QueueClient

# Initialize with explicit parameters
client = QueueClient(
    django_url="https://your-django-service.com",
    username="admin",
    password="password",
    service_endpoint="/api/queue/"
)

# Update a queue item
client.update_queue_item(
    qi_hash="abc123",
    status="completed",
    data={"result": "success"}
)

# Or initialize using environment variables
import os

os.environ["DJANGO_URL"] = "https://your-django-service.com"
os.environ["DJANGO_SUPERUSER_USERNAME"] = "admin"
os.environ["DJANGO_SUPERUSER_PASSWORD"] = "password"
os.environ["SERVICE_ENDPOINT"] = "/api/queue/"

client = QueueClient()
client.update_queue_item("abc123", "completed")

Using the legacy function (for backward compatibility)

import os
from anzu import update_queue_item

# Set required environment variables
os.environ["DJANGO_URL"] = "https://your-django-service.com"
os.environ["DJANGO_SUPERUSER_USERNAME"] = "admin"
os.environ["DJANGO_SUPERUSER_PASSWORD"] = "password"
os.environ["SERVICE_ENDPOINT"] = "/api/queue/"

# Update a queue item
update_queue_item(
    qi_hash="abc123",
    status="completed",
    data={"result": "success"}
)

Environment Variables

  • DJANGO_URL: URL of the Django service
  • DJANGO_SUPERUSER_USERNAME: Django superuser username
  • DJANGO_SUPERUSER_PASSWORD: Django superuser password
  • SERVICE_ENDPOINT: Service endpoint (defaults to '/')

License

MIT

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

anzu-0.1.4.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

anzu-0.1.4-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file anzu-0.1.4.tar.gz.

File metadata

  • Download URL: anzu-0.1.4.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for anzu-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7bacd09177f38a31bd3c5158975c691f52a1a32f09073bd5f0f2cbd99d0c9549
MD5 3095da0d000284a303590b49bc478fd8
BLAKE2b-256 35ba44f21f4ab295cfa3f8501dd80296c6795eab89c66053c616b306a93cb9f0

See more details on using hashes here.

File details

Details for the file anzu-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: anzu-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for anzu-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50121fcfbb785caa8c7b10a3ea65947c0a37f85d9f68affd927f773eed7c348c
MD5 39c2c6cf5f6f99a8687154f6cb392387
BLAKE2b-256 4d34bfa1d815311e783ab6161a7600f3d7135c1b276ca67783e06bd5d083e528

See more details on using hashes here.

Supported by

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