PM4Py Configuration Parameters

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.

General Configuration Parameters

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.

ParameterEnvironment VariablePossible ValuesExplanation
DEFAULT_TIMESTAMP_PARSE_FORMATPM4PY_DEFAULT_TIMESTAMP_PARSE_FORMATString (e.g., "%Y-%m-%d %H:%M:%S"), NoneSpecifies 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_FORMATPM4PY_DEFAULT_XES_TIMESTAMP_PARSE_FORMATString (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_AWAREPM4PY_ENABLE_DATETIME_COLUMNS_AWARETrue, FalseControls whether datetime columns are timezone-aware. Defaults to False if CUDF is available or testing environment is enabled, otherwise True.
DEFAULT_ENCODINGPM4PY_DEFAULT_ENCODINGString (e.g., "utf-8")Specifies the default encoding for file operations. Defaults to "utf-8".
DEFAULT_XES_PARSERPM4PY_DEFAULT_XES_PARSER"iterparse", "chunk_regex"Determines the parser for XES files. Defaults to "iterparse" if `lxml` is available, otherwise "chunk_regex".
DEFAULT_ALIGNMENTS_VARIANTPM4PY_DEFAULT_ALIGNMENTS_VARIANTString (e.g., "Variants.VERSION_STATE_EQUATION_A_STAR")Sets the default variant for alignment computations. Defaults to "Variants.VERSION_STATE_EQUATION_A_STAR".
DEFAULT_BGCOLORPM4PY_DEFAULT_BGCOLORColor (e.g., white)Defines the default background color for visualizations. Defaults to "white".
DEFAULT_FORMAT_GVIZ_VIEWPM4PY_DEFAULT_FORMAT_GVIZ_VIEWString (e.g., "png")Specifies the default format for graph visualizations. Defaults to "png".
DEFAULT_RANKDIR_GVIZPM4PY_DEFAULT_RANKDIR_GVIZString (e.g., "LR")Sets the default rank direction for Graphviz layouts. Defaults to "LR" (left-to-right).
DEFAULT_START_SYMBOL_GRAPHSPM4PY_DEFAULT_START_SYMBOL_GRAPHSString (e.g., "<●>")Defines the default symbol for the start node in graphs. Defaults to "<●>".
DEFAULT_END_SYMBOL_GRAPHSPM4PY_DEFAULT_END_SYMBOL_GRAPHSString (e.g., "<■>")Defines the default symbol for the end node in graphs. Defaults to "<■>".
ENABLE_MULTIPROCESSING_DEFAULTPM4PY_ENABLE_MULTIPROCESSING_DEFAULTTrue, FalseControls whether multiprocessing is enabled by default. Defaults to False.
SHOW_PROGRESS_BARPM4PY_SHOW_PROGRESS_BARTrue, FalseDetermines whether to show progress bars during operations. Defaults to True.
DEFAULT_READ_XES_LEGACY_OBJECTPM4PY_DEFAULT_READ_XES_LEGACY_OBJECTTrue, FalseEnables legacy object reading for XES files. Defaults to False.
DEFAULT_RETURN_DIAGNOSTICS_DATAFRAMEPM4PY_DEFAULT_RETURN_DIAGNOSTICS_DATAFRAMETrue, FalseControls whether diagnostics return a DataFrame. Defaults to False.
DEFAULT_PANDAS_PARSING_DTYPE_BACKENDPM4PY_DEFAULT_PANDAS_PARSING_DTYPE_BACKENDString (e.g., "numpy_nullable")Specifies the Pandas dtype backend for parsing. Defaults to "numpy_nullable".
SHOW_EVENT_LOG_DEPRECATIONPM4PY_SHOW_EVENT_LOG_DEPRECATIONTrue, FalseEnables deprecation warnings for event logs. Defaults to False.
SHOW_INTERNAL_WARNINGSPM4PY_SHOW_INTERNAL_WARNINGSTrue, FalseEnables internal warnings. Defaults to True.
DEFAULT_GVIZ_VIEWPM4PY_DEFAULT_GVIZ_VIEWString (e.g., "view", "matplotlib_view"), NoneSets the default visualization view. Defaults to "matplotlib_view" if running in Power BI, otherwise "view".
DEFAULT_ENABLE_VISUALIZATIONS_VIEWPM4PY_DEFAULT_ENABLE_VISUALIZATIONS_VIEWTrue, FalseEnables visualization views by default. Defaults to True.
DEFAULT_ENABLE_GRAPH_TITLESPM4PY_DEFAULT_ENABLE_GRAPH_TITLESTrue, FalseEnables graph titles by default. Defaults to False.
ENABLE_INTERNAL_IMPORTSPM4PY_ENABLE_INTERNAL_IMPORTSTrue, FalseControls whether internal imports are enabled. Defaults to True.

LLM Module Configuration Parameters

This section lists the LLM (Large Language Model) module configuration parameters from the PM4Py library, their associated environment variables, possible values, and explanations.

ParameterEnvironment VariablePossible ValuesExplanation
OPENAI_MAX_LENPM4PY_OPENAI_MAX_LENInteger (e.g., 10000)Sets the maximum length for OpenAI API responses. Defaults to 10000.
OPENAI_API_KEYPM4PY_OPENAI_API_KEYString, NoneStores the OpenAI API key. Defaults to None.
ANTHROPIC_API_KEYPM4PY_ANTHROPIC_API_KEYString, NoneStores the Anthropic API key. Defaults to None.
GOOGLE_API_KEYPM4PY_GOOGLE_API_KEYString, NoneStores the Google API key. Defaults to None.
OPENAI_API_URLPM4PY_OPENAI_API_URLString (e.g., "https://api.openai.com/v1/")Specifies the OpenAI API endpoint URL. Defaults to "https://api.openai.com/v1/".
OPENAI_DEFAULT_MODELPM4PY_OPENAI_DEFAULT_MODELString (e.g., "gpt-4.1")Sets the default OpenAI model. Defaults to "gpt-4.1".
OPENAI_DEFAULT_VISION_MODELPM4PY_OPENAI_DEFAULT_VISION_MODELString (e.g., "gpt-4.1")Sets the default OpenAI vision model. Defaults to "gpt-4.1".
ANTHROPIC_DEFAULT_MODELPM4PY_ANTHROPIC_DEFAULT_MODELString (e.g., "claude-3-7-sonnet-20250219")Sets the default Anthropic model. Defaults to "claude-3-7-sonnet-20250219".
GOOGLE_DEFAULT_MODELPM4PY_GOOGLE_DEFAULT_MODELString (e.g., "gemini-2.0-flash")Sets the default Google model. Defaults to "gemini-2.0-flash".
OPENAI_DEFAULT_STT_MODELPM4PY_OPENAI_DEFAULT_STT_MODELString (e.g., "whisper-1")Sets the default OpenAI speech-to-text model. Defaults to "whisper-1".
OPENAI_DEFAULT_TTS_MODELPM4PY_OPENAI_DEFAULT_TTS_MODELString (e.g., "tts-1")Sets the default OpenAI text-to-speech model. Defaults to "tts-1".
OPENAI_DEFAULT_TTS_VOICEPM4PY_OPENAI_DEFAULT_TTS_VOICEString (e.g., "alloy")Sets the default OpenAI text-to-speech voice. Defaults to "alloy".
OPENAI_EXEC_RESULTPM4PY_OPENAI_EXEC_RESULTTrue, FalseControls whether OpenAI execution results are enabled. Defaults to False.

Notes

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.