This is a library of scrapers for various University of Toronto websites. It is built to generate up-to-date databases for Cobalt, but is distributed as a stand-alone library for anyone to utilize.
pip install uoftscrapersimport uoftscrapers
# Example: scrape http://map.utoronto.ca building data to ./some/path
uoftscrapers.Buildings.scrape('./some/path')
# Example: scrape http://coursefinder.utoronto.ca to current working directory
uoftscrapers.Courses.scrape()uoftscrapers.Courseshttp://coursefinder.utoronto.ca
{
"id": String,
"code": String,
"name": String,
"description": String,
"division": String,
"department": String,
"prerequisites": String,
"exclusions": String,
"level": Number,
"campus": String,
"term": String,
"breadths": [Number],
"meeting_sections": [{
"code": String,
"instructors": [String],
"times": [{
"day": String,
"start": Number,
"end": Number,
"duration": Number,
"location": String
}],
"size": Number,
"enrolment": Number
}]
}uoftscrapers.Buildings{
"id": String,
"code": String,
"name": String,
"short_name": String,
"campus": String,
"address": {
"street": String,
"city": String,
"province": String,
"country": String,
"postal": String
},
"lat": Number,
"lng": Number,
"polygon": [
[Number, Number]
]
}uoftscrapers.Textbooks{
"id": String,
"isbn": String,
"title": String,
"edition": Number,
"author": String,
"image": String,
"price": Number,
"url": String,
"courses":[{
"id": String,
"code": String,
"requirement": String,
"meeting_sections":[{
"code": String,
"instructors": [String]
}]
}]
}uoftscrapers.Food{
"id": String,
"building_id": String,
"name": String,
"short_name": String,
"description": String,
"url": String,
"tags": [String],
"image": String,
"campus": String,
"lat": Number,
"lng": Number,
"address": String,
"hours": {
"sunday": {
"closed": Boolean,
"open": Number,
"close": Number
},
"monday": {
"closed": Boolean,
"open": Number,
"close": Number
}
"tuesday": {
"closed": Boolean,
"open": Number,
"close": Number
},
"wednesday": {
"closed": Boolean,
"open": Number,
"close": Number
},
"thursday": {
"closed": Boolean,
"open": Number,
"close": Number
},
"friday": {
"closed": Boolean,
"open": Number,
"close": Number
},
"saturday": {
"closed": Boolean,
"open": Number,
"close": Number
}
}
}uoftscrapers.CalendarNot implemented.
uoftscrapers.UTSGCalendarhttp://www.artsandscience.utoronto.ca/ofr/calendar/
Refer to Calendar
uoftscrapers.UTMCalendarhttps://student.utm.utoronto.ca/calendar/calendar.pl
Refer to Calendar
uoftscrapers.UTSCCalendarhttp://www.utsc.utoronto.ca/~registrar/calendars/calendar/index.html
Refer to Calendar
uoftscrapers.Timetable{
"id": String,
"code": String,
"name": String,
"level": Number,
"campus": String,
"term": String,
"breadths": [Number],
"meeting_sections": [{
"code": String,
"instructors": [String],
"times": [{
"day": String,
"start": Number,
"end": Number,
"duration": Number,
"location": String
}],
"size": Number,
"enrolment": Number
}]
}uoftscrapers.UTSGTimetablehttp://www.artsandscience.utoronto.ca/ofr/timetable/winter/sponsors.htm
Refer to Timetable
uoftscrapers.UTMTimetablehttps://student.utm.utoronto.ca/timetable
Refer to Timetable
uoftscrapers.UTSCTimetablehttp://www.utsc.utoronto.ca/~registrar/scheduling/timetable
Refer to Timetable
uoftscrapers.Exams{
"id": String,
"course_id": String,
"course_code": String
"period": String,
"date": String,
"start_time": String,
"end_time": String,
"sections": [{
"section": String,
"location": String
}]
}uoftscrapers.UTSGExamshttp://www.artsci.utoronto.ca/current/exams
Refer to Exams
uoftscrapers.UTMExamshttps://student.utm.utoronto.ca/examschedule/finalexams.php
Refer to Exams
uoftscrapers.UTSCExamshttp://www.utsc.utoronto.ca/registrar/examination-schedule
Refer to Exams
uoftscrapers.Athletics{
"date": String,
"events":[{
"title": String,
"location": String,
"building_id": String,
"start_time": String,
"end_time": String
}]
}uoftscrapers.UTSGAthleticsNot yet implemented
Refer to Athletics
uoftscrapers.UTMAthleticshttp://www.utm.utoronto.ca/athletics/schedule/month/
Refer to Athletics
uoftscrapers.UTSCAthleticshttp://www.utsc.utoronto.ca/athletics/calendar-node-field-date-time/month/
Refer to Athletics
uoftscrapers.Parking{
"id": String,
"title": String,
"building_id": String,
"campus": String,
"type": String,
"description": String,
"lat": Number,
"lng": Number,
"address": String
}uoftscrapers.Shuttlehttps://m.utm.utoronto.ca/shuttle.php
{
"date": String,
"routes": [{
"id": String,
"name": String,
"stops": [{
"location": String,
"building_id": String,
"times": [{
"time": String,
"rush_hour": Boolean,
"no_overload": Boolean
}]
}]
}]
}