ShiftCreator is an interactive Python tool that automatically generates Outlook calendar events based on a repeating shift pattern. It authenticates using Microsoft’s Interactive Browser Login and inserts events directly into your chosen Outlook calendar using the Microsoft Graph API.
The tool includes a clean Rich‑powered terminal UI, supports both Simple Mode and Advanced Mode, and validates user input to prevent mistakes.
- Interactive wizard with Simple and Advanced modes
- Microsoft Graph authentication via InteractiveBrowserCredential
- Creates events in any Outlook calendar
- Configurable:
- Shift pattern
- Day/night start times
- Shift duration
- Calendar name
- Rich terminal UI (tables, colours, progress bars)
- Validates dates, timezones, and user inputs
- Supports .env configuration for secrets
Clone the repository:
git clone https://github.com/yourusername/shiftcreator.git
cd shiftcreator
Install dependencies:
pip install -r requirements.txt
Create a .env file in the project root:
CLIENT_ID=your_azure_app_client_id
TENANT_ID=your_azure_tenant_id
These values come from your Azure App Registration.
Your app registration must be configured as a public client:
- Redirect URI: http://localhost:8400
- "Allow public client flows" enabled
- API Permissions:
Calendars.ReadWrite (delegated)
ShiftCreator uses a repeating 28‑day cycle defined as:
SHIFT_PATTERN =
('night', 3)
('day', 2)
('night', 4)
('day', 2)
('day', 3)This means:
Block 1 — Night — 3 days
Block 2 — Day — 2 days
Block 3 — Night — 4 days
Block 4 — Day — 2 days
Block 5 — Day — 3 days
After each block, the pattern includes an equal number of off‑days before the next block begins.
The cycle repeats until the requested number of days is generated.
When the tool asks for the shift pattern start date, enter the date on which the first block begins — the start of the first Night (3 days) block.
Run the tool:
python shiftcreator.pyYou will be prompted to choose:
Asks for:
- Start date
- Number of days
Uses defaults:
- Calendar name: work
- Day shift start: 06:00
- Night shift start: 18:00
- Duration: 12 hours
Allows you to customise:
- Calendar name
- Start date
- Number of days
- Day shift start hour
- Night shift start hour
- Shift duration
Before running the tool, ensure:
-
Your Outlook account has a calendar named "work" (or whichever name you choose)
-
Outlook categories:
- Day Shift
- Night Shift
already exist
(Microsoft Graph requires categories to be created before assigning them)
MIT License. See LICENSE for details.