Automated system to generate personalized marketing maturity assessment presentations from Google Sheets survey data.
flowchart TD
A[Google Sheet<br/>Survey Data] --> B[Load & Parse Data]
B --> C[Calculate Category Scores]
C --> D[Generate AI Recommendations]
D --> E[Create PowerPoint Presentations]
E --> F{Presentation<br/>Already Exists?}
F -->|Yes| G[Skip Client]
F -->|No| H[Save to output/]
H --> I[Next Client]
G --> I
I --> J{More Clients?}
J -->|Yes| C
J -->|No| K[Complete]
style A fill:#e1f5ff
style K fill:#d4edda
style D fill:#fff3cd
style E fill:#f8d7da
flowchart LR
subgraph Input["π₯ Input"]
GS[Google Sheet<br/>Client Responses]
TEMPLATE[PowerPoint Template]
end
subgraph Processing["βοΈ Processing"]
LOAD[Load Data<br/>via CSV Export]
CLEAN[Clean Column Names<br/>& Map Questions]
SCORE[Calculate Category Scores<br/>Average per Topic]
AI[OpenAI API<br/>Generate Recommendations]
end
subgraph Output["π€ Output"]
PPT[PowerPoint Presentation<br/>Per Client]
CHECK{File Exists?}
SAVE[Save to output/]
SKIP[Skip]
end
GS --> LOAD
LOAD --> CLEAN
CLEAN --> SCORE
SCORE --> AI
TEMPLATE --> PPT
AI --> PPT
PPT --> CHECK
CHECK -->|No| SAVE
CHECK -->|Yes| SKIP
style GS fill:#e1f5ff
style TEMPLATE fill:#e1f5ff
style AI fill:#fff3cd
style SAVE fill:#d4edda
style SKIP fill:#f8d7da
flowchart TD
START[Workflow Triggered<br/>Daily at 9 AM UTC] --> CHECKOUT[Checkout Repository]
CHECKOUT --> SETUP[Set Up Python Environment]
SETUP --> INSTALL[Install Dependencies]
INSTALL --> RUN[Run maturity_assessment.py]
RUN --> LOAD_DATA[Load Google Sheet Data]
LOAD_DATA --> PROCESS[Process Each Client]
PROCESS --> GEN[Generate Presentations]
GEN --> UPLOAD[Upload Artifacts]
UPLOAD --> END[Workflow Complete]
style START fill:#e1f5ff
style RUN fill:#fff3cd
style GEN fill:#f8d7da
style UPLOAD fill:#d4edda
style END fill:#d4edda
- π Loads survey data directly from Google Sheets
- π― Calculates category scores for each client
- π€ Generates AI-powered recommendations using OpenAI
- π Creates personalized PowerPoint presentations
- π¨ Automatically positions score indicators on slides
pip install -r requirements.txtSet your OpenAI API key as an environment variable:
export OPENAI_API_KEY='your-api-key-here'Or add it to your ~/.zshrc (or ~/.bashrc) for persistence:
echo "export OPENAI_API_KEY='your-api-key-here'" >> ~/.zshrc
source ~/.zshrcUpdate the SHEET_ID and GID in maturity_assessment.py if using a different Google Sheet.
python maturity_assessment.pyOr make it executable and run directly:
chmod +x maturity_assessment.py
./maturity_assessment.pyGenerated PowerPoint presentations will be saved in the output/ directory with filenames like:
client_email_at_domain_com_Maturity_Assessment.pptx
Automatically run the script daily using GitHub Actions:
-
Set up the secret:
- Go to your repository on GitHub
- Click Settings β Secrets and variables β Actions
- Click New repository secret
- Name:
OPENAI_API_KEY - Value: Your OpenAI API key
- Click Add secret
-
The workflow is already configured:
- The workflow file is at
.github/workflows/daily-assessment.yml - It runs daily at 9:00 AM UTC
- You can manually trigger it from the Actions tab
- The workflow file is at
-
Access generated files:
- Go to the Actions tab after a run completes
- Click on the latest run
- Download the
maturity-assessmentsartifact to get all generated presentations
-
Adjust schedule (optional):
- Edit
.github/workflows/daily-assessment.yml - Change the cron schedule:
'0 9 * * *'(9 AM UTC daily) - Cron format:
minute hour day month day-of-week - Example:
'0 14 * * *'= 2 PM UTC daily
- Edit
- Create a plist file at
~/Library/LaunchAgents/com.maturity.assessment.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.maturity.assessment</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python3</string>
<string>/Users/shazahmed/Documents/python_repos/maturity_auto/maturity_assessment.py</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/shazahmed/Documents/python_repos/maturity_auto</string>
<key>EnvironmentVariables</key>
<dict>
<key>OPENAI_API_KEY</key>
<string>your-api-key-here</string>
</dict>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>9</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/shazahmed/Documents/python_repos/maturity_auto/logs/output.log</string>
<key>StandardErrorPath</key>
<string>/Users/shazahmed/Documents/python_repos/maturity_auto/logs/error.log</string>
</dict>
</plist>- Load the job:
launchctl load ~/Library/LaunchAgents/com.maturity.assessment.plist- Check status:
launchctl list | grep maturityAdd to crontab (crontab -e):
# Run daily at 9:00 AM
0 9 * * * cd /path/to/maturity_auto && /usr/bin/python3 maturity_assessment.py >> logs/cron.log 2>&1- Open Task Scheduler
- Create Basic Task
- Set trigger (daily at 9:00 AM)
- Set action: Start a program
- Program:
python - Arguments:
maturity_assessment.py - Start in:
C:\path\to\maturity_auto
- Program:
maturity_auto/
βββ maturity_assessment.py # Main automation script
βββ maturity_analysis.ipynb # Jupyter notebook (for development)
βββ Maturity_Slide_Template.pptx # PowerPoint template
βββ requirements.txt # Python dependencies
βββ output/ # Generated presentations (gitignored)
βββ README.md # This file
The assessment covers 5 categories:
- Tech & Data (5 questions)
- Campaigning & Assets (6 questions)
- Segmentation & Personalisation (3 questions)
- Reporting & Insights (6 questions)
- People & Operations (4 questions)
- Python 3.8+
- OpenAI API key
- Google Sheet with survey responses
- PowerPoint template file
[Your License Here]