Skip to main content

A simple and efficient tool for process mining.

Project description

⛏pyromorphite💎

Process mining in python.

Get the Source Code

Pyromorphite is actively developed on GitHub, where the code is always available.

You can clone the public repository:

$ git clone git://github.com/xcavation/pyromorphite.git 

Once you have a copy of the source, you can embed it in your own Python package, or install it into your site-packages easily:

$ cd requests
$ pip install .

Quickstart

This is a quick introduction to Pyromorphite. Before proceeding, make sure that Pyromorphite is installed.

Import a Log 📜

Reading in event log files in Pyromorphite is super easy. It supports XES, CSV, and Excel files.

XES Files

Begin by importing the Pyromorphite module:

>>> import pyromorphite as pm

We'll try now to get an xes file from a web repository. For this dataset:

>>> log = pm.read_xes("https://data.4tu.nl/repository/uuid:c1e9137e-2877-410d-a76a-21ce7f97a239/DATA1")

Similarly we would do if we would like to read a local file. Let's assume that under /path/to/file.xes lies our file. We can then do:

>>> log = pm.read_xes("/path/to/file.xes")

CSV Files

Although not part of Pyromorphite, reading a csv file can be done with the pandas library.

Begin by import the pandas module:

>>> import pandas as pd

We'll try now to get an xes file from a web repository. For this dataset:

>>> log = pd.read_csv("https://data.4tu.nl/repository/uuid:d5ccb355-ca67-480f-8739-289b9b593aaf/DATA")

Construct a Bag 🎒

Having parsed a log into a pandas DataFrame we can simply extract the traces of events, with togehter with their frequency in the log.

>>> bag = pm.as_bag(log)

If we consider that everybody might use different column names, we can specify the case, timestamp and activity columns when creating the bag in the following way:

>>> bag = pm.as_bag(log, case='CI Name (aff)', time='Actual Start', activity='Change Type')

Does this Trace Conform to the Event Log?

For this task we are going to use a model called Log Skeleton.

>>> bag = pm.as_bag(pm.read_xes(os.path.join("B1.xes")))
>>> traces = [("a1", "a4", "a5", "a7")]
>>> pred = pm.skeleton.classify(bag, traces)
>>> [False]

NOTE: Log B1.xes is equal to the multiset that can be found here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyromorphite-0.0.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file pyromorphite-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyromorphite-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pyromorphite-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a82f6919235ae7d19b14c91c291f12784e57f22957d383ef7e5951f94de28c1d
MD5 7fea83668543a4e6da1f47693a32ee2b
BLAKE2b-256 3bd5efdfe3cfe25e69f1c5dbc5fce3a3cda9e2018e1f7612a430d8ec9bc08295

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page