Operations & Admin
scheduling calendar
How to Build a Resource Scheduling System
Schedule shared resources like rooms, equipment, and team members automatically.
Jay Banlasan
The AI Systems Guy
This resource scheduling system handles automated booking for rooms, equipment, and shared team members. One calendar view for everything bookable.
What You Need Before Starting
- Python 3.8+
- Google Calendar API credentials
- Flask for webhook endpoints
- SMTP or Slack for notifications
Step 1: Connect Calendar API
Set up access to Google Calendar or Outlook.
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
def get_calendar_service(creds_path):
creds = Credentials.from_authorized_user_file(creds_path)
return build("calendar", "v3", credentials=creds)
def get_events(service, time_min, time_max):
events = service.events().list(
calendarId="primary", timeMin=time_min, timeMax=time_max,
singleEvents=True, orderBy="startTime"
).execute()
return events.get("items", [])
Step 2: Build the Logic
Implement the core resource scheduling algorithm.
from datetime import datetime, timedelta
def find_available_slots(events, date, duration_minutes=30):
busy = [(e["start"]["dateTime"], e["end"]["dateTime"]) for e in events]
slots = []
current = datetime.combine(date, datetime.min.time().replace(hour=9))
end_of_day = current.replace(hour=17)
while current + timedelta(minutes=duration_minutes) <= end_of_day:
slot_end = current + timedelta(minutes=duration_minutes)
is_free = all(slot_end <= b[0] or current >= b[1] for b in busy)
if is_free:
slots.append({"start": current.isoformat(), "end": slot_end.isoformat()})
current += timedelta(minutes=15)
return slots
Step 3: Handle Notifications
Send confirmations and updates automatically.
def send_calendar_notification(event, recipients, notification_type):
templates = {
"confirmed": "Your {event_type} is confirmed for {time}",
"reminder": "Reminder: {event_type} in {minutes} minutes",
"cancelled": "{event_type} has been cancelled",
}
message = templates[notification_type].format(
event_type=event["summary"], time=event["start"],
minutes=event.get("reminder_minutes", 15))
for recipient in recipients:
send_email(recipient, f"Calendar: {event['summary']}", message)
Step 4: Store and Track
Keep a log of all scheduling actions.
import sqlite3
def log_scheduling_action(action_type, event_data):
conn = sqlite3.connect("scheduling.db")
conn.execute("""INSERT INTO schedule_log
(action, event_id, details, timestamp)
VALUES (?, ?, ?, ?)""",
(action_type, event_data["id"], json.dumps(event_data), datetime.now().isoformat()))
conn.commit()
Step 5: Automate the Workflow
Set up triggers and cron jobs.
# Run scheduling checks every 15 minutes during business hours
*/15 8-17 * * 1-5 cd /root/scheduler && python check_schedule.py
def run_scheduled_checks():
service = get_calendar_service("creds.json")
events = get_events(service, datetime.now().isoformat(), (datetime.now() + timedelta(hours=1)).isoformat())
for event in events:
check_and_notify(event)
What to Build Next
Add utilization tracking to see which resources sit idle.
Related Reading
- The Scheduling System - scheduling system automated operations
- Creating an Automated Meeting Scheduling System - automated meeting scheduling system guide
- Building an AI-Powered Scheduling System - ai scheduling system guide
Want this system built for your business?
Get a free assessment. We will map every system your business needs and show you the ROI.
Get Your Free Assessment