Add a modular, opt-in PDF report builder - #31
Merged
Conversation
Unlike generate_html_report(), which always bundles every section into one fixed file, this lets the user check which tabs to include (Process Maps, Variants, Bottlenecks, Conformance, Funnel, Business Insights, Session Insights, Segment Comparison) before generating a PDF, so a shareable report can be scoped to just what's relevant. Built with reportlab - pure Python, no system rendering dependency (no wkhtmltopdf binary, no Cairo/Pango) - consistent with the "runs on a standard laptop" design goal. Only sections with actual data are offered as checkboxes. Wired into main.py as a new "Build a Custom PDF Report" section below the results tabs.
BasLinders
marked this pull request as ready for review
August 21, 2026 11:08
BasLinders
added a commit
that referenced
this pull request
Sep 8, 2026
Add a modular, opt-in PDF report builder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pdf_builder.py: a modular PDF report builder, separate fromprox/report.py'sgenerate_html_report(). Where that HTML report always bundles every section into one fixed file, this presents a checkbox per available results tab (Process Maps, Variants, Bottlenecks, Conformance, Funnel, Business Insights, Session Insights, Segment Comparison) and only includes what's checked — so a shared PDF can be scoped to just what's relevant instead of exporting everything.reportlab(pure Python, no system rendering dependency — no wkhtmltopdf binary, no Cairo/Pango), consistent with the "runs on a standard laptop" design goal already in the README. Added as a new base dependency inrequirements.txt/setup.py.main.pyas a new "5. Build a Custom PDF Report" section below the results tabs, reading from the sameresultsdict (andsegment_result, if present) the tabs already render from.Why
The HTML report is all-or-nothing. This makes reporting modular: pick exactly the sections a given audience needs (e.g. just Business + Session Insights for a stakeholder update) instead of a fixed everything-bundle.
Test plan
pytest tests/— 129 passed (10 new tests intests/test_pdf_builder.pycovering section availability/filtering, individual section builders with and without data, and end-to-end PDF byte generation)['business', 'sessions']) — verified valid%PDFoutput both times, with the subset producing a smaller file