normalizer
normalizer ¤
Public to_event_log entry point — looks up the adapter and runs it.
to_event_log ¤
to_event_log(
df: DataFrame,
*,
detector: str,
objects: Mapping[str, object] | None = None,
qualifiers: Mapping[str, str] | None = None,
o2o: TableInput = None,
object_changes: TableInput = None,
validate: bool = True
) -> EventLog
Normalize a legacy detector DataFrame into the canonical event log.
detector is "ClassName.method_name" — the same key used in the
taxonomy registry and the value written to ts_shape:detector.
objects binds OCEL object types to either:
- a string column name in
df(e.g.{"asset": "source_uuid"}), - a callable taking a row dict and returning an oid,
- a
pd.Seriesaligned withdfrows, - a scalar broadcast to every row.
Caller-supplied bindings are always honored. Types listed in the
adapter's LabelRule.produces_objects are also auto-extracted from
standard legacy columns (e.g. source_uuid -> asset) when no explicit
binding is given.
o2o and object_changes optionally attach the OCEL 2.0
object-to-object relations and time-varying object attributes. Each
accepts a DataFrame (or an iterable of dict rows) with the canonical
columns — see :func:ts_shape.eventlog.schema.empty_o2o /
:func:~ts_shape.eventlog.schema.empty_object_changes.