Created
August 27, 2025 19:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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