Skip to content

Commit c7478f5

Browse files
committed
feat: Implement Python solution for Day 14 Transport KPI Automation
- Added setup instructions for Python in SETUP_PYTHON.md - Created main automation script (day14_MAIN_automation.py) to fetch KPIs and send email reports - Developed HTML email template for KPI reports - Included environment variable loading for SMTP configuration - Replaced n8n workflow with a pure Python solution, ensuring easier setup and maintenance - Added troubleshooting section for common issues - Updated workflow JSON for n8n to reflect changes in the automation process
1 parent febd835 commit c7478f5

24 files changed

+1811
-4816
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Each one ships with full code and documentation.
3636
| 11 | Orchestration | Retail Daily Performance Report Automation | TBD | ✅ Complete | [Day 11](./day11) |
3737
| 12 | Orchestration | Cybersecurity Data Quality Framework | TBD | ✅ Complete | [Day 12](./day12) |
3838
| 13 | Orchestration | Alert Triage Orchestrator (Finance Compliance) | TBD | ✅ Complete | [Day 13](./day13) |
39-
| 14 | Orchestration | TBD | TBD | 🚧 In Progress | [Day 14](./day14) |
39+
| 14 | Orchestration | Transport Regulatory KPIs - Automated Email Reports | TBD | ✅ Complete | [Day 14](./day14) |
4040
| 15 | Orchestration | TBD | TBD | 🚧 Planned | [Day 15](./day15) |
4141
| 16 | Dashboards | TBD | TBD | 🚧 Planned | [Day 16](./day16) |
4242
| 17 | Dashboards | TBD | TBD | 🚧 Planned | [Day 17](./day17) |

day14/.env.example

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
1-
# Day 14 - Transport Regulatory KPIs Email Reports (n8n)
2-
# Andrea (Policy & Transport Analytics)
3-
4-
# n8n Configuration
5-
DAY14_N8N_WEBHOOK_URL=http://localhost:5678/webhook/day14-transport-kpis
6-
7-
# SMTP Configuration (for n8n Email node)
8-
DAY14_SMTP_HOST=smtp.gmail.com
9-
DAY14_SMTP_PORT=587
10-
DAY14_SMTP_USERNAME=your_email@example.com
11-
DAY14_SMTP_PASSWORD=your_app_password_here
12-
13-
# Email Settings
14-
DAY14_SENDER_EMAIL=reports@transport-analytics.example.com
15-
DAY14_SENDER_NAME=Transport Analytics
16-
DAY14_RECIPIENT_EMAILS=andrea@example.com,manager@example.com,compliance@example.com
17-
18-
# Report Configuration
19-
DAY14_REPORT_TITLE=Daily Transport Regulatory KPIs
20-
DAY14_SCHEDULE_CRON=0 8 * * *
21-
DAY14_TIMEZONE=UTC
22-
23-
# Data Source Configuration
24-
DAY14_DATA_SOURCE_TYPE=csv
25-
DAY14_DATA_PATH=./data/day14_transport_data.csv
26-
DAY14_API_ENDPOINT=https://api.transport-data.example.com/v1/metrics
27-
28-
# Report KPIs
29-
DAY14_TARGET_COMPLIANCE_RATE=95.0
30-
DAY14_TARGET_ON_TIME_DELIVERY=90.0
31-
DAY14_TARGET_INCIDENT_RATE=2.0
32-
DAY14_TARGET_VEHICLE_UTILIZATION=80.0
33-
34-
# Testing
35-
DAY14_TEST_MODE=false
36-
DAY14_DRY_RUN=false
1+
# ⚠️ DO NOT CONFIGURE THIS FILE
2+
# Environment variables should be set in config/.env
3+
# Location: advent-automation-2025/config/.env (NOT day14/.env)
4+
5+
# Add these variables to ../config/.env:
6+
#
7+
# DAY14_SMTP_USER=your-email@gmail.com
8+
# DAY14_SMTP_PASSWORD=your-16-char-gmail-app-password
9+
# DAY14_SMTP_TO=your-email@gmail.com
10+
11+
# How to get Gmail App Password:
12+
# 1. Go to: https://myaccount.google.com/apppasswords
13+
# 2. Create password for "Mail"
14+
# 3. Copy 16-character password (no spaces)

0 commit comments

Comments
 (0)