Skip to main content

pyCANON, A Python library to check the level of anonymity of a dataset

Project description

IFCA (CSIC-UC) Author-email: sainzpardo@ifca.unican.es, aloga@ifca.unican.es License: Apache License 2.0 Keywords: data,privacy,anonymity Platform: UNKNOWN Classifier: Development Status :: 5 – Production/Stable Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Education Classifier: Intended Audience :: Science/Research Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Scientific/Engineering Classifier: Topic :: Scientific/Engineering :: Mathematics Classifier: Topic :: Security License-File: LICENSE

pyCANON

made-with-python License Documentation Status

pyCANON is a library and CLI to assess the values of the paramenters associated with the most common privacy-preserving techniques.

Authors: Judith Sáinz-Pardo Díaz and Álvaro López García (IFCA - CSIC).

Installation

We recommend to use Python3 with virtualenv:

virtualenv .venv -p python3
source .venv/bin/activate

Then run the following command to install the library and all its requirements:

pip install pycanon

Documentation

The pyCANON documentation is hosted on Read the Docs.

Getting started

Example using the adult dataset:

from pycanon import anonymity, report

FILE_NAME = "adult.csv"
QI = ["age", "education", "occupation", "relationship", "sex", "native-country"]
SA = ["salary-class"]

# Calculate k for k-anonymity:
k = anonymity.k_anonymity(FILE_NAME, QI)

# Print the anonymity report:
report.print_report(FILE_NAME, QI, SA)

Description

pyCANON allows to check if the following privacy-preserving techniques are verified and the value of the parameters associated with each of them:

+—————————-+————————–+———————-+——————————++ | Technique | pyCANON function | Parameters | Notes | +============================+==========================+======================+===============================+ | k-anonymity | k_anonymity | _k_: int | | | (α, k)-anonymity | alpha_k_anonymity | _α_: float _k_: int | | | ℓ-diversity | l_diversity | _ℓ_: int | | | Entropy ℓ-diversity | entropy_l_diversity | _ℓ_: int | | | Recursive (c,ℓ)-diversity | recursive_c_l_diversity | _c_: int _ℓ_: int | Not calculated if ℓ=1 | | Basic β-likeness | basic_beta_likeness | _β_: float | | | Enhanced β-likeness | enhanced_beta_likeness | _β_: float | | | t-closeness | t_closeness | _t_: float | For numerical attributes the definition of the EMD (one-dimensional Earth Mover’s Distance) is used. For categorical attributes, the metric “Equal Distance” is used. | | δ-disclosure privacy | delta_disclosure | _δ_: float | | +—————————-+————————–+———————-+——————————-+

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

pycanon-1.0.0.tar.gz (16.4 kB view details)

Uploaded Source

File details

Details for the file pycanon-1.0.0.tar.gz.

File metadata

  • Download URL: pycanon-1.0.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for pycanon-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5cc5e45101eedf5c078fd9a3a01999943cdaadcb33a0c058053a92e5fd42191c
MD5 ea81c93a1d438f2bd4fa75105e29c732
BLAKE2b-256 68df0996d3ca03d44267aeef134de78fcbdf781455bb9235eb3122df34ba6dd8

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