orangeqs.juice.reporting.examples#

Example module for report generation functions.

This module includes an example ReportModel and a function to generate report data from aggregated input data. You can customize the ReportModel and the generate_report_data function to fit your specific reporting needs. The example also includes a function to create a figure from system logs data, which can be included in the report.

Module Contents#

Classes#

ExampleAggregateInputData

Generate Aggregated Input Data.

ReportModel

Example model for report data.

Functions#

get_aggregate_input_data

Generate Aggregate Input Data.

generate_report_data

Generate example report data.

API#

class orangeqs.juice.reporting.examples.ExampleAggregateInputData(/, **data: Any)#

Bases: pydantic.BaseModel

Generate Aggregated Input Data.

You can customize this model to include any fields relevant to your report generation needs.

text_data: str#

‘Hello Reporting Engine!’

memory_usage_data: pandas.DataFrame#

None

model_config#

‘ConfigDict(…)’

orangeqs.juice.reporting.examples.get_aggregate_input_data(**kwargs: dict[str, Any]) orangeqs.juice.reporting.examples.ExampleAggregateInputData#

Generate Aggregate Input Data.

In this example, we query the InfluxDB for PodmanStatsEvent data from the last day and return it as a DataFrame in the Model. You can replace this with any data fetching and transformation logic relevant to your use case.

class orangeqs.juice.reporting.examples.ReportModel(/, **data: Any)#

Bases: pydantic.BaseModel

Example model for report data.

This model includes a text field and a dictionary of figures that can be rendered in the template. You can customize this model to include any fields relevant to your report generation needs, such as tables, additional text fields, or different types of figures.

text_field: str#

None

figures: orangeqs.juice.reporting.data.schemas.Figures#

None

orangeqs.juice.reporting.examples.generate_report_data(aggregate_input_data: orangeqs.juice.reporting.examples.ExampleAggregateInputData, output_dir: orangeqs.juice.reporting.data.schemas.OutputDirectories, **kwargs: dict[str, Any]) orangeqs.juice.reporting.examples.ReportModel#

Generate example report data.

In this example, we create a figure from the system logs data and add it to the figures dictionary in the ReportModel. You can customize this function to generate any type of content and figures based on your aggregated data.