reporting¶
PDF report generation from any module's AnalysisOutput.
report_builder ¶
PDF report builder using reportlab. Assembles analysis metadata, AI interpretation, embedded map PNG, charts, and recommendations into a structured PDF.
ReportBuilder ¶
Builds a PDF report for any completed AnalysisOutput. Drought module gets additional CDI sub-index and forecast sections.
Source code in reporting/report_builder.py
build ¶
build(output: AnalysisOutput, ai_interpretation: str | None = None, map_png_bytes: bytes | None = None) -> Path
Assemble and write the PDF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
AnalysisOutput
|
completed AnalysisOutput from any module. |
required |
ai_interpretation
|
str | None
|
human-centered AI text (optional; section omitted if None). |
None
|
map_png_bytes
|
bytes | None
|
PNG screenshot of the Leaflet result map (optional). |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the written PDF file. |