Common package

Submodules

LOGS_solutions.GenerateStatistics.Common.CommonHandler module

class LOGS_solutions.GenerateStatistics.Common.CommonHandler.CommonHandler(logs, begin_date, end_date, target_path)[source]

Bases: ABC

This class provides methods to create statistics from LOGS data and save them as HTML or PDF files.

create_report(path, html, pdf, file_name, plot)[source]

Creates a HTML or PDF file from a plot with the LOGS-PY Style.

Parameters:
  • path (str) – Path where the HTML should be saved.

  • html_name – Name of the HTML file.

  • plot (Figure) – Plot that should be saved as HTML.

LOGS_solutions.GenerateStatistics.Common.DateHandler module

class LOGS_solutions.GenerateStatistics.Common.DateHandler.DateHandler[source]

Bases: object

This class provides methods to handle dates.

The class provides methods to check if a given date is in the correct format and to check if a given date is in a given range. Additionally, the class provides a method to convert seconds to days, hours, minutes and seconds.

static check_date(date)[source]

Checks if the given date is a datetime object.

Parameters:

date (datetime) – check if the given date is a datetime object.

Return type:

datetime

Returns:

datetime object

static check_date_range(current_date, begin_date, end_date)[source]

Checks if the current date is in the range between begin_date and end_date.

Parameters:

current_date (datetime) – Date which is to be checked

Return type:

bool

Returns:

Boolean if the current_date is in the range

static seconds_to_dhms(seconds)[source]

LOGS_solutions.GenerateStatistics.Common.OutputGenerator module

class LOGS_solutions.GenerateStatistics.Common.OutputGenerator.OutputGenerator(template_folder, template_name)[source]

Bases: object

This class provides methods to create PDF and HTML files from a plot with the LOGS-PY style.

create_html(path, html_name, plot)[source]

Creates a HTML file from a plot with the LOGS-PY Style.

Parameters:
  • path (str) – Path where the HTML should be saved.

  • plot (Figure) – Plot that should be saved as HTML.

create_pdf(path, pdf_name, plot)[source]

Creates a PDF file from a plot with the LOGS-PY Style.

Parameters:
  • path (str) – Path where the PDF should be saved.

  • pdf_name (str) – Name of the PDF file.

  • plot (Figure) – Plot that should be saved as PDF.

Module contents