A small utility that reads the IISER Pune course timetable PDF and populates your Google Calendar with weekly recurring events for your courses.
Pair it with CalClear (which wipes your existing weekly events) for a clean slate at the start of every semester. Because automation is awesome.
pip install -r requirements.txt- Go to the Google Cloud Console
- Create a project → enable the Google Calendar API
- Create an OAuth 2.0 Client ID (Desktop app) → download as
credentials.json - Place
credentials.jsonin the project root
If you already have
credentials.jsonandtoken.jsonfrom CalClear, copy them straight into this directory. The OAuth scope is identical.
Put the IISER timetable PDF in the project root and name it schedule.pdf.
Everything you need to change lives in config.py:
SEMESTER_START = date(2025, 8, 4) # Must be the Monday of your first teaching week
SEMESTER_END = date(2025, 11, 28) # Last day of the semester (events stop recurring here)
TIMEZONE = "Asia/Kolkata"
MY_COURSES = [
"PH3234",
"MT4123",
# add your course codes here, exactly as they appear in the PDF
]
YEAR = 3 # your current BS-MS year as an integerBefore touching your calendar, run parse.py standalone to confirm your course codes are being read correctly:
python src/parse.pyThis prints the full parsed schedule as JSON - no calendar writes happen.
python src/main.pyOn the first run, a browser window will open for Google OAuth consent. After you authorise, a token.json is cached and subsequent runs skip the browser step.
Terminal output looks like:
Parsing schedule.pdf for year 3…
Found 47 courses in the timetable.
Adding 'PH3234: Statistical Mechanics I' | colorId=1 (2 session(s)/week)…
✓ Wednesday 11:00-11:55 | LHC 103
✓ Thursday 11:00-11:55 | LHC 103
Adding 'MA4123: Complex Analysis' | colorId=2 (2 session(s)/week)…
✓ Monday 10:00-10:55 | LHC 301
✓ Friday 10:00-10:55 | LHC 301
Done. 6 event(s) created, 0 course(s) skipped.
SEMESTER_START must be a Monday.
The date arithmetic anchors every slot to an offset from that Monday (wednesday = Monday + 2, etc.). If you set a non-Monday date, all events will land on the wrong days.
Run CalClear before PDF2Cal. PDF2Cal only adds events; it does not check for duplicates. Running it twice will create duplicate recurring events. Use CalClear to wipe first, then PDF2Cal to repopulate.