Metadata-Version: 2.4
Name: django-liveops
Version: 0.2.0
Summary: Long-running operations with live WebSocket+HTMX UI (no reload, no polling)
Project-URL: Homepage, https://github.com/iplweb/django-liveops
Project-URL: Repository, https://github.com/iplweb/django-liveops
Project-URL: Documentation, https://iplweb.github.io/django-liveops/
Project-URL: Changelog, https://github.com/iplweb/django-liveops/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/iplweb/django-liveops/issues
Author-email: iplweb <support@iplweb.pl>
Maintainer-email: Michał Pasternak <michal.dtz@gmail.com>
License: MIT
License-File: LICENSE
Keywords: celery,channels,django,htmx,long-running,progress,real-time,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: channels>=4
Requires-Dist: django-channels-broadcast>=0.2.1
Requires-Dist: django>=5.2
Provides-Extra: celery
Requires-Dist: celery>=5; extra == 'celery'
Provides-Extra: cli
Requires-Dist: tqdm>=4; extra == 'cli'
Provides-Extra: dev
Requires-Dist: channels-redis>=4; extra == 'dev'
Requires-Dist: channels[daphne]; extra == 'dev'
Requires-Dist: mkdocs-material; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest-django; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: testcontainers[redis]>=4; extra == 'dev'
Provides-Extra: redis
Requires-Dist: channels-redis>=4; extra == 'redis'
Description-Content-Type: text/markdown

# django-liveops

[![CI](https://github.com/iplweb/django-liveops/actions/workflows/ci.yml/badge.svg)](https://github.com/iplweb/django-liveops/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/django-liveops.svg)](https://pypi.org/project/django-liveops/)
[![Python](https://img.shields.io/pypi/pyversions/django-liveops.svg)](https://pypi.org/project/django-liveops/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

A standalone, reusable Django package for long-running operations with a live
WebSocket + HTMX user interface — no page reloads, no polling.

## Installation

```bash
pip install django-liveops
# optional extras:
pip install django-liveops[redis]    # Redis channel layer (production)
pip install django-liveops[celery]   # Celery worker runner
pip install django-liveops[cli]      # tqdm progress bar for text mode
```

Requires Python 3.11+ and Django 5.2+. See the
[Getting Started guide](https://iplweb.github.io/django-liveops/getting-started/)
for the full setup (channels, ASGI, settings).

The developer writes one method:

```python
from liveops.models import LiveOperation
from liveops.progress import Progress


class MyImport(LiveOperation):
    def run(self, p: Progress):
        for row in p.track(rows, label="Processing"):
            process(row)
            p.log(f"done: {row}")
        p.result()
```

The framework handles channels, tokens, OOB-swaps, snapshot-on-connect,
throttling, and cooperative cancellation.

## Try the demo

A self-contained demo project lives in [`example/`](example/).

```bash
# Browser demo — Daphne + Redis + Celery worker, live WebSocket progress.
# Opens http://localhost:8000 (needs Docker).
make demo

# Zero-infra text demo — runs synchronously, prints progress to stdout.
# No Docker, no Redis, no browser.
make demo-text
```

Both targets also work from inside `example/` (`cd example && make demo`);
the root `make` just delegates there. See [`example/README.md`](example/README.md)
for what you'll see and how the demo is wired.

## Documentation

Full docs are published at
**<https://iplweb.github.io/django-liveops/>** (source in `docs/`).

## License

MIT — see [LICENSE](LICENSE).
