npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uoft-api

v0.2.21

Published

A simple module for gathering data from the University of Toronto course listings.

Downloads

16

Readme

A Node.js module which parses data from the University of Toronto's course listings into JSON to help developers create applications for students with ease.

Getting Started

Install:
$ npm i uoft-api
Reference:
var uoftAPI = require('uoft-api');

Supported Functions

  • getAllCourseDepartments
  • getCourseDepartment
  • getProgramCourses
getAllCourseDepartments(callback)
  • Takes a callback which handles error and an array of JSON objects, where each object contains a department field which has the name of the department specified by the code.
Number of Requests:
  • getAllCourseDepartments performs 1 request to retrieve all department names.
Usage:
uoftAPI.getAllCourseDepartments(function(err, allDepartments) {
  // do whatever with the course department array
});
Examples
uoftAPI.getAllCourseDepartments(function(err, allDepartments) {
  console.log(allDepartments);
  /*
  [ { department: 'Aboriginal Studies' },
    { department: 'American Studies' },
    { department: 'Anatomy' },
      < ... etc, ordered by department name ... >
    { department: 'Victoria College Courses' },
    { department: 'Woodsworth College Courses' },
    { department: 'Women and Gender Studies' } ]
  ]
  */
});
getCourseDepartment(courseCode, callback)
  • courseCode is a valid three-letter code representing a department at the University (ie/ the first three letters of any course code).
  • Takes a callback which handles error and an array of JSON objects, where each object contains a department field which has the name of the department specified by the code.
Number of Requests:
  • getCourseDepartment performs 1 request to retrieve the department name of the specified program.
Usage:
uoftAPI.getCourseDepartment(programCode, function(err, department) {
  // do whatever with the course department array
});
Examples
uoftAPI.getCourseDepartment('csc', function(err, department) {
  console.log(department);
  /* [ { department: 'Computer Science' } ] */
});
uoftAPI.getCourseDepartment('env', function(err, department) {
  console.log(department);
  /* [ { department: 'Environment, School of' } ] */
});
getProgramCourses(programCode, acceptCancelledCourses, callback)
  • Takes a valid three-letter programCode representing a department at the University (ie/ the first three letters of any course code).
  • Takes a value true or false, which determines whether cancelled courses will be included in the array of course JSON objects.
  • Takes a callback which handles error and an array of courses represented as JSON objects (as demonstrated below), where each JSON object contains a single course's information and has the following structure:
  {
    courseName: 'Computational Thinking', // Title of the course
    courseCode: 'CSC104H1',               // Course code
    courseTerm: 'F',                      // Course semester
    courseWait: 'Y',                      // If the course contains a wait-list (Y/N)
    courseProf: [ 'D. Heap' ]             // Professor(s) teaching the course
  }
Number of Requests:
  • getProgramCourses performs 2 requests to retrieve all course data of the specified program.
Usage:
uoftAPI.getProgramCourses(programCode, acceptCancelledCourses, function(err, courseData) {
  // do whatever with the returned courseData json
});
Examples
uoftAPI.getProgramCourses('csc', true, function(err, courseData) {
  console.log(courseData);
  /*
  [
    {
      courseName: 'Computational Thinking',
      courseCode: 'CSC104H1',
      courseTerm: 'F',
      courseWait: 'Y',
      courseProf: [ 'D. Heap' ]
    },
    {
      courseName: 'Computational Thinking',
      courseCode: 'CSC104H1',
      courseTerm: 'S',
      courseWait: 'Y',
      courseProf: [ 'G. Baumgartner' ]
    },
      < ... etc, ordered by course code ... >
    {
      courseName: 'Computabil & Logic',
      courseCode: 'CSC438H1',
      courseTerm: 'F',
      courseWait: 'Y',
      courseProf: [ 'T. Pitassi' ]
    }
  ]
*/
});

Function Addition Roadmap

  • Extending getProgramCourses to include the lecture and tutorial sections of each respective class in their own arrays.
  • Extending getProgramCourses to include when each tutorial and lecture section takes place (day of the week and time).
  • Extending the module to support course data from the University of Toronto Mississauga and Scarborough campus time-tables.
  • Extending the module to support course data from the St. George campus Faculty of Engineering.