af.model package¶
Subpackages¶
- af.model.algorithms package
- Submodules
- af.model.algorithms.AfManager module
- af.model.algorithms.BaseAlgorithm module
- af.model.algorithms.BaseKAlgorithm module
- af.model.algorithms.Datafly module
- af.model.algorithms.GeneralizationLatticeGraph module
- af.model.algorithms.IncognitoK module
- af.model.algorithms.IncognitoL module
- Module contents
- af.model.hierarchies package
- af.model.reports package
Submodules¶
af.model.Attribute module¶
-
class
af.model.Attribute.Attribute(name=None, basic_type='string', privacy_type='Non-Sensitive', hierarchy=None, weight=1)[source]¶ Bases:
objectClass that models an attribute of a table.
-
get_hierarchy_representation()[source]¶ Returns the representation of the attribute hierarchy, if any
Return type: Dictionary representation of hierarchy (None if no hierarchy associated to the attribute)
-
get_representation()[source]¶ Returns the representation of the attribute
Return type: Attribute representation in a dictionary form
-
is_qi_attribute()[source]¶ Checks if it is a qi attribute
Return type: True if it is a QI attribute, False if not
-
load_config(config_dict)[source]¶ Given a configuration, it loads the attribute based on the saved data.
Parameters: config_dict (dict) – Dictionary containing information about the attribute
-
set_hierarchy(hierarchy_config)[source]¶ Given a hierarchy configuration, load it and save it to the attribute
Parameters: hierarchy_config (dict) – hierarchy configuration in the form of a dictionary
-
af.model.DataConfig module¶
-
class
af.model.DataConfig.DataConfig(project=None, location=None, data_type=None, table=None, attributes_list=None, anonymized_db_location=None, anonymized_table=None, metrics_table=None)[source]¶ Class that models all the project configuration
-
JSON_KEY= 'data_config'¶
-
config_representation(json_repr=True)[source]¶ Returns the configuration representation
Return type: Representation of the DataConfig in the form of a dictionary
-
get_normal_type_attributes_list()[source]¶ Returns those attributes that are neither identifier or qi
Return type: List of attributes not selected as identifier or qi
-
get_privacy_type_attributes_list(privacy_type='Quasi-Identifier')[source]¶ Returns those attributes that are of a certain privacy type
Parameters: privacy_type – Privacy type to filter attributes Return type: List of attributes that match with the privacy type
-
load_config(data_configuration, from_json=True)[source]¶ Given a configuration, load it into the instance
Parameters: - data_configuration – Previously saved configuraton that wants to be loaded
- from_json (bool) – Indicates if the configuration comes from a json representation or no
-