ExporterΒΆ
- class Exporter(patch_titles: list[PatchTitle], ui_config: dict | None = None)[source]ΒΆ
Renders a list of
PatchTitleobjects to report files (PDF, Excel, HTML, JSON).The
Exporterrenders patch titles to report files. It is a pure consumer: the canonical DataFrame is built and cached upstream byDataManagerand handed in toexport(); 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
PDFReportwhen generating PDF output. WhenNone,PDFReportfalls back toUIDefaultsvalues.
- 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()>, ...] }
- 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_colorwhenNone.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: