Report Manager#

class ReportManager(api_client: ApiClient, data_manager: DataManager, debug=False, installomator: Installomator | None = None)[source]#

Handles the generation and management of patch reports.

Parameters:
  • api_client (ApiClient) – Interacts with the Jamf API to retrieve data needed for reporting.

  • data_manager (DataManager) – Generates Excel reports from collected patch data.

  • debug (bool) – Overrides animation of process_reports method if True.

  • installomator (Installomator) – An optional Installomator object for matching. Defaults to creating a new object during init.

calculate_ios_on_latest(device_versions: List[Dict[str, str]], latest_versions: List[Dict[str, str]]) List[PatchTitle][source]#

Analyzes iOS version data to determine how many enrolled devices are on the latest version.

This method compares the operating system versions of managed devices with the latest versions provided by the SOFA feed, calculating how many devices are fully updated.

Parameters:
  • device_versions (List [Dict]) – A list of dictionaries containing devices and their respective iOS versions.

  • latest_versions (List [Dict]) – A list of the most recent iOS versions available.

Returns:

A list of PatchTitle objects, each representing a summary of the patch status for an iOS version.

Return type:

List [PatchTitle]

Raises:

PatcherError – If a KeyError or ZeroDivisionError is encountered.

async process_reports(path: str | Path, formats: set[str], sort: str | None, omit: bool, ios: bool, report_title: str, date_format: str = '%B %d %Y') None[source]#

Asynchronously generates and saves patch reports, with options for customization.

This method is the core of the report generation process, orchestrating the collection of patch data, sorting, filtering, and ultimately saving the data to an Excel file. It can also generate a PDF report and include additional iOS device data.

This function is not intended to be called directly by users, but rather is a key part of the CLI’s automated reporting process. It handles all the necessary steps from data collection to file generation, ensuring that reports are accurate, complete, and formatted according to the user’s preferences.

Parameters:
  • path (Union [str | Path]) – The directory where the reports will be saved. It must be a valid directory, not a file.

  • formats (set [str]) – The set of formats to export. Defaults to all (“excel”, “html”, “pdf”).

  • sort (Optional [str]) – Specifies the column by which to sort the reports (e.g., ‘released’ or ‘completion_percent’).

  • omit (bool) – If True, omits patches that were released within the last 48 hours.

  • ios (bool) – If True, includes iOS device data in the reports.

  • report_title

  • date_format (str) – Specifies the date format for headers in the reports. Default is “%B %d %Y” (Month Day Year).

Return type:

None