pm4py.objects.log.importer.xes.variants.iterparse module#
- class pm4py.objects.log.importer.xes.variants.iterparse.Parameters(*values)[source]#
Bases:
Enum- TIMESTAMP_SORT = 'timestamp_sort'#
- TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
- REVERSE_SORT = 'reverse_sort'#
- MAX_TRACES = 'max_traces'#
- SHOW_PROGRESS_BAR = 'show_progress_bar'#
- DECOMPRESS_SERIALIZATION = 'decompress_serialization'#
- ENCODING = 'encoding'#
- pm4py.objects.log.importer.xes.variants.iterparse.count_traces(context)[source]#
Efficiently count the number of traces of a XES event log
- Parameters:
context – XML iterparse context
- Returns:
Number of traces of the XES log
- Return type:
num_traces
- pm4py.objects.log.importer.xes.variants.iterparse.import_from_context(context, num_traces, parameters=None)[source]#
Import a XES log from an iterparse context
- Parameters:
context – Iterparse context
num_traces – Number of traces of the XES log
parameters – Parameters of the algorithm
- Returns:
Event log
- Return type:
log
- pm4py.objects.log.importer.xes.variants.iterparse.apply(filename, parameters=None)[source]#
Imports an XES file into a log object
- Parameters:
filename – Absolute filename
parameters –
- Parameters of the algorithm, including
Parameters.TIMESTAMP_SORT -> Specify if we should sort log by timestamp Parameters.TIMESTAMP_KEY -> If sort is enabled, then sort the log by using this key Parameters.REVERSE_SORT -> Specify in which direction the log should be sorted Parameters.MAX_TRACES -> Specify the maximum number of traces to import from the log (read in order in the XML file) Parameters.SHOW_PROGRESS_BAR -> Enables/disables the progress bar (default: True) Parameters.ENCODING -> regulates the encoding (default: utf-8)
- Returns:
log – A log
- Return type:
pm4py.log.log.EventLog
- pm4py.objects.log.importer.xes.variants.iterparse.import_log(filename, parameters=None)[source]#
Imports an XES file into a log object
- Parameters:
filename – Absolute filename
parameters –
- Parameters of the algorithm, including
Parameters.TIMESTAMP_SORT -> Specify if we should sort log by timestamp Parameters.TIMESTAMP_KEY -> If sort is enabled, then sort the log by using this key Parameters.REVERSE_SORT -> Specify in which direction the log should be sorted Parameters.MAX_TRACES -> Specify the maximum number of traces to import from the log (read in order in the XML file) Parameters.SHOW_PROGRESS_BAR -> Enables/disables the progress bar (default: True) Parameters.ENCODING -> regulates the encoding (default: utf-8)
- Returns:
log – A log
- Return type:
pm4py.log.log.EventLog
- pm4py.objects.log.importer.xes.variants.iterparse.import_from_string(log_string, parameters=None)[source]#
Deserialize a text/binary string representing a XES log
- Parameters:
log_string – String that contains the XES
parameters –
- Parameters of the algorithm, including
Parameters.TIMESTAMP_SORT -> Specify if we should sort log by timestamp Parameters.TIMESTAMP_KEY -> If sort is enabled, then sort the log by using this key Parameters.REVERSE_SORT -> Specify in which direction the log should be sorted Parameters.INSERT_TRACE_INDICES -> Specify if trace indexes should be added as event attribute for each event Parameters.MAX_TRACES -> Specify the maximum number of traces to import from the log (read in order in the XML file) Parameters.SHOW_PROGRESS_BAR -> Enables/disables the progress bar (default: True) Parameters.ENCODING -> regulates the encoding (default: utf-8)
- Returns:
Trace log object
- Return type:
log