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).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]#
Serialize the patch titles to a JSON-ready dict (see
titles_to_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_colorwhenNone.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/Ncoverage columns (one per token). Read from each titleβssourcesmap.None(default) renders no integration columns.
- Returns:
A dictionary containing paths to generated reports.
- Return type: