Registry / data / pm4py
library2.7.22.5pypypi✓ verified 84d ago

PM4Py is an open-source process mining library for Python. It supports process discovery, conformance checking, enhancement, and analysis of event logs. The current version is 2.7.22.2, with an active development cadence of about monthly releases.

pip install pm4py
INSTALL
IMPORT
SIG · PM4PY
P
pm4py
datapythonv2.7.22.5
Install
19.6s avg
Import
6196ms
Disk
513MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.22.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 6.338s · 494.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 19.6s · import 6.054s · 492MB
513MB installed
● package 513MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pm4py
import pm4py
All functionality is accessed through the main pm4py module.

Basic process discovery from a CSV event log using the Inductive Miner.

import pandas as pd import pm4py df = pd.read_csv('event_log.csv') eq = pm4py.format_dataframe(df, case_id='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp') net, im, fm = pm4py.discover_petri_net_inductive(eq) pm4py.view_petri_net(net, im, fm)
Debug
Known issues
gotchaPM4Py 2.x has a completely different API from PM4Py 1.x. Many old tutorials and examples are for 1.x and will not work.
fix
Use the simplified interface introduced in 2.x: functions like pm4py.discover_petri_net_inductive(), pm4py.conformance_token_based_replay(), etc. Check the official documentation for 2.x.
affects: >=2.0.0
deprecatedFunctions like pm4py.read_xes(), pm4py.read_csv(), and pm4py.discover_heuristics_net() are deprecated. Use their simplified interface equivalents that return pm4py objects directly.
fix
Use pm4py.read.read_xes(file_path) or pm4py.read_csv(csv_path) and use pm4py.discover_heuristics_petri_net() instead.
affects: >=2.7.0
breakingPolars support is experimental and APIs may change. Using Polars dataframes with format_dataframe may not be fully stable.
fix
Convert Polars dataframes to Pandas using .to_pandas() before passing to PM4Py functions unless you are using new Polars-specific methods.
affects: >=2.7.21
Errors
Common errors & fixes
AttributeError: module 'pm4py' has no attribute 'discover_petri_net_alpha'
The Alpha Miner is not available in the simplified interface of PM4Py 2.x.
fix
Use the legacy API: from pm4py.algo.discovery.alpha import algorithm as alpha_miner
net, im, fm = alpha_miner.apply(log)
pm4py.format_dataframe() KeyError: 'case:concept:name'
The required column 'case:concept:name' does not exist in the DataFrame. PM4Py expects column names to be exactly 'case:concept:name', 'concept:name', and 'time:timestamp'.
fix
Ensure your CSV has columns named 'case:concept:name', 'concept:name', and 'time:timestamp', or rename them before calling format_dataframe.
Upgrade
Version history
2.7.22.5latest on PyPI · released Jun 17, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
53 hits · last 30 days
node
50
Amazon
1
OpenAI (training)
1
Resources
pm4py — pip install pm4py · libregistry