File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,32 @@ async def get_term_subjects(
5050 return data
5151
5252
53+ async def get_term_instructors (
54+ session : aiohttp .ClientSession , term : str
55+ ) -> list [dict [str , str ]]:
56+ """
57+ Fetches the list of instructors for a given term from SIS. If the term is invalid
58+ or doesn't exist, returns an empty list.
59+
60+ Returned data format is as follows:
61+ [
62+ {
63+ "code": "71297",
64+ "description": "Abbott, Claude"
65+ },
66+ ...
67+ ]
68+ """
69+ url = "https://sis9.rpi.edu/StudentRegistrationSsb/ssb/classSearch/get_instructor"
70+ params = {"term" : term , "offset" : 1 , "max" : 2147483647 }
71+ async with session .get (url , params = params ) as response :
72+ response .raise_for_status ()
73+ raw_data = await response .text ()
74+ raw_data = html .unescape (raw_data )
75+ data = json .loads (raw_data )
76+ return data
77+
78+
5379async def get_all_attributes (session : aiohttp .ClientSession ) -> list [dict [str , str ]]:
5480 """
5581 Fetches the master list of attributes from SIS.
You can’t perform that action at this time.
0 commit comments