Skip to main content
Version: 0.0.98

ts_shape.eventlog

ts-shape canonical event-log package.

A lightweight, pm4py-compatible (XES + OCEL 2.0) representation of detector output. ts-shape itself adds no process-mining dependencies — the columns match the specs verbatim so users can hand the resulting DataFrames to pm4py / Disco / Celonis / OCEL viewers directly.

Typical use::

from ts_shape.eventlog import (
to_event_log, concat, to_event_log_xes, to_event_log_ocel,
)
from ts_shape.events.production.machine_state import MachineStateEvents
from ts_shape.events.quality.outlier_detection import OutlierDetectionEvents

state_log = to_event_log(
MachineStateEvents(df, run_state_uuid="m").detect_run_idle(),
detector="MachineStateEvents.detect_run_idle",
)
outlier_log = to_event_log(
OutlierDetectionEvents(df, value_column="value_double").detect_outliers_zscore(),
detector="OutlierDetectionEvents.detect_outliers_zscore",
)
log = concat(state_log, outlier_log)
xes_df = to_event_log_xes(log, case_object_type="asset")
tables = to_event_log_ocel(log) # OCEL2Tables(events, objects, relations, ...)