Welcome to PyARXaaS’s documentation!¶
PyARXaaS is a Python wrapper package for ARXaaS. It provides user-friendly abstractions for the APIs exposed ARXaaS. Github link
- For quick-start see Quick Start
- For more in-depth information about the API see API Documentation .
How it works¶
PyARXaaS is a simple pure Python client package that provides abstractions for interacting with a ARXaaS instance. The package supports analyzing re-identification risks and anonymizing tabular datasets containing sensitive personal data.
Features¶
- ARXaaS class for configuration and calling actions.
- Dataset class for encapsulating and configuring a dataset
- Privacy Model classes for configuring the Privacy Models to use in anonymization.
- Easy integration with pandas DataFrames
Simple Use Case¶
Quick overview of how to get started using the package:
# import dependencies
from pyarxaas import ARXaaS
from pyarxaas.privacy_models import KAnonymity
from pyarxaas import AttributeType
from pyarxaas import Dataset
import pandas as pd
arxaas = ARXaaS(url) # url contains url to AaaS web service
df = pd.read_csv("data.csv")
# create Dataset
dataset = Dataset.from_pandas(df)
# set attribute type
dataset.set_attributes(AttributeType.QUASIIDENTIFYING, 'name', 'gender')
dataset.set_attribute(AttributeType.IDENTIFYING, 'id')
# get the risk profle of the dataset
risk_profile = arxaas.risk_profile(dataset)
# get risk metrics
re_indentifiation_risk = risk_profile.re_identification_risk
distribution_of_risk = risk_profile.distribution_of_risk
Licensing¶
PyARXaaS is distributed under the MIT license. See LICENCE
- User Guide
- API Documentation
- Example Notebooks
- Example analyzation and anonymization of sensitive dataset
- Hierachy generation using PyARXaaS
- Create connection to ARXaaS
- Fetch data
- 1. Extract column to create hierarchy from
- 2. Create hierarchy builder to use
- 3. Call the ARXaaS service to create the hierarchy
- Redaction hiearchy without configuration
- 1. Extract column to create hierarchy from
- 2. Create hierarchy builder to use
- 3. Add intervals to the builder. The intervals must be continous(without gaps)
- 4. (Optionally) Add groupings. Groupings are added to a specific level and are order based according to the interval order
- 3. Call the ARXaaS service to create the hierarchy
- 1. Extract column to create hierarchy from
- 2. Strip to uniques
- 3. Order column values
- 2. Create hierarchy builder to use
- 3. Group the values
- 3. Call the ARXaaS service to create the hierarchy
- 1. Create the builder