Report

class olliepy.Report.Report(title: str, output_directory: str, subtitle: str = None, report_folder_name: str = None, encryption_secret: str = None, generate_encryption_secret: bool = False)[source]

Report is the parent class of all the reports. It contains all the method for generating the reports and common attributes that all reports share.

titlestr

the title of the report

output_directorystr

the directory where the report folder will be created

subtitlestr default=None

an optional subtitle to describe your report

report_folder_namestr default=None

the name of the folder that will contain all the generated report files. If not set, the title of the report will be used.

encryption_secretstr default=None

the secret that will be used to encrypt the generated report data. If it is not set, the generated data won’t be encrypted.

generate_encryption_secretbool default=False

the encryption_secret will be generated and its value returned as output. you can also view encryption_secret to get the generated secret.

_update_report()

updates the report dictionary inside the report_data dictionary

_create_report_directory() → str[source]

Creates the report directory if it doesn’t exist.

Returns

report_directory: the report directory

_encrypt_report_data() → bytes[source]

Encrypt Report data using 128 bit AES secret

Returns

encrypted_data: the encrypted data in bytes

_save_report_data(report_directory: str) → None[source]

Takes the report_directory and saves the data as json there.

Parameters

report_directory

Returns

None

_save_the_report(template_name: str, zip_report: bool) → None[source]

Creates the report directory, copies the web application based on the template name, saves the report data.

Parameters

template_name – the name of the report’s template

Returns

None

_serve_report_using_flask(template_name: str, mode: str, port: int, load_existing_data: bool = False) → None[source]

Creates the report directory, copies the web application based on the template name, saves the report data and starts the flask server.

Parameters
  • template_name – the name of the report’s template

  • mode – the server mode

  • port – the server port

  • load_existing_data – load existing json data

Returns

None

_update_report(data: Dict) → None[source]

Updates the report dictionary in report_data.

Parameters

data – Dict, the data dictionary that will be added to the report dictionary in report_data

Returns

None

_zip_report_directory(report_directory: str) → None[source]

Zip the report directory so it can be easier to download, in case the end user is not working locally.

Parameters

report_directory – the report directory to zip

Returns