PrevUpHomeNext

Data Files Used by the API

The Timetable Generator API uses several data files. These can be classified into three categories: data files that store the course timetable data; data files used for study session management; and data files used for management of alternate-week labs. All data files are text files, and use the .txt extension.

The data files that store the course timetable data are organized by faculty and study session, and their name is prefixed with courses_. The current version supports three faculty/study session combinations: Arts and Science Fall/Winter, for which data is stored in courses_artsci.txt; Arts and Science Summer, for which data is stored in courses_artsci_summer.txt; and Applied Science and Engineering Fall/Winter, for which data is stored in courses_eng.txt. The contents of these files can be updated (with information from the respective faculty websites) using the UpdateTimetableData() API function. You can also replace the contents of these files with the contents of another set of these data files (in the same format) using the LoadTimetableData() API function. These files are designed to be human-editable for debugging purposes, but their exact format is not part of the public API, and so is subject to change in later API versions.

There is one data file used for study session management, called sessions.txt. Each line of this file contains information about one study session that the API should know about. The line contains two or more whitespace-separated tokens: the name of the study session, with spaces replaced by underscores to make it one token, followed by the names of one or more data files that contain course timetable data for that session. In addition, exactly one of the lines must have a DEFAULT token between the study session name and the name of the first data file, indicating which study session is the default one (this is reflected in the is_default field of the StudySession objects returned by the GetStudySessions() API function). This file cannot be updated using an API function; rather, the user of the API (i.e., the developer of the software using the API) should update it manually as needed.

Here is an example of a valid sessions.txt file:

2011_Summer                         courses_artsci_summer.txt
2011-2012_Fall/Winter   DEFAULT     courses_artsci.txt courses_eng.txt

Finally, there are two data files used for management of alternate-week labs. They also cannot be updated using an API function, and should instead be updated manually by the user of the API.

The first is called altwks.txt, and it contains a list of activity/session codes of all the sessions in the Faculty of Arts and Science that have alternate-week labs. This is a new file introduced in version 0.6.5, necessitated by the fact that the new data format used by the Faculty of Arts and Science does not encode which sessions have alternate-week labs in a machine-parseable format.

The library provides a mechanism to help users of the API prepare this file. If the macro LIBTG_PARSER_COLLECT_TIMETABLE_INSTRUCTIONS is defined when building the library, calls to UpdateTimetableData() will, as a side effect, produce a file named timetable_instructions.txt in the current working directory, which contains information based on which the content of altwks.txt can be prepared.

The second is called altwkexcept.txt. For more information about this file, please see Alternate-Week Labs.


PrevUpHomeNext