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)
Metadata
Release files for p-privacy-metadata 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| p_privacy_metadata-0.0.5.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| p_privacy_metadata-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / p_privacy_metadata-0.0.5.tar.gz
| Download URL | p_privacy_metadata-0.0.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a71352b7c0b436cd86abf9ed3852c16bf31ade343f7d258c9cd5807bcabc5b2
|
|
BLAKE2b-256 checksum How to use checksums |
d415c4bacb131d4dff972df64765fa4c250ee63832227cbbd2cd214b26f25ac7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / p_privacy_metadata-0.0.5-py3-none-any.whl
| Download URL | p_privacy_metadata-0.0.5-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11be85438d241fc7c5dfefc328b89af8480e3c46241fa0d894e492cca875a792
|
|
BLAKE2b-256 checksum How to use checksums |
79b6848e483c9b08735ff88cf0eb19f3a3b20b8052334683001a524446703580
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for p-privacy-metadata 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.