af.model.reports package

Subpackages

Submodules

af.model.reports.TransformationMetrics module

class af.model.reports.TransformationMetrics.TransformationMetrics(data_config)[source]

Bases: object

Class that queries an anonymized table and can generate some metrics based on the data

get_additional_information()[source]

Returns the additional information the anonymization algorithm left behind

Return type:Dictionary containing additional information to be displayed
number_of_qi_eq_classes_generated()[source]

Returns the amount of equivalence classes created for each quasi-identifier attribute during the anonymization process

Return type:List of frequencies
qi_eq_classes_differences()[source]

Returns the differences between the amount of equivalence classes existent before and after the anonymization process for each quasi-identifier attribute.

Return type:Dictionary that stores the equivalence classes values
qi_eq_classes_generated()[source]

Returns all the equivalence classes created for each quasi-identifier attribute during the anonymization process

Return type:List of equivalence classes
removed_outlier_rows()[source]

Returns the amount of rows that were deleted during the anonymization process

Return type:Number of outliers rows removed

Module contents

af.model.reports.convert_report_to_pdf(html_string, report_name)[source]

Given a html output, and a report name, convert it to a pdf

Parameters:
  • html_string (string) – An HTML output
  • report_name (string) – Name of the final report
af.model.reports.create_basic_report(transformation_metrics, template_name='my_report.html', report_location_path=None, convert_to_format='html')[source]

Create a basic report

Parameters:
  • transformation_metrics – Instance of the TransformationMetrics class
  • template_name (string) – Template to use
  • report_location_path (string) – Custom location where we want to export the report
  • convert_to_format (string) – Indicates to which format the report should be exported. (HTML by default)
Return type:

String location of the created report

af.model.reports.get_anonymized_sample(data_config)[source]

Return a sample of the anonymization data

Parameters:data_config – Instance of class DataConfig
Return type:List sample of anonymized data
af.model.reports.get_list_of_deletable_attributes_for_pdf()[source]

When exporting to PDF, some things should be deleted, like things that have a certain behaviour based on jquery

Return type:Tuple containing all the strings to look and remove from the html output
af.model.reports.get_report_location_output(report_name)[source]

Return the full report location.

Parameters:report_name (string) – Name of the report
Return type:Full location of the report
af.model.reports.get_templates_location()[source]

Return the location of the templates directory

Return type:Path to the templates directory