STRM Privacy Diagnostics for reporting privacy metrics on a dataset.
Project description
STRM Privacy Diagnostics
This package contains diagnostics for your data, by means of computing k-Anonymity, l-Diversity and t-Closeness.
You can compute the scores by passing your data and indicating which columns are quasi-identifiers and sensitive attributes.
A 'quasi identifier' is a data attribute on an individual that together with other attributes could identify them. E.g. your length probably doesn't discern you from a larger group of people, but the combination of your length, age and city of birth will if someone has some knowledge about you.
A 'sensitive attribute' is a sensitive data point, like a specific medical diagnosis or credit score.
Installation
Install the package via Pip:
pip install strmprivacy-diagnostics
Usage
Simply import the package and
- point it to your input data
- calculate the statistics by passing the quasi identifiers and sensitive attributes
- print a report by passing the quasi identifiers and sensitive attributes
from strmprivacy.diagnostics import PrivacyDiagnostics
# create an instance of the diagnostics class
d = PrivacyDiagnostics("/path/to/csv")
# calculate the statistics
d.calculate_stats(
qi=['qi1', 'qi2', ...], # names of quasi identifier columns,
sa=['sa1', 'sa2', ...], # names of sensitive attributes
)
# create report
d.create_report(
qi=['qi1', 'qi2', ...], # names of quasi identifier columns,
sa=['sa1', 'sa2', ...], # names of sensitive attributes
)
d.stats
>>> {'k': xxx, 'l': {'col1': xxx, ...}, 't': xxx}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for strmprivacy-diagnostics-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d9db18f4d53ab9b2a7ecb52cef028ce0cbde4315372eac9dbea01b0dbf0df6d |
|
MD5 | 6466831d0b0fb29fdb69c97db9d3c69c |
|
BLAKE2b-256 | 63e8b143f7f8ec7e29d3798e5d24cc583eab2b59aa96e172db8c7103f3b89cc8 |
Hashes for strmprivacy_diagnostics-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c2bb2ceaa06de2bc58a56128edf05f02712adcf554a882af1036e1a4c2665a0 |
|
MD5 | ddd2bc7447b71ab4887d5ce4d400511e |
|
BLAKE2b-256 | 54243e225acb101f37748c1a92508b5a6513249868a0b5c44d3b7d00db988c8a |