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.2.0.tar.gz (271.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.2.0-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_liveops-0.2.0.tar.gz
  • Upload date:
  • Size: 271.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.2.0.tar.gz
Algorithm Hash digest
SHA256 bdcd6e3e3960173d56bc7caec832aab11ba3c030063353c475fd9fd7953da77c
MD5 02f2985585fa72ceefa2957518268bf3
BLAKE2b-256 9647c7b5b0476c31bb98ee5877f0992e3c0cb4e33c4cc5a46c518953e996d42b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_liveops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 71.8 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e943f50f21769b70c849d8080ff1c0d6d83f05ec1d6d5c04c93d58881698833
MD5 032f04fc258f6fcf4e37c95f2ea1c348
BLAKE2b-256 b8066799e3a9246df99401125d4b1b7ff868773a1f48672424d75a9cc0ad7112

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