Skip to content

recreationx/nyjctimetable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

NYJC Timetable Parser

A timetable parser for NYJC. Outputs to json or ics.

Usage

Clone the repo

git clone https://github.com/recreationx/nyjctimetable.git

Install Python (Built on Python 3.9.2) and required libraries. (BeautifulSoup4)

pip install -r requirements.txt

Run timetableparse.py

python timetableparse.py [filename] [outputname] [--type]

where filename is your HTML filename (sample.html, sample.htm) and outputname is the name of your outputname.json file
--type (json or ics) will default to JSON if not specified.

Note: Your index_ex.php is required as your HTML file.

Save your index_ex.php (timetable page) as a .html/htm from NYXchange after logging in.

Output

ICS

A Calendar (.ics) file (universal calendar format) will be generated with the timezone set as Asia/Singapore (GMT+8).
This can be used for importing into various calendar programs (Google Calendar etc.)

JSON

Output file will be a .json file, in the following format. Sample is truncated to avoid sensitive information leak.
... signifies that there are more entries. Lessons without a specified venue automatically defaults to 'NIL'.

{
    "Mon A": [
        {
            "name": "No Lesson",
            "venue": "NIL",
            "time": "0730-0800"
        },
        {
            "name": "No Lesson",
            "venue": "NIL",
            "time": "0800-0830"
        },
        {
            "name": "J2 Assembly",
            "venue": "NIL",
            "time": "0830-0900"
        },
        {
            "name": "gp",
            "venue": "5-34",
            "time": "0900-0930"
        },
        ...
    ],
    "Tue A": [
        {
            "name": "No Lesson",
            "venue": "NIL",
            "time": "0730-0800"
        },
        ...
    ]
}

Disclaimer

Does not include tutor names to prevent sensitive information leak.

About

a nyjc timetable parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages