Skip to content

Commit 11cfc18

Browse files
Merge remote-tracking branch 'upstream/hotfixes' into release
2 parents a8a9c0c + a02845c commit 11cfc18

15 files changed

Lines changed: 954 additions & 47 deletions

File tree

docs/source/api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Importing object-centric event logs is possible given the following formats:
2828

2929
Importing object-centric event logs (OCEL2.0) is possible given the following formats:
3030

31+
* bundled ``.ocel.zip`` CSV/Parquet specification :meth:`pm4py.read.read_ocel2_bundle`
32+
* compact ``.csv`` specification :meth:`pm4py.read.read_ocel2_csv`
3133
* ``.xmlocel`` specification :meth:`pm4py.read.read_ocel2_xml`
3234
* ``.sqlite`` specification :meth:`pm4py.read.read_ocel2_sqlite`
3335
* ``.jsonocel`` specification :meth:`pm4py.read.read_ocel2_json`
@@ -52,6 +54,8 @@ Exporting object-centric event logs is possible to the following formats:
5254

5355
Exporting object-centric event logs (OCEL2.0) is possible to the following formats:
5456

57+
* bundled ``.ocel.zip`` CSV/Parquet specification :meth:`pm4py.write.write_ocel2_bundle`
58+
* compact ``.csv`` specification :meth:`pm4py.write.write_ocel2_csv`
5559
* ``.xmlocel`` specification :meth:`pm4py.write.write_ocel2_xml`
5660
* ``.sqlite`` specification :meth:`pm4py.write.write_ocel2_sqlite`
5761
* ``.jsonocel`` specification :meth:`pm4py.write.write_ocel2_json`
@@ -429,6 +433,8 @@ List of Methods
429433
pm4py.read.read_ocel_json
430434
pm4py.read.read_ocel_xml
431435
pm4py.read.read_ocel_sqlite
436+
pm4py.read.read_ocel2_bundle
437+
pm4py.read.read_ocel2_csv
432438
pm4py.read.read_ocel2_xml
433439
pm4py.read.read_ocel2_sqlite
434440
pm4py.read.read_ocel2_json
@@ -442,6 +448,8 @@ List of Methods
442448
pm4py.write.write_ocel_json
443449
pm4py.write.write_ocel_xml
444450
pm4py.write.write_ocel_sqlite
451+
pm4py.write.write_ocel2_bundle
452+
pm4py.write.write_ocel2_csv
445453
pm4py.write.write_ocel2_xml
446454
pm4py.write.write_ocel2_sqlite
447455
pm4py.write.write_ocel2_json

pm4py/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
read_ocel_json,
6060
read_ocel_sqlite,
6161
read_ocel2,
62+
read_ocel2_bundle,
6263
read_ocel2_csv,
6364
read_ocel2_sqlite,
6465
read_ocel2_json,
@@ -76,6 +77,7 @@
7677
write_ocel_xml,
7778
write_ocel_sqlite,
7879
write_ocel2,
80+
write_ocel2_bundle,
7981
write_ocel2_csv,
8082
write_ocel2_sqlite,
8183
write_ocel2_xml,

pm4py/objects/ocel/exporter/__init__.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,4 @@
1-
'''
2-
PM4Py – A Process Mining Library for Python
3-
Copyright (C) 2026 Process Intelligence Solutions GmbH
4-
5-
This program is free software: you can redistribute it and/or modify
6-
it under the terms of the GNU Affero General Public License as
7-
published by the Free Software Foundation, either version 3 of the
8-
License, or any later version.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU Affero General Public License for more details.
14-
15-
You should have received a copy of the GNU Affero General Public License
16-
along with this program. If not, see this software project's root or
17-
visit <https://www.gnu.org/licenses/>.
18-
19-
Website: https://processintelligence.solutions
20-
Contact: info@processintelligence.solutions
21-
'''
22-
from pm4py.objects.ocel.exporter import util, csv, jsonocel
1+
from pm4py.objects.ocel.exporter import bundled, util, csv, jsonocel
232
import importlib.util
243

254
if importlib.util.find_spec("lxml"):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pm4py.objects.ocel.exporter.bundled import exporter, variants
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from enum import Enum
2+
from typing import Optional, Dict, Any
3+
4+
from pm4py.objects.ocel.exporter.bundled.variants import ocel20
5+
from pm4py.objects.ocel.obj import OCEL
6+
from pm4py.util import exec_utils
7+
8+
9+
class Variants(Enum):
10+
OCEL20 = ocel20
11+
12+
13+
def apply(
14+
ocel: OCEL,
15+
target_path: str,
16+
variant=Variants.OCEL20,
17+
parameters: Optional[Dict[Any, Any]] = None,
18+
):
19+
"""
20+
Exports an OCEL 2.0 log to the bundled CSV/Parquet format.
21+
"""
22+
return exec_utils.get_variant(variant).apply(
23+
ocel, target_path, parameters=parameters
24+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pm4py.objects.ocel.exporter.bundled.variants import ocel20

0 commit comments

Comments
 (0)