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_worker
Usage
Using the QueueClient class (recommended)
from anzu_workers 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_worker 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 serviceDJANGO_SUPERUSER_USERNAME: Django superuser usernameDJANGO_SUPERUSER_PASSWORD: Django superuser passwordSERVICE_ENDPOINT: Service endpoint (defaults to '/')
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
anzu_workers-0.1.2.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anzu_workers-0.1.2.tar.gz.
File metadata
- Download URL: anzu_workers-0.1.2.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30c4c2d4d8405a4a8eba6c18a3d6528c17bb3891b6d1dd61fec4d597f1d29233
|
|
| MD5 |
ad4b5e5478fa1283983fffd1fd493441
|
|
| BLAKE2b-256 |
cbbdc651234c15e12117377159357177be74033ab5d3c7d7a27aaaf7c0bd7f26
|
File details
Details for the file anzu_workers-0.1.2-py3-none-any.whl.
File metadata
- Download URL: anzu_workers-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0db62423bbf2989bf0dd655afd93bc0cfac73524417f6f5e53a229259d3b052
|
|
| MD5 |
ef9afdab05a08717d0f3ce18e338268c
|
|
| BLAKE2b-256 |
5463d00898d28be3bc10195fd2ac65e359dd4d59342e67c9ec9562cebc1a62ca
|