Python
pip install "r4pm[polars]"- Needs Python 3.9 or newer.
- Where a prebuilt wheel exists for your platform, nothing else is needed. Otherwise pip builds the package from source, which needs a Rust toolchain and takes a few minutes.
- The
polarsextra adds the DataFrame features:r4pm.item_to_df,r4pm.import_item_from_dfand ther4pm.dfmodule. Without it, everything else works. - To match a specific version of these docs, pin it:
pip install "r4pm[polars]==0.6.2". pip install "r4pm-full[polars]"installs the samer4pmpackage with DuckDB support compiled in, for OCEL 2.0.duckdbfiles. It is about 15 MiB larger. Install one of the two, not both.
Command line
cargo install r4pmThis builds the CLI from source, so it needs a Rust toolchain. Run r4pm without arguments to list all commands. The CLI guide explains arguments and output files.
Rust
cargo add process_mining@=0.6.2The default build covers XES, OCEL 2.0 XML and JSON, the directly-follows graph and Alpha+++ discovery, alignments, OC-DECLARE and the linked OCEL types. Optional features add formats and integrations:
| Feature | What it adds |
|---|---|
ocel-sqlite | OCEL 2.0 SQLite import and export |
ocel-duckdb | OCEL 2.0 DuckDB import and export, using a system DuckDB library |
ocel-duckdb-bundled | The same with DuckDB compiled in (slower first build, no system library needed) |
ocel-bundle | The bundled OCEL 2.0 CSV format (.ocel.zip) |
ocel-bundle-parquet | Parquet storage inside OCEL bundles |
dataframes | Conversion between event data and polars DataFrames |
graphviz-export | PNG and SVG export of models (needs graphviz on the PATH) |
token-based-replay | Token-based replay conformance checking |
log-splitting | Splitting event logs into parts |
extraction-blueprint | Extracting OCELs from relational data with an extraction blueprint |
extraction-dbcon | Reading SQLite, CSV, Parquet and XLSX sources for extraction |
bindings | The function registry used by Python, the CLI and Propel |
all | Every optional feature at once, including PostgreSQL and DuckDB extraction sources |
Enable features with cargo add process_mining@=0.6.2 --features ocel-sqlite,dataframes, or in Cargo.toml:
[dependencies]
process_mining = { version = "=0.6.2", features = ["ocel-sqlite", "dataframes"] }The crate is in active development and its API can change in minor versions, so pin the version you build against.
Checking what you have
- Python:
pip show r4pm(orr4pm-full) prints the installed version.r4pm.__variant__is"default"or"full", andr4pm.has_feature("ocel-duckdb")tells whether DuckDB support is available. - Rust:
cargo tree -e features -i process_mininglists the enabled features.