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.1.0.tar.gz (268.7 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.1.0-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_liveops-0.1.0.tar.gz
  • Upload date:
  • Size: 268.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 3a6597226302616d5238447b43d50c99a196fe4947a19a95e25363b11072883b
MD5 3c8a1b558bd49d24ef4b226daa09489f
BLAKE2b-256 95d916839b0fc4ab30d3f2b87b92927d979871d48d14cd5ec06745406ca5a939

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_liveops-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 70.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 274c1b1fc41ea9aa1675e489dbb2db29eaad5f38cdc115959ca1008fb24e903e
MD5 a823d4ffd65508f7f558a77e666f620a
BLAKE2b-256 9fd6bb30bdd07a536817ae30b6c68191bdcfe6c39624a9f75f80706a0d23842d

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