No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Created by the OneHack Hack UCI Team: Norman E. Varun S. Simon L. Shawn H. Johnathan C.

This file primarily describes the UCI_DATA_API; a simple API specifically designed to streamline the reading of data from UCI's food and course data. The OneUCI app utilizes this API heavily in order to generate a user-friendly interface for viewing and interacting with the large volume of data.

Table of Contents

  1. Highlights

  2. Roadmap

  3. TODOs

  4. App Usage

  5. API Usage

  6. Parser Usage

  7. Examples

  8. Requirements

  9. Development


This project features a full API and working python-based application framework for either IOS or Android.

For more information, visit our github page:


Firstly, various visual improvements could and should be implemented. Particularly on the food tab.

In the future, we plan on integrating a social walking service to track anteater walking patterns at UCI. Using the resulting data, we can create more efficient walking routes.

We also plan on parsing food nutritional data more carefully, vs the current "sweeping" tactic for basic information. We will, of course, make this information easily accessible.

Furthermore, we plan to integrate the events tab with UCI's EEE calander for pulling courses.

Lastly, we plan on using a basic machine learning algorithm to provide users with UCI news that is considered potentially interesting to them based on events they attend, courses they take, and places they frequent.

In terms of the API, we plan on increasing it's robustness and providing XML output by request. Additionally, optimizations to the searching algorithms for the HTMLReferenceTree class should be implemented.


  1. Write a better self test for UCI_DATA_API
  2. Something with events page? Ability to add events at least?
  3. Prevent "over scrolling"
  4. Clean up some of the gui prototyping code


Simply import the module into the module you intend to use the API.

For lightweight, HTML parsing, implement the module.

Usage (APP)

Simply run the module.

Usage (API)

To use the module, start by creating either a FoodDataManager or ClassDataManager class.

Each of these classes supports the same standard sequence of events:

  1. Construct an instance
  2. Designate an html source with UCI_DATA_API.set_html_target()
  3. Activate data parsing with UCI_DATA_API.process_available_data()
  4. Finalize answer into friendly data formats with UCI_DATA_API.process_result()

From that point, the parsed result can be obtained as a JSON file through UCI_DATA_API.getJSON() or as a python dictionary though UCI_DATA_API.get_result().

Tests can also be preformed by running the file.

Usage (Parser)

After construction, one of the following functions must be called and bound to the parser: - get_HTML_from_url() - get_HTML_from_string() - get_HTML_from_file() Each specifies a different type of html source, and at least one must be selected before continuing.

To initiate parsing, call HTMLReferenceTree.parse_data(). The resulting parser state can then carry out find operations on the data.

Tests can also be preformed by running the file.


Some basic examples:

courseManager = ClassDataManager()

foodManager = FoodDataManager()

In addition to these basic examples, running or will start testing programs.


  • Python 3.3 or greater


Created as a part of the HACK UCI Hackathon

While simple, the UCI_DATA_API provides all the potentially useful methods of locating and parsing both UCI meal and course data. It also prepares the result for JSON encoding or usage as a dictionary.

The lightweight, HTML parser is built on python's basic html parser, yet provides additional functions and details for quickly locating and iterating through data. In particular, it provides an internal array of HTML id attributes, for rapid searching by ID. The search by attributes, however, expects more than one answer and thus, must do a thorough, linear search through all data nodes.

Additionally, the HTMLReferenceTree class works primarily with HTMLNodes, a simple implementation of a node for quick access of children and parents. HTMLNodes are also equipped with basic comparision operators for sorting purposes.