A Python package for calculating process performance indicators
Project description
Process Performance Indicators
A Python library for calculating 310 process performance indicators from event logs. The library supports multiple event log formats and provides indicators across 5 dimensions (Time, Cost, Quality, Flexibility, General) at 4 granularity levels (activities, cases, groups, instances).
Features
- Comprehensive indicator coverage: 310 indicators across time, cost, quality, flexibility, and general dimensions
- Multiple granularities: Calculate metrics at activity, case, group, or instance level
- Flexible input formats: Support for atomic, derivable, production-style, and explicit interval event logs
- Automatic format detection: The library detects your log format and converts it to the required structure
- Batch execution: Run all indicators at once or filter by dimension/granularity
Installation
From PyPI
# Using uv (recommended)
uv add process-performance-indicators
# Using pip
pip install process-performance-indicators
From Source
git clone https://github.com/nicoabarca/process-performance-indicators.git
cd process-performance-indicators
uv sync --dev # or: pip install -e .
Requirements
- Python 3.10 or higher
- pandas >= 2.2.3
- tqdm >= 4.67.1
Quick Start
import pandas as pd
from process_performance_indicators import (
event_log_formatter,
run_indicators_to_csv,
StandardColumnMapping,
IndicatorArguments,
)
# 1. Load your event log
raw_log = pd.read_csv("my_event_log.csv")
# 2. Define column mapping
column_mapping = StandardColumnMapping(
case_id_key="CaseID",
activity_key="Activity",
timestamp_key="Timestamp",
)
# 3. Format the event log
formatted_log = event_log_formatter(raw_log, column_mapping)
# 4. Define indicator arguments
args = IndicatorArguments(
case_id="CASE-001",
activity_name="Review Application",
)
# 5. Run indicators and save results
results = run_indicators_to_csv(
formatted_log,
args,
csv_path="results.csv",
verbose=True,
)
print(results.head())
Event Log Formats
The library supports 4 event log formats:
| Format | Description | Required Columns |
|---|---|---|
| Atomic | Simplest format with single timestamp | case_id, activity, timestamp |
| Derivable Interval | Has lifecycle transitions (start/complete) | case_id, activity, timestamp, lifecycle |
| Production-Style | Separate start and end timestamps | case_id, activity, start_timestamp, end_timestamp |
| Explicit Interval | Full format with lifecycle and instance IDs | case_id, activity, timestamp, lifecycle, instance_id |
The event_log_formatter() function automatically detects your format and converts it to explicit interval format.
Indicator Dimensions and Granularities
Dimensions
| Dimension | Description | Examples |
|---|---|---|
| Time | Duration and timing metrics | Lead time, service time, waiting time, cycle time |
| Cost | Financial metrics | Total cost, labor cost, fixed/variable cost ratios |
| Quality | Output and success metrics | Outcome units, success rate, rework percentage |
| Flexibility | Adaptability metrics | Activity flexibility, resource flexibility |
| General | Count and occurrence metrics | Activity count, case count, rework count |
Granularities
| Granularity | Scope | Example |
|---|---|---|
| instances | Single activity execution | Service time for instance "inst-001" |
| activities | All instances of an activity | Total lead time for "Review" activity |
| cases | All activities in a case | Total cost for case "C1" |
| groups | Multiple cases (filtered) | Average cycle time for cases in January |
Running Indicators
Single Indicator
from process_performance_indicators.indicators.time import activities as time_activities
lead_time = time_activities.lead_time(formatted_log, activity_name="Review")
Multiple Indicators
from process_performance_indicators import run_indicators, IndicatorArguments
args = IndicatorArguments(
case_id="C1",
activity_name="Review",
aggregation_mode="sgl",
)
# Run all indicators
results = run_indicators(formatted_log, args, verbose=True)
# Or filter by dimension/granularity
results = run_indicators(
formatted_log,
args,
dimension=["time", "cost"],
granularity=["cases"],
)
Saving Results
from process_performance_indicators import run_indicators_to_csv
results = run_indicators_to_csv(
formatted_log,
args,
csv_path="indicator_results.csv",
verbose=True,
)
Examples
The examples/ folder contains working examples with multiple datasets:
- Datasets: 9 sample event logs in various formats (atomic, derivable, production-style, explicit)
- Execution script:
execute_indicators.pydemonstrates the full pipeline - Configuration:
dataset_configs.jsonprovides column mappings for each dataset - Batch runner:
run_all_examples.shexecutes all examples
To run all examples:
cd examples
./run_all_examples.sh
See the Examples documentation for detailed usage.
Documentation
Full documentation is available at: https://nicoabarca.github.io/process-performance-indicators/
- Installation - Detailed installation instructions
- Usage Guide - Learn how to load, format, and analyze event logs
- Examples - Working examples with sample datasets
- API Reference - Explore all available indicators
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file process_performance_indicators-0.2.1.tar.gz.
File metadata
- Download URL: process_performance_indicators-0.2.1.tar.gz
- Upload date:
- Size: 600.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f82562fba7947cf7378f5bf6240e7f2d93dc13eec0f28dba2d6f294742aeb98
|
|
| MD5 |
a097c8336a643c3453a66418ee590519
|
|
| BLAKE2b-256 |
a8f2b9dc244a0eb30fa6e09a7e9380990f1f66565186c49537b7c7ceb933aace
|
Provenance
The following attestation bundles were made for process_performance_indicators-0.2.1.tar.gz:
Publisher:
python-publish.yml on nicoabarca/process-performance-indicators
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
process_performance_indicators-0.2.1.tar.gz -
Subject digest:
6f82562fba7947cf7378f5bf6240e7f2d93dc13eec0f28dba2d6f294742aeb98 - Sigstore transparency entry: 870172356
- Sigstore integration time:
-
Permalink:
nicoabarca/process-performance-indicators@40c0c13f9faec06d6eeb145ddbeb6e8a0fd8e9e3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/nicoabarca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@40c0c13f9faec06d6eeb145ddbeb6e8a0fd8e9e3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file process_performance_indicators-0.2.1-py3-none-any.whl.
File metadata
- Download URL: process_performance_indicators-0.2.1-py3-none-any.whl
- Upload date:
- Size: 63.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0d089311afa93f39c6e07048e9928b0dc6c7e8a6e2073a24027b357bed365c7
|
|
| MD5 |
af033fe8434baecacd8e65096f71e1f9
|
|
| BLAKE2b-256 |
59ee6cc5716bd2d7eb422c22a6af579fd13cb61104b9eae5372d9d83fa57287f
|
Provenance
The following attestation bundles were made for process_performance_indicators-0.2.1-py3-none-any.whl:
Publisher:
python-publish.yml on nicoabarca/process-performance-indicators
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
process_performance_indicators-0.2.1-py3-none-any.whl -
Subject digest:
a0d089311afa93f39c6e07048e9928b0dc6c7e8a6e2073a24027b357bed365c7 - Sigstore transparency entry: 870172363
- Sigstore integration time:
-
Permalink:
nicoabarca/process-performance-indicators@40c0c13f9faec06d6eeb145ddbeb6e8a0fd8e9e3 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/nicoabarca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@40c0c13f9faec06d6eeb145ddbeb6e8a0fd8e9e3 -
Trigger Event:
release
-
Statement type: