#!/usr/bin/env python3 """Render a dated class-schedule screenshot (default: Penn State LionPATH look). python docgen.py --first Nikita --last Reformov --out schedule.png The term label and copyright year are derived from the current date so the document never carries a stale semester (the first thing a reviewer flags). """ import argparse import os import random import sys from datetime import datetime MAJORS = ["Mechanical Engineering (BS)", "Computer Science (BS)", "Information Sciences and Technology (BS)", "Electrical Engineering (BS)"] COURSES = [ ("14920", "CMPSC 465", "Data Structures and Algorithms", "MoWeFr 10:10AM - 11:00AM", "Willard 062", "3.00"), ("18233", "MATH 230", "Calculus and Vector Analysis", "TuTh 1:35PM - 2:50PM", "Thomas 102", "4.00"), ("20491", "CMPSC 473", "Operating Systems Design", "MoWe 2:30PM - 3:45PM", "Westgate E201", "3.00"), ("11029", "ENGL 202C", "Technical Writing", "Fr 1:25PM - 2:15PM", "Boucke 304", "3.00"), ("15502", "STAT 318", "Elementary Probability", "TuTh 9:05AM - 10:20AM", "Osmond 112", "3.00"), ] def term(): now = datetime.now() if now.month >= 8: return f"Fall {now.year}", "Aug 24 - Dec 11" if now.month >= 5: return f"Summer {now.year}", "May 18 - Aug 7" return f"Spring {now.year}", "Jan 12 - May 1" def build_html(first, last, school_name="Penn State", psu_id=None): now = datetime.now() t_label, t_span = term() psu_id = psu_id or f"9{random.randint(10000000, 99999999)}" major = random.choice(MAJORS) rows = "".join( f"
| Class Nbr | Course | Title | Days & Times | Room | Units |
|---|