scitex_events
scitex-events — general-purpose async event bus (standalone).
Emit events from CLI, HPC, or any process. Events are stored locally as state files and optionally forwarded to the cloud API via webhook.
Usage
>>> from scitex_events import emit, latest
>>> emit("test_complete", project="figrecipe", status="success",
... payload={"exit_code": 0, "module": "stats"})
>>> latest("test_complete")
{"type": "test_complete", "project": "figrecipe", ...}
- class scitex_events.Event(type, project, status='success', payload=<factory>, source='local', timestamp='')[source]
A single event in the SciTeX event bus.
- Parameters:
type (str) – Event type (e.g., “test_complete”, “job_done”, “build_result”).
project (str) – Project name this event belongs to.
status (str) – Outcome: “success” or “failure”.
payload (dict) – Arbitrary data specific to the event type.
source (str) – Where the event originated: “local”, “hpc”, “ci”.
timestamp (str) – ISO-format timestamp, auto-generated if not provided.
- scitex_events.emit(event_type, project, status='success', payload=None, source='local')[source]
Emit an event to state file and optional webhook.
Always writes to ~/.scitex/events/{type}_latest.json. Also appends to ~/.scitex/events/history.jsonl. If SCITEX_API_KEY is set, POSTs to the cloud API (best-effort).