pm4py
Process mining for Python
What it is and what it does
PM4Py is a Python library for process mining—the discipline of extracting process models and insights from event logs recorded by business systems. It provides algorithms to discover Petri nets and other process representations from raw event data, and tools to visualize and analyze those models. The library is built on scientific foundations and depends on numpy, pandas, networkx, scipy, and matplotlib for numerical computing, data handling, graph operations, and visualization.
Typical usage involves reading an event log (commonly in XES format), applying a discovery algorithm like inductive mining to generate a process model, and then viewing or analyzing the result. The package is actively maintained by Process Intelligence Solutions and is used in both academic research and industry applications. It carries an AGPL-3.0 license, meaning modifications must be shared under the same terms; commercial closed-source use requires a separate license.
Use it for:
- Discover Petri net models from event logs to understand actual business process flows.
- Analyze conformance between recorded process executions and expected process models.
- Visualize process models in multiple formats (SVG, PNG) for stakeholder communication.
- Extract process metrics and statistics from event logs for process improvement.
- Research and academic work on process mining algorithms and techniques.
- Audit and compliance checking by comparing recorded activities against approved workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PM4Py implements process mining algorithms to discover, analyze, and visualize process models from event logs, supporting formats like XES and outputting Petri nets and other process representations.
Yes, if you work with process mining or need to analyze event logs and discover process models. The package is actively maintained, has low install friction, and provides a mature implementation of standard algorithms. However, be aware of the AGPL-3.0 license requirement—if you plan closed-source use, you must obtain a commercial license. No known security vulnerabilities.
Install
pm4py on PyPI
pip
pip install pm4pyuv
uv add pm4pypoetry
poetry add pm4pyInstalling pm4py
Before you install
Low install friction with a pure-wheel distribution and 12 runtime dependencies that are all well-established scientific packages. Actively maintained with a recent release (4 days old) and steady commit activity.
License in practice
Licensed under AGPL-3.0, which requires that any modifications or derivative works be released under the same license and made available to users. Commercial use in closed-source environments requires a separate commercial license from Process Intelligence Solutions.
Quickstart
pip install pm4py
import pm4py
log = pm4py.read_xes('path-to-xes-log-file.xes')
net, initial_marking, final_marking = pm4py.discover_petri_net_inductive(log)
pm4py.view_petri_net(net, initial_marking, final_marking, format="svg")
Requires graphviz system library for visualization; XES log files must be provided as input.
Verify before relying
- Whether all 12 runtime dependencies are truly required for basic usage or if some are optional despite being listed as 'normal requirements'.
- Performance characteristics and scalability limits for large event logs.
- Availability and terms of the commercial license for closed-source use.
Package facts
| License | AGPL 3.0 (agpl) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 12 — numpy, pandas, networkx, graphviz, scipy, lxml, matplotlib, pytz, tqdm, wheel, setuptools, cvxopt |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 120,289/month — #12,035 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pm4py-2.7.23.4-py3-none-any.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
civisPython client library for programmatically…
permissive · top 15,000 on PyPI
SALibSALib implements global sensitivity analysis…
permissive · top 15,000 on PyPI
yellowbrickYellowbrick provides scikit-learn-integrated…
permissive · top 15,000 on PyPI
mlxtendMlxtend provides ensemble methods, feature…
permissive · top 5,000 on PyPI
MetPyMetPy provides tools for reading, visualizing,…
permissive · top 15,000 on PyPI
leidenalgImplements the Leiden community detection…
copyleft · top 15,000 on PyPI
pydotplusPyDotPlus provides a Python interface to…
permissive · top 15,000 on PyPI
sklearn2pmmlConverts fitted Scikit-Learn pipelines to PMML…
agpl · top 15,000 on PyPI
django-viewflowViewflow is a low-code library for building…
agpl · top 15,000 on PyPI