Skip to main content

arkhn_arx

arkhn_arx is a module for dataset pseudonymization or anonymization which wraps pyarxaas

Install

pip install arkhn_arx

Connection to ARXaas service

This module uses https://github.com/navikt/arxaas service.

To run this service locally :

  1. Make sure Docker Desktop is running
  2. Pull the Docker image
docker pull navikt/arxaas
  1. Run the Docker image
docker run -p 8080:8080 navikt/arxaas

Anonymization

Principle

This module can be used in 3 modes : to evaluate reidentification risk of a dataset, pseudonymize dataset or anonymize dataset. Anonymization is performed using k-anonymity and l-diversity algorithms.

  • k-anonymity ensures that the information for each person contained in the release cannot be distinguished from at least k-1 individuals whose information also appears in the release (defining a k-anonymity group).
  • l-diversity ensures that sensitive attributes are well represented (at least l distinct values) in each k-anonymity group

Arguments

  • input_dataframe to anonymize
  • configuration_file : json file containing anonymization parameters
config_dict = {"anonymization":{"type": 2, "k":2, "l":2},
                "attributes":[
                            {"customName":"att_1",
                             "att_type":"att_type"
                             "hierarchy_type":"hierarchy_type"}, 
                            ]
                }
  • Anonymization parameters:

    • type : 0 returns risk metrics for initial dataset, 1 pseudonymize dataset, 2 anonymize dataset
    • k : parameter for K-anonymity
    • l : parameter for l-diversity
  • Attributes parameters: for each attribute gives :

    • customName : column name of attribute in dataframe
    • att_type : attribute type for anonymization, can be:
      • "insensitive" : will be kept unmodified
      • "sensitive" : will be kept as-is but they can be protected using privacy models, such as t-closeness or l-diversity
      • "quasiidentifying" : will be transformed using hierarchies
      • "identifying"" : will be removed from the dataset
    • hierarchy_type : type of hierarchy to apply to attribute for anonymization, can be:
      • "interval" : can be used for variables with a ratio scale, intervals are defined using attribute quantiles
      • "date" : can be used for dates
      • "redaction" : can be used for a broad spectrum of attributes, masking parts of variables
      • "order" : NOT IMPLEMENTED can be used for variables with an ordinal scale, defining ordered group of variables
  • URL_link to ARXaaS service : if ARXaas service is running locally URL is : "http://localhost:8080"

Example

You can test this module using the example.py script

Release files for arkhn-arx 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arkhn-arx 0.0.8
File Size Uploaded
arkhn_arx-0.0.8.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arkhn-arx 0.0.8
File Interpreter ABI Platform
arkhn_arx-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / arkhn_arx-0.0.8.tar.gz

Download URL arkhn_arx-0.0.8.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
93eae1b9111138318631dcdffe065229a0b86b442dfcddb52fdfc43d00d9fe74
BLAKE2b-256 checksum
How to use checksums
8d57ccba4368deb453108dd57fb89327995267e24fc0e6b8e6e19e5e259423f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release files / arkhn_arx-0.0.8-py3-none-any.whl

Download URL arkhn_arx-0.0.8-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00dd3ccb84dac74edbc4d8dc4e9ad304701abc656327d290bb2e1381ac18cd0b
BLAKE2b-256 checksum
How to use checksums
b105882d538ddec01890a90183b0dcbb69ee49147f905eebd0d8e64162e96fb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

3 release files

0.0.2

1 release file

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page