Skip to content

Instantly share code, notes, and snippets.

@camtheman256
Created August 27, 2025 19:20
Show Gist options
  • Save camtheman256/8bc4ac2beeabea798c67402968e54eba to your computer and use it in GitHub Desktop.
Save camtheman256/8bc4ac2beeabea798c67402968e54eba to your computer and use it in GitHub Desktop.
Generates a CSV-like output for rooms in Google Calendar's "Browse resources" pane
import json
import sys
import re
# intended usage: cat rooms.json | python rooms.py
# ...or: pbpaste | python rooms.py | pbcopy
if __name__ == "__main__":
# detects string ##FL in the room title, if present
fl = r"(\d+)FL"
with sys.stdin as inp:
rooms = json.loads(inp.read())
# output: (floor num), Room Title, Room Calendar ID (in base64)
print(
*(
f'{re.search(fl, room["title"]).group(1) if re.search(fl, room["title"]) else ""},"{room["title"]}","{room["did"]}"'
for room in rooms
),
sep="\n",
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment