Automatically fetches work schedules from Gmail and adds them to Google Calendar.
-
Install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Get Google API credentials:
- Go to Google Cloud Console
- Enable Gmail API and Calendar API
- Create OAuth credentials → Download as
credentials.json
-
Configure: Edit
main.py
:name = "Your Name" # Line 17 employer_email = "your.employer@company.com" # Line 240
-
Run:
python3 main.py
-
Optional - Set up automation:
crontab -e # Add: 0 22 * * 7 /path/to/your/project/run_schedule.sh # run pwd in terminal to get path to run_schedule.sh
- Searches Gmail for Excel schedules from your employer
- Finds your shifts and creates calendar events
- Handles time formats like
5:30-CL
and6-CL
- "No shifts found": Check your name matches the Excel file exactly
- "ModuleNotFoundError": Activate virtual environment first
- Auth issues: Delete
token.json
and run again
Never commit credentials.json
or token.json
- they contain sensitive data.