Skip to main content

Anzu package for workers

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.5.tar.gz (4.0 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.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anzu-0.1.5.tar.gz
  • Upload date:
  • Size: 4.0 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.5.tar.gz
Algorithm Hash digest
SHA256 d34ab0a9fcf84f22e1cf70c359d46590e748a6b648dd0b30cf1ff1867ae438ed
MD5 0f0d8f278edd8086caac05f640c3bded
BLAKE2b-256 efc56942b3379c99d034ac431b412c04df1973d0e66b090de91090474d26893e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anzu-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 10776e5187bb205b0e3db20824ba35da12d5cb88705e27b8bb3238b1f9d911e6
MD5 0acc958b51ba9840e49e055a2e698364
BLAKE2b-256 3b044d36ff5d5c9d1cffad3c470b83cfbcbba78cea8f747854ea0a0e7ddd39b4

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