Metadata-Version: 2.4
Name: anzu
Version: 0.1.5
Summary: Anzu package for workers
Author-email: Your Name <your.email@example.com>
License: MIT
License-File: LICENSE
Keywords: django,queue,update
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: aiohttp>=3.7.3
Requires-Dist: python-socketio>=5.12.1
Requires-Dist: requests>=2.25.0
Description-Content-Type: text/markdown

# Queue Updater

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

## Installation

```bash
pip install anzu
```

## Usage

### Using the QueueClient class (recommended)

```python
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)

```python
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