Skip to main content
Rust4PM

Installation and features

How to install Rust4PM for Python, the command line and Rust, and which optional features exist.

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 polars extra adds the DataFrame features: r4pm.item_to_df, r4pm.import_item_from_df and the r4pm.df module. 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 same r4pm package with DuckDB support compiled in, for OCEL 2.0 .duckdb files. It is about 15 MiB larger. Install one of the two, not both.

Command line

cargo install r4pm

This 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.2

The 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:

FeatureWhat it adds
ocel-sqliteOCEL 2.0 SQLite import and export
ocel-duckdbOCEL 2.0 DuckDB import and export, using a system DuckDB library
ocel-duckdb-bundledThe same with DuckDB compiled in (slower first build, no system library needed)
ocel-bundleThe bundled OCEL 2.0 CSV format (.ocel.zip)
ocel-bundle-parquetParquet storage inside OCEL bundles
dataframesConversion between event data and polars DataFrames
graphviz-exportPNG and SVG export of models (needs graphviz on the PATH)
token-based-replayToken-based replay conformance checking
log-splittingSplitting event logs into parts
extraction-blueprintExtracting OCELs from relational data with an extraction blueprint
extraction-dbconReading SQLite, CSV, Parquet and XLSX sources for extraction
bindingsThe function registry used by Python, the CLI and Propel
allEvery 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 (or r4pm-full) prints the installed version. r4pm.__variant__ is "default" or "full", and r4pm.has_feature("ocel-duckdb") tells whether DuckDB support is available.
  • Rust: cargo tree -e features -i process_mining lists the enabled features.