The pm4py.ocel module contains the object-centric process mining features offered in pm4py


cluster_equivalent_ocel(ocel, object_type[, ...])

Perform a clustering of the object-centric event log, based on the 'executions' of a single object type.

discover_objects_graph(ocel[, graph_type])

Discovers an object graph from the provided object-centric event log

discover_oc_petri_net(ocel[, ...])

Discovers an object-centric Petri net from the provided object-centric event log.

discover_ocdfg(ocel[, business_hours, ...])

Discovers an OC-DFG from an object-centric event log.


Adds a small time-delta to the timestamp column based on the current index of the event.


Drop relations between events and objects happening at the same time, with the same activity, to the same object identifier.


Inserts lifecycle-based information (when an object is created/terminated or other types of relations) in the list of E2O relations of the OCEL

ocel_flattening(ocel, object_type)

Flattens the object-centric event log to a traditional event log with the choice of an object type.


Gets the list of attributes at the event and the object level of an object-centric event log (e.g.


Gets the list of object types contained in the object-centric event log (e.g., ["order", "item", "delivery"]).

ocel_merge_duplicates(ocel[, have_common_object])

Merge events in the OCEL that happen with the same activity at the same timestamp

ocel_o2o_enrichment(ocel[, included_graphs])

Inserts the information inferred from the graph computations (pm4py.discover_objects_graph) in the list of O2O relations of the OCEL.


Gets the set of activities performed for each object type


Gets the objects interactions summary of an object-centric event log.


Counts for each event the number of related objects per type


Gets the objects summary of an object-centric event log

ocel_sort_by_additional_column(ocel, ...[, ...])

Sorts the OCEL not only based on the timestamp column and the index, but using an additional sorting column that further determines the order of the events happening at the same timestamp.


Returns the ``temporal summary'' from an object-centric event log. The temporal summary aggregates all the events performed in the same timestamp, and reports the list of activities and the involved objects.

sample_ocel_connected_components(ocel[, ...])

Given an object-centric event log, returns a sampled event log with a subset of the executions.

sample_ocel_objects(ocel, num_objects)

Given an object-centric event log, returns a sampled event log with a subset of the objects that is chosen in a random way.