One of PM4Py's key strengths is its extensive configurability, allowing users to tailor its behavior to specific requirements through environment variables. This configurability supports diverse use cases, from adjusting timestamp formats and visualization settings to enabling multiprocessing and legacy features. By leveraging environment variables, PM4Py provides a seamless way to override default settings without modifying the source code, ensuring adaptability across different environments and workflows.
The following table details the general configuration parameters of PM4Py, available in the source file pm4py/util/constants.py
which control core functionalities such as data parsing, visualization, and performance optimization. Each parameter is linked to an environment variable, allowing users to customize PM4Py's behavior dynamically.
Parameter | Environment Variable | Possible Values | Explanation |
---|---|---|---|
DEFAULT_TIMESTAMP_PARSE_FORMAT | PM4PY_DEFAULT_TIMESTAMP_PARSE_FORMAT | String (e.g., "%Y-%m-%d %H:%M:%S"), None | Specifies the default timestamp format for parsing. Defaults to "%Y-%m-%d %H:%M:%S" if CUDF is available or testing environment is enabled, otherwise None. |
DEFAULT_XES_TIMESTAMP_PARSE_FORMAT | PM4PY_DEFAULT_XES_TIMESTAMP_PARSE_FORMAT | String (e.g., "%Y-%m-%dT%H:%M:%S"), "ISO8601" | Defines the timestamp format for XES event logs. Defaults to "%Y-%m-%dT%H:%M:%S" if CUDF is available or testing environment is enabled, otherwise "ISO8601". |
ENABLE_DATETIME_COLUMNS_AWARE | PM4PY_ENABLE_DATETIME_COLUMNS_AWARE | True, False | Controls whether datetime columns are timezone-aware. Defaults to False if CUDF is available or testing environment is enabled, otherwise True. |
DEFAULT_ENCODING | PM4PY_DEFAULT_ENCODING | String (e.g., "utf-8") | Specifies the default encoding for file operations. Defaults to "utf-8". |
DEFAULT_XES_PARSER | PM4PY_DEFAULT_XES_PARSER | "iterparse", "chunk_regex" | Determines the parser for XES files. Defaults to "iterparse" if `lxml` is available, otherwise "chunk_regex". |
DEFAULT_ALIGNMENTS_VARIANT | PM4PY_DEFAULT_ALIGNMENTS_VARIANT | String (e.g., "Variants.VERSION_STATE_EQUATION_A_STAR") | Sets the default variant for alignment computations. Defaults to "Variants.VERSION_STATE_EQUATION_A_STAR". |
DEFAULT_BGCOLOR | PM4PY_DEFAULT_BGCOLOR | Color (e.g., white) | Defines the default background color for visualizations. Defaults to "white". |
DEFAULT_FORMAT_GVIZ_VIEW | PM4PY_DEFAULT_FORMAT_GVIZ_VIEW | String (e.g., "png") | Specifies the default format for graph visualizations. Defaults to "png". |
DEFAULT_RANKDIR_GVIZ | PM4PY_DEFAULT_RANKDIR_GVIZ | String (e.g., "LR") | Sets the default rank direction for Graphviz layouts. Defaults to "LR" (left-to-right). |
DEFAULT_START_SYMBOL_GRAPHS | PM4PY_DEFAULT_START_SYMBOL_GRAPHS | String (e.g., "<●>") | Defines the default symbol for the start node in graphs. Defaults to "<●>". |
DEFAULT_END_SYMBOL_GRAPHS | PM4PY_DEFAULT_END_SYMBOL_GRAPHS | String (e.g., "<■>") | Defines the default symbol for the end node in graphs. Defaults to "<■>". |
ENABLE_MULTIPROCESSING_DEFAULT | PM4PY_ENABLE_MULTIPROCESSING_DEFAULT | True, False | Controls whether multiprocessing is enabled by default. Defaults to False. |
SHOW_PROGRESS_BAR | PM4PY_SHOW_PROGRESS_BAR | True, False | Determines whether to show progress bars during operations. Defaults to True. |
DEFAULT_READ_XES_LEGACY_OBJECT | PM4PY_DEFAULT_READ_XES_LEGACY_OBJECT | True, False | Enables legacy object reading for XES files. Defaults to False. |
DEFAULT_RETURN_DIAGNOSTICS_DATAFRAME | PM4PY_DEFAULT_RETURN_DIAGNOSTICS_DATAFRAME | True, False | Controls whether diagnostics return a DataFrame. Defaults to False. |
DEFAULT_PANDAS_PARSING_DTYPE_BACKEND | PM4PY_DEFAULT_PANDAS_PARSING_DTYPE_BACKEND | String (e.g., "numpy_nullable") | Specifies the Pandas dtype backend for parsing. Defaults to "numpy_nullable". |
SHOW_EVENT_LOG_DEPRECATION | PM4PY_SHOW_EVENT_LOG_DEPRECATION | True, False | Enables deprecation warnings for event logs. Defaults to False. |
SHOW_INTERNAL_WARNINGS | PM4PY_SHOW_INTERNAL_WARNINGS | True, False | Enables internal warnings. Defaults to True. |
DEFAULT_GVIZ_VIEW | PM4PY_DEFAULT_GVIZ_VIEW | String (e.g., "view", "matplotlib_view"), None | Sets the default visualization view. Defaults to "matplotlib_view" if running in Power BI, otherwise "view". |
DEFAULT_ENABLE_VISUALIZATIONS_VIEW | PM4PY_DEFAULT_ENABLE_VISUALIZATIONS_VIEW | True, False | Enables visualization views by default. Defaults to True. |
DEFAULT_ENABLE_GRAPH_TITLES | PM4PY_DEFAULT_ENABLE_GRAPH_TITLES | True, False | Enables graph titles by default. Defaults to False. |
ENABLE_INTERNAL_IMPORTS | PM4PY_ENABLE_INTERNAL_IMPORTS | True, False | Controls whether internal imports are enabled. Defaults to True. |
This section lists the LLM (Large Language Model) module configuration parameters from the PM4Py library, their associated environment variables, possible values, and explanations.
Parameter | Environment Variable | Possible Values | Explanation |
---|---|---|---|
OPENAI_MAX_LEN | PM4PY_OPENAI_MAX_LEN | Integer (e.g., 10000) | Sets the maximum length for OpenAI API responses. Defaults to 10000. |
OPENAI_API_KEY | PM4PY_OPENAI_API_KEY | String, None | Stores the OpenAI API key. Defaults to None. |
ANTHROPIC_API_KEY | PM4PY_ANTHROPIC_API_KEY | String, None | Stores the Anthropic API key. Defaults to None. |
GOOGLE_API_KEY | PM4PY_GOOGLE_API_KEY | String, None | Stores the Google API key. Defaults to None. |
OPENAI_API_URL | PM4PY_OPENAI_API_URL | String (e.g., "https://api.openai.com/v1/") | Specifies the OpenAI API endpoint URL. Defaults to "https://api.openai.com/v1/". |
OPENAI_DEFAULT_MODEL | PM4PY_OPENAI_DEFAULT_MODEL | String (e.g., "gpt-4.1") | Sets the default OpenAI model. Defaults to "gpt-4.1". |
OPENAI_DEFAULT_VISION_MODEL | PM4PY_OPENAI_DEFAULT_VISION_MODEL | String (e.g., "gpt-4.1") | Sets the default OpenAI vision model. Defaults to "gpt-4.1". |
ANTHROPIC_DEFAULT_MODEL | PM4PY_ANTHROPIC_DEFAULT_MODEL | String (e.g., "claude-3-7-sonnet-20250219") | Sets the default Anthropic model. Defaults to "claude-3-7-sonnet-20250219". |
GOOGLE_DEFAULT_MODEL | PM4PY_GOOGLE_DEFAULT_MODEL | String (e.g., "gemini-2.0-flash") | Sets the default Google model. Defaults to "gemini-2.0-flash". |
OPENAI_DEFAULT_STT_MODEL | PM4PY_OPENAI_DEFAULT_STT_MODEL | String (e.g., "whisper-1") | Sets the default OpenAI speech-to-text model. Defaults to "whisper-1". |
OPENAI_DEFAULT_TTS_MODEL | PM4PY_OPENAI_DEFAULT_TTS_MODEL | String (e.g., "tts-1") | Sets the default OpenAI text-to-speech model. Defaults to "tts-1". |
OPENAI_DEFAULT_TTS_VOICE | PM4PY_OPENAI_DEFAULT_TTS_VOICE | String (e.g., "alloy") | Sets the default OpenAI text-to-speech voice. Defaults to "alloy". |
OPENAI_EXEC_RESULT | PM4PY_OPENAI_EXEC_RESULT | True, False | Controls whether OpenAI execution results are enabled. Defaults to False. |
LLM parameters are specific to integrations with OpenAI, Anthropic, and Google APIs, primarily for tasks involving language models, vision, speech-to-text, and text-to-speech. Environment variables must be set to valid API keys or model names for the respective services to function correctly. The OPENAI_EXEC_RESULT
parameter determines whether execution results from OpenAI APIs are processed or returned.