Package: gradescopecalendar
Gradescope-CalendarThis script scrapes your Gradescope account for courses and assignment details. Assignment details currently can be transferred to iCalendar events (and then imported to other calendar applications such as Google Calendar). Another method exists to write these assignment details directly to a Google Calendar but requires additional setup. Scraping the Gradescope website is largely based off of the projects this is forked from.Gradescope-CalendarRequirementsInstallationUpgradeDevelopmentUsageAutomatically runningWindowsLinuxMacAdvanced settingsGoogle CalendarNotesFuture PlansRequirementsPython 3.7 or aboveInstallationWindowspython-mvenv.venv
.venv/Scripts/activate
pipinstallgradescopecalendarMac/Linuxpython3-mvenvvenvsourcevenv/bin/activate
pip3installgradescopecalendarUpgradeWindowspipinstall--upgradegradescopecalendarMac/Linuxpip3install--upgradegradescopecalendarDevelopmentThese steps are only necessary if you wish to install or work on the development version.Windowsgitclonehttps://github.com/calvinatian/gradescope-calendar.gitcdgradescope-calendar
python-mvenv.venv
.venv/Scripts/activate
pipinstall-rrequirements.txtMac/Linuxgitclonehttps://github.com/calvinatian/gradescope-calendar.gitcdgradescope-calendar
python3-mvenvvenvsourcevenv/bin/activate
pip3install-rrequirements.txtUsageCopy paste the below code or use the example script located atexample.py. Modify theEMAILandPASSWORDfields with your Gradescope account information then run the script.fromgradescopecalendar.gradescopecalendarimportGradescopeCalendarimportloggingif__name__=="__main__":# ------------------------------------------------------------ ## Modify these two fields with your Gradescope account details #EMAIL=""PASSWORD=""IS_INSTRUCTOR=False# If you are an instructor for **any** course,# modify this to True.# Modify these for loggingLOGGING_ENABLED=TrueLOGGING_LEVEL=logging.DEBUG# Valid logging levels# logging.INFO, logging.DEBUG, logging.WARN, logging.CRITICAL# ------------------------------------------------------------ #logger=logging.getLogger("gradescopecalendar"ifLOGGING_ENABLEDelseNone)logger.setLevel(LOGGING_LEVEL)calendar=GradescopeCalendar(EMAIL,PASSWORD,IS_INSTRUCTOR)calendar.write_to_ical()# Uncomment below to update Google Calendar directly# calendar.write_to_gcal()Details about the application are written to the log filegradescopecalendar.logif enabled.Automatically runningWindowsWindows task schedulerLinuxCronMacLaunchdAdvanced settingsGoogle CalendarGoto theGoogle Cloud Platformand create a new project.From the sidebar click "APIs & Services" and then "Dashboard".At the top of the page click "Enable API and Services".Scroll down to the Google Calendar API and enable it.Goto the sidebar and click on "OAuth consent screen".Click on "External".Fill in the App information. Since this API instance will only be used by yourself it does not really matter what you fill in.You can skip filling in the "Scopes" section. Just click "Save and Continue".On the "Test users" add the email(s) you want to modify the calendars for. If you are paranoid about the script altering your private calendar details you can create a new Google account and add that instead. Then you can share that calendar to other Google accounts.On the sidebar goto the "Credentials" tab and create a new "OAuth Client ID".Select Desktop app for Application type and give it any name.Once the ID has been created, click the "Download JSON" button and save the file to your computer ascredentials.jsonand move it to where you are usinggradescopecalendar.You can now uncomment the line for writing to Google Calendar and run the script.NotesOn first run you will be prompted to login and grant access to your account for the project. This will create atoken.jsonin the folder granting access to the script to modify your calendar. No one should be able to access your account if this file is kept secure. As mentioned earlier, you can also create a new Google account and use that calendar instead. Then you can share that calendar with your other Google accounts.You might notice nothing being printed to the console when running the script. This is intentional. Enable logging and check thegradescopecalendar.logfor details about the script progress.The first run of writing to Google Calendar may take a while depending on how many assignments there are to create/modify. Subsequent runs should be much faster as only new or updated assignments will be created/modified.Calendar events on the Gradescope calendar are never deleted, only created or updated. If the name of an assignment changes a new event will be created with the new name. Otherwise, if the start/end time or the location (URL of the assignment) of the event differ between Gradescope and Google Calendar, the event will be updated with the values from Gradescope. All other fields such as the description should remain unchanged.Future PlansMore use options such as the naming format of the events and how much to offset the start time by (currently start time is the same as end time).Ability to add custom reminders for Google Calendar events.