pm4py.objects.log.importer.xes.variants package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

pm4py.objects.log.importer.xes.variants.chunk_regex module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.chunk_regex.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

DECOMPRESS_SERIALIZATION = 'decompress_serialization'#
ENCODING = 'encoding'#
pm4py.objects.log.importer.xes.variants.chunk_regex.apply(filename, parameters=None)[source]#
pm4py.objects.log.importer.xes.variants.chunk_regex.import_log_from_file_object(F, encoding, file_size=9223372036854775807, parameters=None)[source]#

Import a log object from a (XML) file object

Parameters#

F

file object

encoding

Encoding

file_size

Size of the file (measured on disk)

parameters

Parameters of the algorithm

Returns#

log

Log file

pm4py.objects.log.importer.xes.variants.chunk_regex.import_log(filename, parameters=None)[source]#

Import a log object from a XML file containing the traces, the events and the simple attributes of them

Parameters#

filename

XES file to parse

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.MAX_BYTES -> Maximum number of bytes to read Parameters.SKYP_BYTES -> Number of bytes to skip Parameters.SET_ATTRIBUTES_TO_READ -> Names of the attributes that should be parsed. If not specified,

then, all the attributes are parsed.

Parameters.ENCODING -> Regulates the encoding of the log (default: utf-8)

Returns#

log

Log file

pm4py.objects.log.importer.xes.variants.chunk_regex.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

Returns#

log

Trace log object

pm4py.objects.log.importer.xes.variants.iterparse module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.iterparse.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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#

num_traces

Number of traces of the XES log

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#

log

Event 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#

logpm4py.log.log.EventLog

A log

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#

logpm4py.log.log.EventLog

A log

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#

log

Trace log object

pm4py.objects.log.importer.xes.variants.iterparse_20 module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.iterparse_20.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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_20.count_traces(context)[source]#

Efficiently count the number of traces of a XES event log

Parameters#

context

XML iterparse context

Returns#

num_traces

Number of traces of the XES log

pm4py.objects.log.importer.xes.variants.iterparse_20.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#

log

Event log

pm4py.objects.log.importer.xes.variants.iterparse_20.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#

logpm4py.log.log.EventLog

A log

pm4py.objects.log.importer.xes.variants.iterparse_20.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#

logpm4py.log.log.EventLog

A log

pm4py.objects.log.importer.xes.variants.iterparse_20.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#

log

Trace log object

pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[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_mem_compressed.count_traces(context)[source]#

Efficiently count the number of traces of a XES event log

Parameters#

context

XML iterparse context

Returns#

num_traces

Number of traces of the XES log

pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed.import_from_context(context, num_traces, log, parameters=None)[source]#

Import a XES log from an iterparse context

Parameters#

context

Iterparse context

num_traces

Number of traces of the XES log

log

Event log (empty)

parameters

Parameters of the algorithm

Returns#

log

Event log (filled with the contents of the XES log)

pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed.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#

logpm4py.log.log.EventLog

A log

pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed.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#

logpm4py.log.log.EventLog

A log

pm4py.objects.log.importer.xes.variants.iterparse_mem_compressed.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#

log

Trace log object

pm4py.objects.log.importer.xes.variants.line_by_line module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.line_by_line.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

TIMESTAMP_SORT = 'timestamp_sort'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
REVERSE_SORT = 'reverse_sort'#
MAX_TRACES = 'max_traces'#
MAX_BYTES = 'max_bytes'#
SKIP_BYTES = 'skip_bytes'#
SET_ATTRIBUTES_TO_READ = 'set_attributes_to_read'#
DECOMPRESS_SERIALIZATION = 'decompress_serialization'#
ENCODING = 'encoding'#
pm4py.objects.log.importer.xes.variants.line_by_line.apply(filename, parameters=None)[source]#
pm4py.objects.log.importer.xes.variants.line_by_line.read_attribute_key_value(tag, content, date_parser, values_dict, set_attributes_to_read)[source]#

Reads an attribute from the line of the log

Parameters#

tag

Tag

content

Full content of the line

date_parser

Date parser

values_dict

Dictionary of keys/values already met during the parsing

set_attributes_to_read

Names of the attributes that should be parsed. If None, then, all the attributes are parsed.

Returns#

key

Key of the attribute

value

Value of the attribute

pm4py.objects.log.importer.xes.variants.line_by_line.import_log_from_file_object(f, encoding, file_size=9223372036854775807, parameters=None)[source]#

Import a log object from a (XML) file object

Parameters#

f

file object

encoding

Encoding

file_size

Size of the file (measured on disk)

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.MAX_BYTES -> Maximum number of bytes to read Parameters.SKYP_BYTES -> Number of bytes to skip Parameters.SET_ATTRIBUTES_TO_READ -> Names of the attributes that should be parsed. If not specified,

then, all the attributes are parsed.

Returns#

log

Log file

pm4py.objects.log.importer.xes.variants.line_by_line.import_log(filename, parameters=None)[source]#

Import a log object from a XML file containing the traces, the events and the simple attributes of them

Parameters#

filename

XES file to parse

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.MAX_BYTES -> Maximum number of bytes to read Parameters.SKYP_BYTES -> Number of bytes to skip Parameters.SET_ATTRIBUTES_TO_READ -> Names of the attributes that should be parsed. If not specified,

then, all the attributes are parsed.

Parameters.ENCODING -> Regulates the encoding of the log (default: utf-8)

Returns#

log

Log file

pm4py.objects.log.importer.xes.variants.line_by_line.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.DECOMPRESS_SERIALIZATION -> Specify if the string needs to be decompressed during the parsing Parameters.SET_ATTRIBUTES_TO_READ -> Names of the attributes that should be parsed. If not specified,

then, all the attributes are parsed.

Parameters.ENCODING -> Regulates the encoding of the log (default: utf-8)

Returns#

log

Trace log object

pm4py.objects.log.importer.xes.variants.rustxes module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.objects.log.importer.xes.variants.rustxes.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

RETURN_LEGACY_LOG_OBJECT = 'return_legacy_log_object'#
pm4py.objects.log.importer.xes.variants.rustxes.apply(log_path: str, parameters: Dict[Any, Any] | None = None) EventLog | DataFrame[source]#