Skip to main content

A python wrapper for UIUC's official REST API for querying course data.

Project description

About

uiuc-api is a simple python package which wraps UIUC's official REST API for querying data about courses. In addition, it deals with some of the annoyances of using the official API by providing some convient structures. Data from the official API is available in XML form, however, it is in an inconvienent-to-parse format. For instance, take the XML data for CS 173:

<label>Discrete Structures</label>

<description>Discrete mathematical structures frequently encountered in the study of Computer Science. Sets, propositions, Boolean algebra, induction, recursion, relations, functions, and graphs. Credit is not given for both CS 173 and MATH 213. Prerequisite: One of CS 125, ECE 220; one of MATH 220, MATH 221.</description>

<creditHours>3 hours.</creditHours>

<courseSectionInformation>Credit is not given for both CS 173 and MATH 213. Prerequisite: One of CS 125, ECE 220; one of MATH 220, MATH 221.</courseSectionInformation>

<classScheduleInformation>Students must register for a lecture and discussion section.</classScheduleInformation>

It is tedious, for example, to accurately parse out the prerequisites in a easy-to-manipulate form. uiuc-api does this for the user:

>>> import uiuc_api as ua
>>> ua.get_course("CS 173").serialize()

Output:

CS 173:
  subject: CS
  number: '173'
  hours: 3
  label: Discrete Structures
  description: 'Discrete mathematical structures frequently encountered in the study
    of Computer Science. Sets, propositions, Boolean algebra, induction, recursion,
    relations, functions, and graphs. Credit is not given for both CS 173 and MATH
    213. Prerequisite: One of CS 125, ECE 220; one of MATH 220, MATH 221.'
  schedule_info: 'Credit is not given for both CS 173 and MATH 213. Prerequisite:
    One of CS 125, ECE 220; one of MATH 220, MATH 221.'
  prereqs:
  - !!python/object/apply:builtins.frozenset
    - - ECE 220
      - CS 125
  - !!python/object/apply:builtins.frozenset
    - - MATH 220
      - MATH 221
  coreqs: []
  constraints: []

Installation

Install the uiuc_api module via pip (uiuc-api also works):

pip install uiuc_api

Documentation

See https://uiuc-api.readthedocs.io/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uiuc-api-0.1.4.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

uiuc_api-0.1.4-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page