Exporter#

class Exporter(patch_titles: list[PatchTitle], ui_config: dict | None = None)[source]#

Renders a list of PatchTitle objects to report files (PDF, Excel, HTML, JSON).

The Exporter renders patch titles to report files. It is a pure consumer: the canonical DataFrame is built and cached upstream by DataManager and handed in to export(); the exporter never touches the cache.

Parameters:
  • patch_titles (list[PatchTitle]) – Titles backing the report (used for the JSON payload).

  • ui_config (dict | None) – Optional dict of UI settings (header text, footer text, font paths, logo, header color) forwarded to PDFReport when generating PDF output. When None, PDFReport falls back to UIDefaults values.

serialize_titles_to_dict(report_title: str | None = None) → dict[source]#

Serialize the patch titles to a JSON-ready dict (see titles_to_dict()).

Parameters:

report_title (str | None)

Return type:

dict

async export(df: DataFrame, output_dir: str | Path, report_title: str, analysis: bool = False, date_format: str = '%B %d %Y', formats: set[str] | None = None, header_color: str | None = None, device_reports: dict[str, list[PatchDevice]] | None = None, coverage: list[str] | None = None) → dict[str, str][source]#

Render the patch data to the specified report formats.

Parameters:
  • df (pandas.DataFrame) – The canonical, already-cached DataFrame to render. Presentation- excluded columns are dropped here before rendering.

  • output_dir (str | Path) – The directory in which to save the exported report(s).

  • report_title (str) – The title to use for the header in exported report(s).

  • analysis (bool) – Denotes whether this is an analysis report (affects HTML output path).

  • date_format (str) – The date format for PDF/HTML headers. Defaults to β€œ%B %d %Y”.

  • formats (set | None) – A set of formats to export. Defaults to all ({β€œexcel”, β€œhtml”, β€œpdf”, β€œjson”}).

  • header_color (str | None) – Hex color to use for HTML header table background. Falls back to header_color when None.

  • device_reports (dict[str, list[PatchDevice]] | None) – Optional dictionary mapping title IDs to device lists for per-title detail sheets.

  • coverage (list[str] | None) – Source tokens to render as opt-in Y/N coverage columns (one per token). Read from each title’s sources map. None (default) renders no integration columns.

Returns:

A dictionary containing paths to generated reports.

Return type:

dict[str, str]