{"id":24248,"library":"pm4py","title":"PM4Py - Process Mining for Python","description":"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.","status":"active","version":"2.7.22.2","language":"python","source_language":"en","source_url":"https://github.com/process-intelligence-solutions/pm4py","tags":["process mining","workflow","bpmn","petri net","event log","conformance checking"],"install":[{"cmd":"pip install pm4py","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"All functionality is accessed through the main pm4py module.","symbol":"pm4py","correct":"import pm4py"}],"quickstart":{"code":"import pandas as pd\nimport pm4py\n\ndf = pd.read_csv('event_log.csv')\neq = pm4py.format_dataframe(df, case_id='case:concept:name', activity_key='concept:name', timestamp_key='time:timestamp')\nnet, im, fm = pm4py.discover_petri_net_inductive(eq)\npm4py.view_petri_net(net, im, fm)","lang":"python","description":"Basic process discovery from a CSV event log using the Inductive Miner."},"warnings":[{"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.","message":"PM4Py 2.x has a completely different API from PM4Py 1.x. Many old tutorials and examples are for 1.x and will not work.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use pm4py.read.read_xes(file_path) or pm4py.read_csv(csv_path) and use pm4py.discover_heuristics_petri_net() instead.","message":"Functions like pm4py.read_xes(), pm4py.read_csv(), and pm4py.discover_heuristics_net() are deprecated. Use their simplified interface equivalents that return pm4py objects directly.","severity":"deprecated","affected_versions":">=2.7.0"},{"fix":"Convert Polars dataframes to Pandas using .to_pandas() before passing to PM4Py functions unless you are using new Polars-specific methods.","message":"Polars support is experimental and APIs may change. Using Polars dataframes with format_dataframe may not be fully stable.","severity":"breaking","affected_versions":">=2.7.21"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use the legacy API: from pm4py.algo.discovery.alpha import algorithm as alpha_miner\nnet, im, fm = alpha_miner.apply(log)","cause":"The Alpha Miner is not available in the simplified interface of PM4Py 2.x.","error":"AttributeError: module 'pm4py' has no attribute 'discover_petri_net_alpha'"},{"fix":"Ensure your CSV has columns named 'case:concept:name', 'concept:name', and 'time:timestamp', or rename them before calling format_dataframe.","cause":"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'.","error":"pm4py.format_dataframe() KeyError: 'case:concept:name'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}