opyenxes.data_in package

Submodules

opyenxes.data_in.XMxmlGZIPParser module

class opyenxes.data_in.XMxmlGZIPParser.XMxmlGZIPParser(factory=None)[source]

Bases: opyenxes.data_in.XMxmlParser.XMxmlParser

Parser for the compressed MXML format for event logs (deprecated).

Parameters:factory (XFactory) – The factory to use for XES model building.
can_parse(file)[source]

Checks whether this parser can handle the given file.

Parameters:file (str) – path of the file to check against parser.
Returns:Whether this parser can handle the given file.
Return type:bool
parse(file)[source]

Parses a log from the given input stream, which is supposed to deliver an XES log in XML representation.

Parameters:file (_io.TextIOWrapper) – file generated by the function ‘open(path)’, which is supposed to deliver an XES log in XML representation.
Returns:The parsed log.
Return type:list[XLog]

opyenxes.data_in.XMxmlParser module

class opyenxes.data_in.XMxmlParser.XMxmlParser(factory=None)[source]

Bases: object

Parser for the MXML format for event logs (deprecated).

Parameters:factory (XFactory) – The factory to use for XES model building.
MXML_CLASSIFIERS = [<opyenxes.classification.XEventAttributeClassifier.XEventAttributeClassifier object>, <opyenxes.classification.XEventNameClassifier.XEventNameClassifier object>, <opyenxes.classification.XEventResourceClassifier.XEventResourceClassifier object>]
class MxmlHandler[source]

Bases: xml.sax.handler.ContentHandler

SAX handler class for XES in XML representation.

characters(content)[source]

Overrides characters in class ContentHandler

Parameters:content (str) – The characters.
endElement(local_name)[source]

Overrides endElement in class ContentHandler

Parameters:local_name (str) – The name of the element type, just as with the startElement event
get_logs()[source]

Retrieves the parsed list of logs.

Returns:The parsed list of logs.
Return type:list[XLog]
ignorableWhitespace(whitespace)[source]

Overrides ignorableWhitespace in class ContentHandler

Parameters:whitespace (str) – The whitespace characters.
startElement(element_name, attributes)[source]

Overrides startElement in class ContentHandler

Parameters:
  • element_name (str) – Contains the raw XML 1.0 name of the element type.
  • attributes (xml.sax.xmlreader.AttributesImpl) – An instance of the Attributes class containing the attributes of the element
can_parse(file)[source]

Checks whether this parser can handle the given file.

Parameters:file (str) – path of the file to check against parser.
Returns:Whether this parser can handle the given file.
Return type:bool
static ends_with_ignore_case(name, suffix)[source]

Returns whether the given file name ends (ignoring the case) with the given suffix.

Parameters:
  • name (str) – The given file name.
  • suffix (str) – The given suffix.
Returns:

Whether the given file name ends (ignoring the case) with the given suffix.

Return type:

bool

parse(file)[source]

Parses a set of logs from the given input stream, which is supposed to deliver an MXML serialization.

Parameters:file (_io.TextIOWrapper) – file generated by the function ‘open(path)’, which is supposed to deliver an MXML serialization.
Returns:The parsed list of logs.
Return type:list[XLog]

opyenxes.data_in.XParserRegistry module

class opyenxes.data_in.XParserRegistry.XParserRegistry[source]

Bases: opyenxes.utils.XRegistry.XRegistry

System-wide registry for XES parser implementations. Applications can use this registry as a convenience to provide an overview about parseable formats, e.g., in the user interface. Any custom parser implementation can be registered with this registry, so that it transparently becomes available also to any other using application.

Uses the singleton metaclass

opyenxes.data_in.XUniversalParser module

class opyenxes.data_in.XUniversalParser.XUniversalParser[source]

Bases: object

This class implements a universal parser, using the parser registry to find an appropriate parser for extracting an XES model from any given file. May be used as a convenience method for applications.

static can_parse(file)[source]

Checks whether the given file can be parsed by any parser.

Parameters:file (str) – path of the file to check against parser.
Returns:Whether this parser can handle the given file.
Return type:bool
static parse(file)[source]

Attempts to parse a collection of XES models from the given file, using all available parsers.

Parameters:file (_io.TextIOWrapper) – file generated by the function ‘open(path)’, which is supposed to deliver an XES log in XML representation.
Returns:The parsed list of logs.
Return type:list[XLog]

opyenxes.data_in.XesXmlGZIPParser module

class opyenxes.data_in.XesXmlGZIPParser.XesXmlGZIPParser(factory=None)[source]

Bases: opyenxes.data_in.XesXmlParser.XesXmlParser

Parser for the compressed XES XML serialization.

Parameters:factory (XFactory) – The XES model factory instance used to build the model from the serialization.
can_parse(file)[source]

Checks whether this parser can handle the given file.

Parameters:file (str) – path of the file to check against parser.
Returns:Whether this parser can handle the given file.
Return type:bool
parse(file)[source]

Parses a log from the given input stream, which is supposed to deliver an XES log in XML representation.

Parameters:file (_io.TextIOWrapper) – file generated by the function ‘open(path)’, which is supposed to deliver an XES log in XML representation.
Returns:The parsed list of logs.
Return type:list[XLog]

opyenxes.data_in.XesXmlParser module

class opyenxes.data_in.XesXmlParser.XesXmlParser(factory=None)[source]

Bases: object

Parser for the XES XML serialization.

Parameters:factory (XFactory) – The XES model factory instance used to build the model from the serialization.
class XesXmlHandler[source]

Bases: xml.sax.handler.ContentHandler

SAX handler class for XES in XML representation.

endElement(local_name)[source]

Overrides endElement in class ContentHandler

Parameters:local_name (str) – The name of the element type, just as with the startElement event
get_log()[source]

Retrieves the parsed log.

Returns:The parsed log.
Return type:XLog
startElement(element_name, attributes)[source]

Overrides startElement in class ContentHandler

Parameters:
  • element_name (str) – Contains the raw XML 1.0 name of the element type.
  • attributes (xml.sax.xmlreader.AttributesImpl) – An instance of the Attributes class containing the attributes of the element
can_parse(file)[source]

Checks whether this parser can handle the given file.

Parameters:file (str) – path of the file to check against parser.
Returns:Whether this parser can handle the given file.
Return type:bool
static ends_with_ignore_case(name, suffix)[source]

Returns whether the given file name ends (ignoring the case) with the given suffix.

Parameters:
  • name (str) – The given file name.
  • suffix (str) – The given suffix.
Returns:

Whether the given file name ends (ignoring the case) with the given suffix.

Return type:

bool

parse(file)[source]

Parses a log from the given input stream, which is supposed to deliver an XES log in XML representation.

Parameters:file (_io.TextIOWrapper) – file generated by the function ‘open(path)’, which is supposed to deliver an XES log in XML representation.
Returns:The parsed list of logs.
Return type:list[XLog]

Module contents