Skip to main content

Privacy metadata in process mining

Project description

Introduction

This project implements the privacy metadata proposed in the paper Privacy-Preserving Data Publishing in Process Mining.

Python package

The implementation has been published as a standard Python package. Use the following command to install the corresponding Python package:

pip install p-privacy-metadata

Usage

from p_privacy_metadata.privacyExtension import privacyExtension
from p_privacy_metadata.ELA import ELA
from pm4py.objects.log.importer.xes import factory as xes_importer_factory
from pm4py.objects.log.exporter.xes import factory as xes_exporter
import pandas as pd

event_log = "paper_sample.xes"
log = xes_importer_factory.apply(event_log)

# privacyExtension Part
prefix = 'privacy:'
uri = 'paper_version_uri/privacy.xesext'
privacy = privacyExtension(log, prefix, uri)
privacy.set_anonymizer(operation='suppression', level='event', target='org:resource')

statistics={}
statistics['no_modified_traces'] = 15
statistics['no_modified_events'] = 20
desired_analyses= {}
desired_analyses['1']='process discovery'
desired_analyses['2']='social network discovery'
message = privacy.set_optional_anonymizer(layer = 1, statistics=statistics, desired_analyses=desired_analyses, test='test' )
print(message)

layer = privacy.get_anonymizer(layer=1)
anon = privacy.get_anonymizations()

xes_exporter.export_log(log, 'ext_paper_sample.xes')

# ELA Part
try:
    log_name = log.attributes['concept:name']
except Exception as e:
    log_name = "No mame is given for the event log!"

ela = ELA()
ela_desired_analyses = ['analysis 1', 'analysis 2']
data = {'Name': ['Tom', 'nick', 'krish', 'jack'], 'Age': [20, 21, 19, 18]}
df = pd.DataFrame(data)
ela.set_values(origin=log_name, method='method 1', desired_analyses=ela_desired_analyses,data=df.copy())
ela.create_xml('ela_paper_sample.xml')
print(ela.get_values()['data'])
ela = ela.read_xml("ela_paper_sample.xml")
print(ela)

Project details


Download files

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

Source Distribution

p_privacy_metadata-0.0.5.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

p_privacy_metadata-0.0.5-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file p_privacy_metadata-0.0.5.tar.gz.

File metadata

  • Download URL: p_privacy_metadata-0.0.5.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

File hashes

Hashes for p_privacy_metadata-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5a71352b7c0b436cd86abf9ed3852c16bf31ade343f7d258c9cd5807bcabc5b2
MD5 5a7f585daa0b4d136916374e8397ef89
BLAKE2b-256 d415c4bacb131d4dff972df64765fa4c250ee63832227cbbd2cd214b26f25ac7

See more details on using hashes here.

File details

Details for the file p_privacy_metadata-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: p_privacy_metadata-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

File hashes

Hashes for p_privacy_metadata-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 11be85438d241fc7c5dfefc328b89af8480e3c46241fa0d894e492cca875a792
MD5 9ae46259cc0b46f1dceabd28900db0c9
BLAKE2b-256 79b6848e483c9b08735ff88cf0eb19f3a3b20b8052334683001a524446703580

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