Skip to main content

Long-running operations with live WebSocket+HTMX UI (no reload, no polling)

Project description

django-liveops

CI PyPI Python License: MIT

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

Installation

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 for the full setup (channels, ASGI, settings).

The developer writes one method:

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/.

# 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 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.

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

django_liveops-0.3.0.tar.gz (276.5 kB view details)

Uploaded Source

Built Distribution

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

django_liveops-0.3.0-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

Details for the file django_liveops-0.3.0.tar.gz.

File metadata

  • Download URL: django_liveops-0.3.0.tar.gz
  • Upload date:
  • Size: 276.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_liveops-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2120f5bda23a2c57b9be752b964e5d014e80c0c7706ecb31e435d490b2abc75a
MD5 6b1ff96440a8986f9d84cf29b34bc777
BLAKE2b-256 2c9086f39bce9afedb87ba3769d3a2c6edcf56c3aad64695e70eb9fb1928b4d0

See more details on using hashes here.

File details

Details for the file django_liveops-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: django_liveops-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 76.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for django_liveops-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a727840f2de249b003b6b4fb2ddaa71d155dd2d27bfd209bff2991c18d14fc01
MD5 fd50e3b239d3da4e703ee53f17a5fbd1
BLAKE2b-256 7d25675043a056b2a868909cf001ccc31098d2308e444c38437ec9d6aa49d763

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