Assignment: 2.50 — Insight Export & Report Generation
Engine: export_functions.py & streamlit_export_integration.py
Output Directory: output/<YYYY-MM-DD_HHMM>_analysis/
Every analysis generated by SalesPulse is automatically compiled into three portable output formats designed to serve different stakeholder needs:
| File Name | Format | Primary Stakeholder | Key Features & Purpose |
|---|---|---|---|
cleaned_data.csv |
CSV Dataset | Financial Analysts, Ops Team | Raw cleaned dataset ready for pivot tables, custom Excel modeling, or VLOOKUP joining. Includes record count and date boundaries. |
summary_report.pdf |
PDF Document | Executive Leadership, Board | Standalone non-technical executive summary. Includes situation overview, key findings, risk quantification, and actionable recommendations. |
interactive_report.html |
Single-File HTML | Product Managers, Sales Ops | Complete interactive report with embedded Plotly charts (hover cards, zoom/pan). Runs in any browser without needing Python. |
README.md |
Markdown Metadata | Analytics Audit Team | Complete data dictionary, record count, timestamp, column definitions, and refresh schedule history. |
- Purpose: Enables self-serve analysis for stakeholders who want to explore raw data in Excel or PowerBI.
- Content: 100+ customer transaction rows including
customer_id,date,segment,revenue,support_response_hours, andchurn_risk. - Use Case:
- Filter by customer segment (Enterprise vs. SMB)
- Calculate custom averages or build Excel pivot tables
- Merge with internal CRM exports
- Purpose: High-level summary designed for 3-minute executive reading during meetings or email distribution.
- Content: Executive situation, quantitative findings, risk analysis ($2.0M churn loss), and $400K revenue recovery recommendations.
- Use Case:
- Email attachment for executive briefings
- Printable handout for board meetings
- Archival reference for budget decision approvals
- Purpose: Full analytical deep-dive with responsive Plotly visualisations.
- Content: Summary text + interactive Plotly charts (Response Time Distribution & Revenue Scatter).
- Use Case:
- Double-click to open in Chrome/Edge/Firefox
- Hover over data points to inspect exact customer transaction values
- Pan and zoom into specific date ranges or customer spend tiers
- For Excel Analysis: Open
cleaned_data.csvdirectly in Microsoft Excel or Google Sheets. - For Executive Emailing: Attach
summary_report.pdffor C-suite decision sign-offs. - For Browser Exploration: Double-click
interactive_report.htmlto explore charts interactively without installing Python. - For Immediate Downloads: Open
streamlit_export_integration.pyand click "📥 Export Analysis" or "📊 Download Data (CSV)" in the sidebar.
- Automated Daily Run: Scheduled job executes daily at 17:00 UTC via
export_functions.py(scheduled_export_job()). - On-Demand Execution: Analysts can click "Export Analysis" in the Streamlit UI at any time for instant report compilation.
- Graceful Failover: If PDF generation binaries are absent, the system falls back to a native Python PDF layout writer without crashing the export pipeline.
- Error Logging: Failed export attempts log error tracebacks to
output/export_error_log.txtwith timestamps. - Audit Trail: Timestamped folders (
output/2026-08-11_1130_analysis/) ensure previous reports are preserved for week-over-week comparison.