The Scenario
Every Monday, a data analyst manually opens 3 CSVs, calculates KPIs, pastes them into an email template, and sends it to 12 stakeholders. It takes 90 minutes. You need to automate this.
The Brief
Write a Python script that reads the data, calculates the KPIs, generates an HTML report with inline CSS (suitable for email), and saves it to a file. The script should be idempotent and handle missing files gracefully.
Deliverables
- The complete Python script with clear function separation (load, calculate, render, save)
- The HTML template showing at least 3 KPIs with conditional formatting (green/red based on targets)
- Error handling for missing files, empty datasets, and data quality issues
Submission Guidance
This is a software engineering task disguised as a data task. Clean function boundaries, error handling, and logging matter as much as the calculations.
Submit Your Work
Your submission is graded against the rubric on the right. If you pass, you get a public Badge URL you can share on LinkedIn. There is no draft save, so work offline first and paste your finished response here.