r4pm 0.3.1__cp313-cp313-win32.whl → 0.4.0__cp313-cp313-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- r4pm/__init__.py +5 -16
- r4pm/__init__.pyi +3 -117
- r4pm/bindings/__init__.py +2 -0
- r4pm/bindings/__init__.pyi +20 -8
- r4pm/bindings/bindings.py +34 -16
- r4pm/bindings/bindings.pyi +20 -8
- r4pm/df/__init__.py +20 -0
- r4pm/df/__init__.pyi +116 -0
- r4pm/{ocel_export.py → df/ocel_export.py} +1 -1
- r4pm/{ocel_import.py → df/ocel_import.py} +1 -1
- r4pm/{xes_export.py → df/xes_export.py} +1 -1
- r4pm/{xes_import.py → df/xes_import.py} +1 -1
- r4pm/r4pm.cp313-win32.pyd +0 -0
- {r4pm-0.3.1.dist-info → r4pm-0.4.0.dist-info}/METADATA +9 -9
- {r4pm-0.3.1.dist-info → r4pm-0.4.0.dist-info}/RECORD +18 -16
- {r4pm-0.3.1.dist-info → r4pm-0.4.0.dist-info}/WHEEL +0 -0
- {r4pm-0.3.1.dist-info → r4pm-0.4.0.dist-info}/licenses/LICENSE-APACHE +0 -0
- {r4pm-0.3.1.dist-info → r4pm-0.4.0.dist-info}/licenses/LICENSE-MIT +0 -0
r4pm/__init__.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
2
|
r4pm - Rust for process mining
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
- import_xes
|
|
6
|
-
- import_ocel_xml, import_ocel_json: OCEL2 object-centric logs
|
|
4
|
+
Simple DataFram API
|
|
5
|
+
- `df` with `import_xes`, `export_xes`, `import_ocel`, `import_ocel_pm4py`, etc.
|
|
7
6
|
|
|
8
7
|
Registry (for use with bindings):
|
|
9
8
|
- import_item, convert_item, export_item
|
|
@@ -15,19 +14,6 @@ Auto-generated bindings organized by module:
|
|
|
15
14
|
- Submodules: bindings.discovery, bindings.core, etc.
|
|
16
15
|
"""
|
|
17
16
|
|
|
18
|
-
from .xes_import import import_xes
|
|
19
|
-
from .xes_export import export_xes
|
|
20
|
-
from .ocel_import import (
|
|
21
|
-
import_ocel,
|
|
22
|
-
import_ocel_pm4py,
|
|
23
|
-
import_ocel_xml,
|
|
24
|
-
import_ocel_xml_pm4py,
|
|
25
|
-
import_ocel_json,
|
|
26
|
-
import_ocel_json_pm4py,
|
|
27
|
-
rs_ocel_to_pm4py
|
|
28
|
-
)
|
|
29
|
-
from .ocel_export import export_ocel, export_ocel_pm4py
|
|
30
|
-
|
|
31
17
|
from .r4pm import (
|
|
32
18
|
# Registry functions
|
|
33
19
|
import_item,
|
|
@@ -74,11 +60,14 @@ __all__ = [
|
|
|
74
60
|
# "export_xes_rs",
|
|
75
61
|
# "import_ocel_xml_rs",
|
|
76
62
|
# "import_ocel_json_rs",
|
|
63
|
+
# DataFrame submodule
|
|
64
|
+
"df",
|
|
77
65
|
# Bindings submodule
|
|
78
66
|
"bindings",
|
|
79
67
|
"__version__",
|
|
80
68
|
]
|
|
81
69
|
|
|
70
|
+
from . import df
|
|
82
71
|
# Import bindings submodule (auto-generated by build.rs during cargo build)
|
|
83
72
|
try:
|
|
84
73
|
from . import bindings
|
r4pm/__init__.pyi
CHANGED
|
@@ -2,122 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
"""
|
|
4
4
|
from typing import Any, Dict, List, Optional, Union
|
|
5
|
-
import polars as pl
|
|
6
|
-
|
|
7
|
-
# ============================================================================
|
|
8
|
-
# XES Import/Export
|
|
9
|
-
# ============================================================================
|
|
10
|
-
|
|
11
|
-
def import_xes(
|
|
12
|
-
path: str,
|
|
13
|
-
date_format: Optional[str] = None,
|
|
14
|
-
print_debug: Optional[bool] = None
|
|
15
|
-
) -> tuple[pl.DataFrame, str]:
|
|
16
|
-
"""
|
|
17
|
-
Import XES event log.
|
|
18
|
-
|
|
19
|
-
Args:
|
|
20
|
-
path: Path to .xes or .xes.gz file
|
|
21
|
-
date_format: Optional date format for parsing (see chrono strftime)
|
|
22
|
-
print_debug: Enable debug output
|
|
23
|
-
|
|
24
|
-
Returns:
|
|
25
|
-
Tuple of (DataFrame with events, JSON string with log metadata)
|
|
26
|
-
"""
|
|
27
|
-
...
|
|
28
|
-
|
|
29
|
-
def export_xes(df: pl.DataFrame, path: str) -> None:
|
|
30
|
-
"""
|
|
31
|
-
Export DataFrame as XES file.
|
|
32
|
-
|
|
33
|
-
Args:
|
|
34
|
-
df: Polars DataFrame with event data
|
|
35
|
-
path: Output path (.xes or .xes.gz)
|
|
36
|
-
"""
|
|
37
|
-
...
|
|
38
|
-
|
|
39
|
-
# ============================================================================
|
|
40
|
-
# OCEL Import
|
|
41
|
-
# ============================================================================
|
|
42
|
-
|
|
43
|
-
def rs_ocel_to_pm4py(ocel_rs: Dict[str, pl.DataFrame]) -> Any:
|
|
44
|
-
"""
|
|
45
|
-
Convert Polars OCEL DataFrames to PM4PY OCEL object.
|
|
46
|
-
|
|
47
|
-
Args:
|
|
48
|
-
ocel_rs: Dict of DataFrames from import_ocel_xml/json
|
|
49
|
-
|
|
50
|
-
Returns:
|
|
51
|
-
PM4PY OCEL object
|
|
52
|
-
"""
|
|
53
|
-
...
|
|
54
|
-
|
|
55
|
-
def import_ocel_xml(path: str) -> Dict[str, pl.DataFrame]:
|
|
56
|
-
"""
|
|
57
|
-
Import OCEL2 from XML.
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
61
|
-
"""
|
|
62
|
-
...
|
|
63
|
-
|
|
64
|
-
def import_ocel_xml_pm4py(path: str) -> Any:
|
|
65
|
-
"""
|
|
66
|
-
Import OCEL2 XML and convert to PM4PY format.
|
|
67
|
-
"""
|
|
68
|
-
...
|
|
69
|
-
|
|
70
|
-
def import_ocel_json(path: str) -> Dict[str, pl.DataFrame]:
|
|
71
|
-
"""
|
|
72
|
-
Import OCEL2 from JSON.
|
|
73
|
-
|
|
74
|
-
Returns:
|
|
75
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
76
|
-
"""
|
|
77
|
-
...
|
|
78
|
-
|
|
79
|
-
def import_ocel_json_pm4py(path: str) -> Any:
|
|
80
|
-
"""
|
|
81
|
-
Import OCEL2 JSON and convert to PM4PY format.
|
|
82
|
-
"""
|
|
83
|
-
...
|
|
84
|
-
|
|
85
|
-
def import_ocel(path: str) -> dict[str, pl.DataFrame]:
|
|
86
|
-
"""
|
|
87
|
-
Import OCEL2 from File.
|
|
88
|
-
|
|
89
|
-
Returns:
|
|
90
|
-
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
91
|
-
"""
|
|
92
|
-
...
|
|
93
|
-
|
|
94
|
-
def import_ocel_pm4py(path: str):
|
|
95
|
-
"""Import OCEL2 JSON and convert to PM4PY format."""
|
|
96
|
-
...
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def export_ocel(ocel: dict[str, pl.DataFrame], path: str):
|
|
100
|
-
"""
|
|
101
|
-
Export Polars OCEL DataFrames to File
|
|
102
|
-
|
|
103
|
-
Args:
|
|
104
|
-
ocel: Dict of DataFrames from import_ocel_xml/json
|
|
105
|
-
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
106
|
-
|
|
107
|
-
"""
|
|
108
|
-
...
|
|
109
|
-
|
|
110
|
-
def export_ocel_pm4py(ocel, path: str):
|
|
111
|
-
"""
|
|
112
|
-
Export PM4Py OCEL to File
|
|
113
|
-
|
|
114
|
-
Args:
|
|
115
|
-
ocel: PM4Py OCEL object
|
|
116
|
-
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
117
|
-
|
|
118
|
-
"""
|
|
119
|
-
...
|
|
120
|
-
|
|
121
5
|
# ============================================================================
|
|
122
6
|
# Registry Functions
|
|
123
7
|
# ============================================================================
|
|
@@ -234,6 +118,8 @@ def call_binding(function_id: str, args_json: str) -> str:
|
|
|
234
118
|
# Bindings submodule (organized by Rust module structure)
|
|
235
119
|
from . import bindings as bindings
|
|
236
120
|
|
|
237
|
-
__all__: List[str]
|
|
238
121
|
|
|
122
|
+
from . import df as df
|
|
123
|
+
|
|
124
|
+
__all__: List[str]
|
|
239
125
|
__version__: str
|
r4pm/bindings/__init__.py
CHANGED
|
@@ -22,6 +22,7 @@ from .bindings import index_link_ocel
|
|
|
22
22
|
from .core.event_data.case_centric.utils.activity_projection import log_to_activity_projection
|
|
23
23
|
from .bindings import num_events
|
|
24
24
|
from .bindings import num_objects
|
|
25
|
+
from .bindings import slim_link_ocel
|
|
25
26
|
from .bindings import test_some_inputs
|
|
26
27
|
|
|
27
28
|
__all__ = [
|
|
@@ -36,5 +37,6 @@ __all__ = [
|
|
|
36
37
|
"log_to_activity_projection",
|
|
37
38
|
"num_events",
|
|
38
39
|
"num_objects",
|
|
40
|
+
"slim_link_ocel",
|
|
39
41
|
"test_some_inputs",
|
|
40
42
|
]
|
r4pm/bindings/__init__.pyi
CHANGED
|
@@ -9,6 +9,23 @@ from . import bindings as bindings
|
|
|
9
9
|
from . import core as core
|
|
10
10
|
from . import discovery as discovery
|
|
11
11
|
|
|
12
|
+
def test_some_inputs(s: str, n: int, i: int, f: float, b: bool) -> str:
|
|
13
|
+
"""
|
|
14
|
+
This is a test function.
|
|
15
|
+
**This should be bold**, *this is italic*, `and this code`.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
s: str
|
|
19
|
+
n: int
|
|
20
|
+
i: int
|
|
21
|
+
f: float
|
|
22
|
+
b: bool
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
str
|
|
26
|
+
"""
|
|
27
|
+
...
|
|
28
|
+
|
|
12
29
|
def num_objects(ocel: str) -> int:
|
|
13
30
|
"""
|
|
14
31
|
Get the number of objects in an [`OCEL`]
|
|
@@ -21,17 +38,12 @@ def num_objects(ocel: str) -> int:
|
|
|
21
38
|
"""
|
|
22
39
|
...
|
|
23
40
|
|
|
24
|
-
def
|
|
41
|
+
def slim_link_ocel(ocel: str) -> str:
|
|
25
42
|
"""
|
|
26
|
-
|
|
27
|
-
**This should be bold**, *this is italic*, `and this code`.
|
|
43
|
+
Convert an [`OCEL`] to an [`SlimLinkedOCEL`]
|
|
28
44
|
|
|
29
45
|
Args:
|
|
30
|
-
|
|
31
|
-
n: int
|
|
32
|
-
i: int
|
|
33
|
-
f: float
|
|
34
|
-
b: bool
|
|
46
|
+
ocel: Registry ID for OCEL
|
|
35
47
|
|
|
36
48
|
Returns:
|
|
37
49
|
str
|
r4pm/bindings/bindings.py
CHANGED
|
@@ -5,6 +5,32 @@ DO NOT EDIT - Generated by build.rs
|
|
|
5
5
|
"""
|
|
6
6
|
from typing import Any, Dict, List, Optional
|
|
7
7
|
|
|
8
|
+
def test_some_inputs(s: str, n: int, i: int, f: float, b: bool) -> str:
|
|
9
|
+
"""
|
|
10
|
+
This is a test function.
|
|
11
|
+
**This should be bold**, *this is italic*, `and this code`.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
s: str
|
|
15
|
+
n: int
|
|
16
|
+
i: int
|
|
17
|
+
f: float
|
|
18
|
+
b: bool
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
str
|
|
22
|
+
"""
|
|
23
|
+
import json
|
|
24
|
+
from ..r4pm import call_binding
|
|
25
|
+
args_dict = {}
|
|
26
|
+
args_dict["s"] = s
|
|
27
|
+
args_dict["n"] = n
|
|
28
|
+
args_dict["i"] = i
|
|
29
|
+
args_dict["f"] = f
|
|
30
|
+
args_dict["b"] = b
|
|
31
|
+
result = call_binding("process_mining::bindings::test_some_inputs", json.dumps(args_dict))
|
|
32
|
+
return json.loads(result)
|
|
33
|
+
|
|
8
34
|
def num_objects(ocel: str) -> int:
|
|
9
35
|
"""
|
|
10
36
|
Get the number of objects in an [`OCEL`]
|
|
@@ -22,30 +48,21 @@ def num_objects(ocel: str) -> int:
|
|
|
22
48
|
result = call_binding("process_mining::bindings::num_objects", json.dumps(args_dict))
|
|
23
49
|
return json.loads(result)
|
|
24
50
|
|
|
25
|
-
def
|
|
51
|
+
def slim_link_ocel(ocel: str) -> str:
|
|
26
52
|
"""
|
|
27
|
-
|
|
28
|
-
**This should be bold**, *this is italic*, `and this code`.
|
|
53
|
+
Convert an [`OCEL`] to an [`SlimLinkedOCEL`]
|
|
29
54
|
|
|
30
55
|
Args:
|
|
31
|
-
|
|
32
|
-
n: int
|
|
33
|
-
i: int
|
|
34
|
-
f: float
|
|
35
|
-
b: bool
|
|
56
|
+
ocel: Registry ID for OCEL
|
|
36
57
|
|
|
37
58
|
Returns:
|
|
38
|
-
|
|
59
|
+
Registry ID for SlimLinkedOCEL
|
|
39
60
|
"""
|
|
40
61
|
import json
|
|
41
62
|
from ..r4pm import call_binding
|
|
42
63
|
args_dict = {}
|
|
43
|
-
args_dict["
|
|
44
|
-
|
|
45
|
-
args_dict["i"] = i
|
|
46
|
-
args_dict["f"] = f
|
|
47
|
-
args_dict["b"] = b
|
|
48
|
-
result = call_binding("process_mining::bindings::test_some_inputs", json.dumps(args_dict))
|
|
64
|
+
args_dict["ocel"] = ocel
|
|
65
|
+
result = call_binding("process_mining::bindings::slim_link_ocel", json.dumps(args_dict))
|
|
49
66
|
return json.loads(result)
|
|
50
67
|
|
|
51
68
|
def num_events(ocel: str) -> int:
|
|
@@ -83,8 +100,9 @@ def index_link_ocel(ocel: str) -> str:
|
|
|
83
100
|
return json.loads(result)
|
|
84
101
|
|
|
85
102
|
__all__ = [
|
|
86
|
-
"num_objects",
|
|
87
103
|
"test_some_inputs",
|
|
104
|
+
"num_objects",
|
|
105
|
+
"slim_link_ocel",
|
|
88
106
|
"num_events",
|
|
89
107
|
"index_link_ocel",
|
|
90
108
|
]
|
r4pm/bindings/bindings.pyi
CHANGED
|
@@ -5,6 +5,23 @@ DO NOT EDIT - Generated by build.rs
|
|
|
5
5
|
"""
|
|
6
6
|
from typing import Any, Dict, List, Optional
|
|
7
7
|
|
|
8
|
+
def test_some_inputs(s: str, n: int, i: int, f: float, b: bool) -> str:
|
|
9
|
+
"""
|
|
10
|
+
This is a test function.
|
|
11
|
+
**This should be bold**, *this is italic*, `and this code`.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
s: str
|
|
15
|
+
n: int
|
|
16
|
+
i: int
|
|
17
|
+
f: float
|
|
18
|
+
b: bool
|
|
19
|
+
|
|
20
|
+
Returns:
|
|
21
|
+
str
|
|
22
|
+
"""
|
|
23
|
+
...
|
|
24
|
+
|
|
8
25
|
def num_objects(ocel: str) -> int:
|
|
9
26
|
"""
|
|
10
27
|
Get the number of objects in an [`OCEL`]
|
|
@@ -17,17 +34,12 @@ def num_objects(ocel: str) -> int:
|
|
|
17
34
|
"""
|
|
18
35
|
...
|
|
19
36
|
|
|
20
|
-
def
|
|
37
|
+
def slim_link_ocel(ocel: str) -> str:
|
|
21
38
|
"""
|
|
22
|
-
|
|
23
|
-
**This should be bold**, *this is italic*, `and this code`.
|
|
39
|
+
Convert an [`OCEL`] to an [`SlimLinkedOCEL`]
|
|
24
40
|
|
|
25
41
|
Args:
|
|
26
|
-
|
|
27
|
-
n: int
|
|
28
|
-
i: int
|
|
29
|
-
f: float
|
|
30
|
-
b: bool
|
|
42
|
+
ocel: Registry ID for OCEL
|
|
31
43
|
|
|
32
44
|
Returns:
|
|
33
45
|
str
|
r4pm/df/__init__.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Simple DataFrame API for r4pm
|
|
3
|
+
|
|
4
|
+
Import/Export:
|
|
5
|
+
- import_xes, export_xes: XES event logs
|
|
6
|
+
- import_ocel, import_ocel_pm4py, ...: OCEL2 object-centric logs
|
|
7
|
+
"""
|
|
8
|
+
from .ocel_import import (
|
|
9
|
+
import_ocel,
|
|
10
|
+
import_ocel_pm4py,
|
|
11
|
+
import_ocel_xml,
|
|
12
|
+
import_ocel_xml_pm4py,
|
|
13
|
+
import_ocel_json,
|
|
14
|
+
import_ocel_json_pm4py,
|
|
15
|
+
rs_ocel_to_pm4py
|
|
16
|
+
)
|
|
17
|
+
from .ocel_export import export_ocel, export_ocel_pm4py
|
|
18
|
+
|
|
19
|
+
from .xes_import import import_xes
|
|
20
|
+
from .xes_export import export_xes
|
r4pm/df/__init__.pyi
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from typing import Any, Dict, Optional
|
|
2
|
+
import polars as pl
|
|
3
|
+
|
|
4
|
+
# ============================================================================
|
|
5
|
+
# XES Import/Export
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
def import_xes(
|
|
9
|
+
path: str,
|
|
10
|
+
date_format: Optional[str] = None,
|
|
11
|
+
print_debug: Optional[bool] = None
|
|
12
|
+
) -> tuple[pl.DataFrame, str]:
|
|
13
|
+
"""
|
|
14
|
+
Import XES event log.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
path: Path to .xes or .xes.gz file
|
|
18
|
+
date_format: Optional date format for parsing (see chrono strftime)
|
|
19
|
+
print_debug: Enable debug output
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
Tuple of (DataFrame with events, JSON string with log metadata)
|
|
23
|
+
"""
|
|
24
|
+
...
|
|
25
|
+
|
|
26
|
+
def export_xes(df: pl.DataFrame, path: str) -> None:
|
|
27
|
+
"""
|
|
28
|
+
Export DataFrame as XES file.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
df: Polars DataFrame with event data
|
|
32
|
+
path: Output path (.xes or .xes.gz)
|
|
33
|
+
"""
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
# ============================================================================
|
|
37
|
+
# OCEL Import
|
|
38
|
+
# ============================================================================
|
|
39
|
+
|
|
40
|
+
def rs_ocel_to_pm4py(ocel_rs: Dict[str, pl.DataFrame]) -> Any:
|
|
41
|
+
"""
|
|
42
|
+
Convert Polars OCEL DataFrames to PM4PY OCEL object.
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
ocel_rs: Dict of DataFrames from import_ocel_xml/json
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
PM4PY OCEL object
|
|
49
|
+
"""
|
|
50
|
+
...
|
|
51
|
+
|
|
52
|
+
def import_ocel_xml(path: str) -> Dict[str, pl.DataFrame]:
|
|
53
|
+
"""
|
|
54
|
+
Import OCEL2 from XML.
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
58
|
+
"""
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
def import_ocel_xml_pm4py(path: str) -> Any:
|
|
62
|
+
"""
|
|
63
|
+
Import OCEL2 XML and convert to PM4PY format.
|
|
64
|
+
"""
|
|
65
|
+
...
|
|
66
|
+
|
|
67
|
+
def import_ocel_json(path: str) -> Dict[str, pl.DataFrame]:
|
|
68
|
+
"""
|
|
69
|
+
Import OCEL2 from JSON.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
73
|
+
"""
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
def import_ocel_json_pm4py(path: str) -> Any:
|
|
77
|
+
"""
|
|
78
|
+
Import OCEL2 JSON and convert to PM4PY format.
|
|
79
|
+
"""
|
|
80
|
+
...
|
|
81
|
+
|
|
82
|
+
def import_ocel(path: str) -> dict[str, pl.DataFrame]:
|
|
83
|
+
"""
|
|
84
|
+
Import OCEL2 from File.
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
|
|
88
|
+
"""
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
def import_ocel_pm4py(path: str):
|
|
92
|
+
"""Import OCEL2 JSON and convert to PM4PY format."""
|
|
93
|
+
...
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def export_ocel(ocel: dict[str, pl.DataFrame], path: str):
|
|
97
|
+
"""
|
|
98
|
+
Export Polars OCEL DataFrames to File
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
ocel: Dict of DataFrames from import_ocel_xml/json
|
|
102
|
+
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
103
|
+
|
|
104
|
+
"""
|
|
105
|
+
...
|
|
106
|
+
|
|
107
|
+
def export_ocel_pm4py(ocel, path: str):
|
|
108
|
+
"""
|
|
109
|
+
Export PM4Py OCEL to File
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
ocel: PM4Py OCEL object
|
|
113
|
+
path: Output path (e.g., .ocel.xml or .ocel.json)
|
|
114
|
+
|
|
115
|
+
"""
|
|
116
|
+
...
|
r4pm/r4pm.cp313-win32.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: r4pm
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -103,28 +103,28 @@ for item in r4pm.list_items():
|
|
|
103
103
|
|
|
104
104
|
## Simple Import/Export API
|
|
105
105
|
|
|
106
|
-
For direct DataFrame operations without the registry
|
|
106
|
+
For direct DataFrame operations without the registry, use the `df` submodule.
|
|
107
107
|
|
|
108
108
|
### XES
|
|
109
109
|
```python
|
|
110
110
|
import r4pm
|
|
111
111
|
|
|
112
112
|
# Import returns (DataFrame, log_attributes_json)
|
|
113
|
-
xes, attrs = r4pm.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
114
|
-
r4pm.export_xes(xes, "test_data/output.xes")
|
|
113
|
+
xes, attrs = r4pm.df.import_xes("file.xes", date_format="%Y-%m-%d")
|
|
114
|
+
r4pm.df.export_xes(xes, "test_data/output.xes")
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
### OCEL
|
|
118
118
|
```python
|
|
119
119
|
# Returns dict with DataFrames: events, objects, relations, o2o, object_changes
|
|
120
|
-
ocel = r4pm.import_ocel("file.xml")
|
|
120
|
+
ocel = r4pm.df.import_ocel("file.xml")
|
|
121
121
|
print(ocel['events'].shape)
|
|
122
|
-
r4pm.export_ocel(ocel, "export.xml")
|
|
122
|
+
r4pm.df.export_ocel(ocel, "export.xml")
|
|
123
123
|
|
|
124
124
|
# PM4Py integration (requires pm4py)
|
|
125
|
-
ocel_pm4py = r4pm.import_ocel_pm4py("file.xml")
|
|
125
|
+
ocel_pm4py = r4pm.df.import_ocel_pm4py("file.xml")
|
|
126
126
|
print(ocel['events'].shape)
|
|
127
|
-
r4pm.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
127
|
+
r4pm.df.export_ocel_pm4py(ocel_pm4py, "export.xml")
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
## Development
|
|
@@ -175,7 +175,7 @@ The test suite (`test_all.py`) covers:
|
|
|
175
175
|
- Automatic type conversion (positional & keyword arguments)
|
|
176
176
|
- Process discovery (DFG, OC-Declare)
|
|
177
177
|
- Registry operations (CRUD, DataFrames, export)
|
|
178
|
-
- Simple Import/Export DataFrame API
|
|
178
|
+
- Simple Import/Export DataFrame (`df`) API
|
|
179
179
|
- Edge cases and conversion caching
|
|
180
180
|
|
|
181
181
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
r4pm\__init__.py,sha256
|
|
2
|
-
r4pm\__init__.pyi,sha256=
|
|
3
|
-
r4pm\bindings\__init__.py,sha256=
|
|
4
|
-
r4pm\bindings\__init__.pyi,sha256=
|
|
5
|
-
r4pm\bindings\bindings.py,sha256=
|
|
6
|
-
r4pm\bindings\bindings.pyi,sha256=
|
|
1
|
+
r4pm\__init__.py,sha256=-_F2VD5zJwHZAjGPviKwwDlLNfVuO1kOSVkNxoVjHyY,2022
|
|
2
|
+
r4pm\__init__.pyi,sha256=afC2feu_lr1zcvvNlvaYEFUlC_FOZ-9QZsgVCJwB4Ys,3574
|
|
3
|
+
r4pm\bindings\__init__.py,sha256=h70PTUtDPMfkLnVg8Ke6ytXw6d8UxgHknsJwigaBfSg,1279
|
|
4
|
+
r4pm\bindings\__init__.pyi,sha256=J58DWtphXDbWWg7qBPOdrEqs6mZsxdj_5McxJLnbWME,2785
|
|
5
|
+
r4pm\bindings\bindings.py,sha256=TR-D4XBSN10D-vYR5lVrj53kHZvJsOm9eeX64pl2Dts,2509
|
|
6
|
+
r4pm\bindings\bindings.pyi,sha256=TBhUxl174Cfm5MLv75XF86G8AuO06Cumd_kRKfiPMWc,1183
|
|
7
7
|
r4pm\bindings\core\__init__.py,sha256=y-83KlJdQURv4YigjUIDHPRlsnzq9e5HMHTQdAV6ltw,128
|
|
8
8
|
r4pm\bindings\core\__init__.pyi,sha256=fWvA2es1QOGExAEe884AZsP_hSvjwmqfw5fYJKYFeJU,149
|
|
9
9
|
r4pm\bindings\core\event_data\__init__.py,sha256=N12S6mxamjF1OD8w3TCkD8zACKQCEyR0-AQazuxe07g,85
|
|
@@ -36,14 +36,16 @@ r4pm\bindings\discovery\object_centric\__init__.py,sha256=Haf4jhDCQA3dzG7ZGwcxGq
|
|
|
36
36
|
r4pm\bindings\discovery\object_centric\__init__.pyi,sha256=OAMPALoQ4IaLRgOCxsqfPeIv5Eq4wbEwdUqZD0WAH8U,89
|
|
37
37
|
r4pm\bindings\discovery\object_centric\oc_declare.py,sha256=dHBFcMrkOn7d0x_3ChC0qU1Lu27EKreRMNrdFcq6ajQ,858
|
|
38
38
|
r4pm\bindings\discovery\object_centric\oc_declare.pyi,sha256=-gRTKBSH_BOJDMumjTnfq4MNQcJgky8PGKUZpPHdS-g,493
|
|
39
|
-
r4pm\
|
|
40
|
-
r4pm\
|
|
39
|
+
r4pm\df\__init__.py,sha256=M4z6J_MOZG2A5N3eKNeXqaFtNuM6BpjzCLhQXMjIFA4,505
|
|
40
|
+
r4pm\df\__init__.pyi,sha256=D6_AMrMI5Z5FTIqbAeLiP9IvlXqOJdUP8TxWErO7wx0,2926
|
|
41
|
+
r4pm\df\ocel_export.py,sha256=3SdIAMui5waYH70qxdgF6A1hJrZ1Cg_FiIxXOzHfmWg,891
|
|
42
|
+
r4pm\df\ocel_import.py,sha256=W3Ee1Ke1jxXQsTCXH73sY0WDcYANmulNnOPHvXDbrD8,2567
|
|
43
|
+
r4pm\df\xes_export.py,sha256=RixK1yMjGvTiWyr7nxLuV5QDiMvDpR8AnQKt4Jnp9ck,300
|
|
44
|
+
r4pm\df\xes_import.py,sha256=2TtfP0yDWlzNfqEdp7xXNEDSjvrY8Y6bU9h093pxbHE,589
|
|
41
45
|
r4pm\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
r4pm\r4pm.cp313-win32.pyd,sha256=
|
|
43
|
-
r4pm\
|
|
44
|
-
r4pm\
|
|
45
|
-
r4pm-0.
|
|
46
|
-
r4pm-0.
|
|
47
|
-
r4pm-0.
|
|
48
|
-
r4pm-0.3.1.dist-info\licenses\LICENSE-MIT,sha256=2CCOFmepqZzKKOdp2QqkrIgarBPr4vapBbDdMRLu-Pg,1084
|
|
49
|
-
r4pm-0.3.1.dist-info\RECORD,,
|
|
46
|
+
r4pm\r4pm.cp313-win32.pyd,sha256=NkCs7ke8-1FJWhjzkd3kpoez20V6SOx9fh6yA4IzbaM,21243904
|
|
47
|
+
r4pm-0.4.0.dist-info\METADATA,sha256=uLB0_IBq7KuQT45xifZrjJ9TAgH4QK5zBd_5oFyWAso,5786
|
|
48
|
+
r4pm-0.4.0.dist-info\WHEEL,sha256=Cw8WHiTAxD13jJGlvlJfywEZWo8-FmYMQodsvB-1j_c,93
|
|
49
|
+
r4pm-0.4.0.dist-info\licenses\LICENSE-APACHE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
|
|
50
|
+
r4pm-0.4.0.dist-info\licenses\LICENSE-MIT,sha256=2CCOFmepqZzKKOdp2QqkrIgarBPr4vapBbDdMRLu-Pg,1084
|
|
51
|
+
r4pm-0.4.0.dist-info\RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|