For Python3 - To install dependencies paste the following in your terminal:
pip3 install crayons
pip3 install requests
pip3 install keyring
pip3 install icalendar
python3 /[path]/[to]/kcl.py
Log in with your k-number and password - your credentials are stored locally for the next time you run it.
To add as a terminal command, add it as an alias, e.g. for macOS:
Edit ~/.bash_profile, with
sudo nano ~/.bash_profile
then add the the line
alias timetable='python3 '/[path]/[to]/kcl.py'
To export your timetable (for the next 60 days) as a .ics file for import in Google and Apple Calendars, run the following script in terminal:
python3 /[path]/[to]/kclical.py
Log in with your k-number and password - your password will be stored locally and securely in the keyring. If you mistype your login, simply delete the 'knumber.fin' file in the script directory and log in again.
The calendar is exported to course_schedule.ics in the script directory.