A small EasyDAG extension with predefined websocket setup for API usage.
Project description
EasyDAG Web
EasyDAG Web is an optional companion package for EasyDAG that adds real-time event streaming, WebSocket integration, and browser-based monitoring.
It provides a lightweight event bus and emitter system designed to sit on top of EasyDAG’s interface API, enabling live DAG visualization, control, and external integrations.
What This Package Is
EasyDAG Web is:
- 🌐 A WebSocket-friendly event layer for EasyDAG
- 📡 A publish/subscribe event bus
- 🧩 A clean adapter between EasyDAG and web UIs
- 🖥 A reference implementation for live DAG monitoring
What This Package Is Not
- ❌ Not a DAG engine (that’s EasyDAG)
- ❌ Not required to use EasyDAG
- ❌ Not tied to any frontend framework
- ❌ Not a scheduler or persistence layer
Installation
pip install easydag-web
You must also install the core engine:
pip install easydag
Package Overview
This package provides:
-
DagEventBus A simple async-safe event bus supporting multiple subscribers.
-
DagEventEmitter A convenience wrapper for emitting structured DAG and node events.
-
WebSocketManager A helper for broadcasting events to connected WebSocket clients.
Example
Full Web Demo:
A complete FastAPI + WebSocket example is available on GitHub, showing:
- DAG execution
- Live event streaming
- Run / cancel controls
- Browser-based monitoring
Basic Usage
Create an Event Bus and Emitter
from EasyDAGWeb import DagEventBus, DagEventEmitter
bus = DagEventBus()
emitter = DagEventEmitter(bus)
Attach an Interface to EasyDAG
from EasyDAG import EasyInterface
class MyInterface(EasyInterface):
def __init__(self, dag, emitter):
self.emitter = emitter
super().__init__(dag)
def dag_started(self, dag_id, metadata=None):
self.emitter.emit({
"type": "dag_started",
"dagId": dag_id,
})
def node_finished(self, node_id, metadata=None):
self.emitter.node_finished(node_id)
This keeps your DAG logic and your presentation layer completely separate.
WebSocket Integration (FastAPI)
from fastapi import FastAPI, WebSocket
from EasyDAGWeb import DagEventBus
app = FastAPI()
bus = DagEventBus()
@app.websocket("/ws/dag")
async def dag_ws(ws: WebSocket):
await ws.accept()
async def sender(event):
await ws.send_json(event)
bus.register_sender(sender)
try:
while True:
await ws.receive_json()
finally:
bus.unregister_sender(sender)
Any event emitted on the bus is broadcast to all connected clients.
Full Web Demo
This package includes a complete working example:
examples/
└── full_web_demo/
├── dag.py
├── index.html
├── interface.py
└── server.py
Run the demo
uvicorn examples.full_web_demo.server:app --reload
Open:
http://localhost:8000
Demo Features
- Run / cancel DAG execution
- Live DAG lifecycle events
- Node progress and completion events
- WebSocket-driven control
- Browser console or UI-based monitoring
- Designed to pair with Vue Flow or similar libraries
Intended Use Cases
EasyDAG Web is ideal when you want to:
- Visualize DAG execution in real time
- Control DAG runs from a UI
- Stream DAG events to external systems
- Build dashboards or monitoring tools
- Integrate EasyDAG into web services
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easydag_web-0.1.3.tar.gz.
File metadata
- Download URL: easydag_web-0.1.3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fecabbf9329fc3c47ce65c3f0d25e0f91213c2430ff52a26b0ebac2579c97c0f
|
|
| MD5 |
fca636be04ada2b9a8542a80e66769e4
|
|
| BLAKE2b-256 |
a66476a52a89f43db3c8a9a244440532731a840171828f23b8e0e40c043e899e
|
Provenance
The following attestation bundles were made for easydag_web-0.1.3.tar.gz:
Publisher:
publish.yml on Mechatronicist/easyDAG-Web
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easydag_web-0.1.3.tar.gz -
Subject digest:
fecabbf9329fc3c47ce65c3f0d25e0f91213c2430ff52a26b0ebac2579c97c0f - Sigstore transparency entry: 782795113
- Sigstore integration time:
-
Permalink:
Mechatronicist/easyDAG-Web@c3d2e40c4c82b5d4846e05ad0702e13954661d63 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/Mechatronicist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3d2e40c4c82b5d4846e05ad0702e13954661d63 -
Trigger Event:
release
-
Statement type:
File details
Details for the file easydag_web-0.1.3-py3-none-any.whl.
File metadata
- Download URL: easydag_web-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c0d3d91006c653b09aeef53669a10068bc12c5e756081ff1d29860b51263527
|
|
| MD5 |
f26955500577745642996e9ff04a81cd
|
|
| BLAKE2b-256 |
bb9dd96cbd2c4bdf38464b14be9a866349ca3bbedd39a000c12d23f70dfc6696
|
Provenance
The following attestation bundles were made for easydag_web-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on Mechatronicist/easyDAG-Web
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easydag_web-0.1.3-py3-none-any.whl -
Subject digest:
0c0d3d91006c653b09aeef53669a10068bc12c5e756081ff1d29860b51263527 - Sigstore transparency entry: 782795120
- Sigstore integration time:
-
Permalink:
Mechatronicist/easyDAG-Web@c3d2e40c4c82b5d4846e05ad0702e13954661d63 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/Mechatronicist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c3d2e40c4c82b5d4846e05ad0702e13954661d63 -
Trigger Event:
release
-
Statement type: