Coder Social home page Coder Social logo

luohaoz / xes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxsumrall/xes

0.0 0.0 0.0 272 KB

A simple tool for generating XES files for Process Mining

License: Apache License 2.0

Makefile 7.22% CSS 17.57% JavaScript 58.38% Python 16.83%

xes's Introduction

===========
XES
===========

This project is on Github: https://github.com/jsumrall/xes



This is a simple library which has methods for generating XES files.
With this library you will be able to take your raw event data and
generate an XES file with a standard header. From the XES-Standard web page,
"XES is an XML-based standard for event logs. Its purpose is to provide a
generally-acknowledged format for the interchange of event log data between
tools and application domains. Its primary purpose is for process mining,
i.e. the analysis of operational processes based on their event logs."

As usual, examples are the best way to see what this does.

Example usage looks like this::

    #!/usr/bin/env python

    import xes

    traces = [
        [
            {"concept:name" : "Register", "org:resource" : "Bob"},
            {"concept:name" : "Negotiate", "org:resource" : "Sally"},
            {"concept:name" : "Negotiate", "org:resource" : "Sally"},
            {"concept:name" : "Sign", "org:resource" : "Dan"},
            {"concept:name" : "Sendoff", "org:resource" : "Mary"}
        ],
        [
            {"concept:name" : "Register", "org:resource" : "Bob"},
            {"concept:name" : "Negotiate", "org:resource" : "Sally"},
            {"concept:name" : "Sign", "org:resource" : "Dan"},
            {"concept:name" : "Sendoff", "org:resource" : "Mary"}
        ],
        [
            {"concept:name" : "Register", "org:resource" : "Bob"},
            {"concept:name" : "Negotiate", "org:resource" : "Sally"},
            {"concept:name" : "Sign", "org:resource" : "Dan"},
            {"concept:name" : "Negotiate", "org:resource" : "Sally"},
            {"concept:name" : "Sendoff", "org:resource" : "Mary"}
        ],
        [
            {"concept:name" : "Register", "org:resource" : "Bob"},
            {"concept:name" : "Sign", "org:resource" : "Dan"},
            {"concept:name" : "Sendoff", "org:resource" : "Mary"}
        ]
    ]


    log = xes.Log()
    for trace in traces:
        t = xes.Trace()
        for event in trace:
            e = xes.Event()
            e.attributes = [
                xes.Attribute(type="string", key="concept:name", value=event["concept:name"]),
                xes.Attribute(type="string", key="org:resource", value=event["org:resource"])
            ]
            t.add_event(e)
        log.add_trace(t)
    log.classifiers = [
        xes.Classifier(name="org:resource",keys="org:resource"),
        xes.Classifier(name="concept:name",keys="concept:name")
    ]

    open("example.xes", "w").write(str(log))



xes's People

Contributors

maxsumrall avatar mdrio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.