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 and the derived Homebrew coverage column).

  • 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]ΒΆ

Convert the patch titles into a JSON-serializable dict.

The returned dict has the shape:

{
    "generated_at": "2026-05-04T18:30:00+00:00",
    "report_title": "...",
    "title_count": 42,
    "titles": [<PatchTitle.model_dump()>, ...]
}
Parameters:

report_title (str | None) – Optional title carried through to consumers.

Returns:

A dict ready for json.dump or direct programmatic use.

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) 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.

Returns:

A dictionary containing paths to generated reports.

Return type:

dict[str, str]