_____ _ _ _ _ /__ (_)_ __ ___ ___| |_ __ _| |__ | | ___ / /\/ | '_ ` _ \ / _ \ __/ _` | '_ \| |/ _ \ / / | | | | | | | __/ || (_| | |_) | | __/ \/ |_|_| |_| |_|\___|\__\__,_|_.__/|_|\___| Print, display, and manage your UC timetable.
A simple utility to download and manage your timetable, without a cumbersome web interface in the way.
You will need python and setuptools installed. Pip packages will be installed automatically with the setup.py script.
- docopt
- For the nice command line interface.
- attrs
- For my own sanity.
- requests-html
- To perform the scraping.
- schema
- To ensure data correctness.
First clone the package:
git clone https://github.com/Triagle/timetable.git
Then run the install script:
python setup.py install
# Or alternatively, if you have "pipsi" installed
pipsi install .
Run:
$ export TIMETABLE_CONFIG_PATH=~/somewhere
$ timetable --help
Print, display, and manage your UC timetable.
Usage:
timetable [-v] show [--on=<date>] [--drop-cache]
timetable [-v] next [--time] [--drop-cache]
Options:
-h, --help Show this screen.
--on=<date> Show the timetable for this date.
--drop-cache Drop the current data file.
--time Show the time to the next class.
-v, --verbose Be more verbose.
There are two components to working with the timetable. To start with
we have the config file, which lives in
TIMETABLE_CONFIG_PATH/config
. This is an environment variable you
should set yourself, I’d personally recommend ~/.config/timetable
.
# Contents of ~/.config/timetable/config
[course/SENG201]
year = 2018
semester = 1
colour = blue
[course/COSC261]
year = 2018
semester = 1
colour = magenta
[course/MATH201]
year = 2018
semester = 1
colour = green
[course/COSC262]
year = 2018
semester = 1
colour = yellow
[COSC261/Computer Lab A]
activity = 1
[SENG201/Computer Lab A]
activity = 3
[MATH201/Tutorial A]
activity = 5
[COSC262/Tutorial A]
activity = 4
Maybe this timetable is a little biased (although maybe not considering the audience of github users), but it does illustrate key features of any reasonable config file.
course
sections represent individual courses, like SENG201. Each
course section must have a year and semester specified, and may
optionally have a colour.
The colours available to you specifically are black, red, green, yellow, blue, magenta, cyan, and white. What these colours actually look like will depend on your terminal.
In addition to your courses you have you sections like Computer Lab
A that correspond to groups of activities. You indicate the activity
you are enrolled in (check your mytimetable allocation for this), and
this must be an integer. If you’re enrolled in an activity like 03-P1
or something similar, just use 3 and the program will work out what
you mean and swap automatically between all 03-PN
activities depending
on which is appropriate on any given day.
Any section you leave off, like a lecture where only one activity exists, will be automatically allocated to activity 1.
Now that you have fully configured the program, the usage is simple:
# I need my timetable for today
$ timetable show
# ... I meant tomorrow
$ timetable show --on=2018-03-04 # Or whenever tomorrow is.
# I'm a more visual person, do you have any other ways of showing this?
timetable show --timeline
# See below for what this looks like.
# What's coming up next???
$ timetable next
# Urgh I hate maths, can you tell me the time remaining?
$ timetable next --time
# Just got an email about timetable changes, how do I sync?
$ timetable show --drop-cache
# Could you give me a hint about config errors?
$ timetable show -v
# I'm stuck.
$ timetable --help
The timeline mode shows your classes in a vertical timeline, just like you might expect on a startup’s about me landing page. I think it highlights clashes a little easier than the standard view.
Distributed under MIT License, see LICENSE
file for info.