Extensions select the format
import_item and export_item in Python, the CLI, and import_from_path / export_to_path in Rust all read the format from the file extension. Some formats also come gzipped, e.g., log.xes.gz for XES and ocel.xml.gz for OCEL 2.0 XML. The table below lists which.
When a file has no telling extension, Rust's import_from_reader and export_to_writer take the format as a string (e.g., "xes.gz" or "xml").
Supported formats
| Kind | Import | Export |
|---|---|---|
| OCEL | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite |
| EventLog | .xes.xes.gz.json | .xes.xes.gz.json |
| EventLogActivityProjection | .json.xes.xes.gz | .json |
| SlimLinkedOCEL | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite |
| IndexLinkedOCEL | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite | .json.json.gz.xml.xml.gz.ocel.csv.ocel.csv.gz.sqlite |
The table is generated from the formats each type reports itself (known_import_formats and known_export_formats in the Importable and Exportable traits), for the types that the functions of this release use.
Optional formats in Rust
Some formats need a crate feature when you use the Rust library directly. The Python package includes SQLite support, and r4pm-full adds DuckDB (see installation).
| Format | Feature |
|---|---|
OCEL 2.0 SQLite (.sqlite) | ocel-sqlite |
OCEL 2.0 DuckDB (.duckdb) | ocel-duckdb (or ocel-duckdb-bundled) |
OCEL 2.0 bundle (.ocel.zip) | ocel-bundle, and ocel-bundle-parquet for Parquet storage |
Without the feature, importing such a file fails with an unsupported-format error. See installation for how to enable features.
OCEL 2.0 formats
The XML, JSON and SQLite formats are the three official OCEL 2.0 serializations, and other tools such as PM4Py read and write them too. .ocel.csv is a simpler table layout supported by Rust4PM.