/MySchool_Command_Line

MySchool command line application for RU

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

MySchool command line

This is a Python3 MySchool command line application.

  • The requirements/dependencies can be seen in requirements.txt.
  • An informal cheatsheet can be seen in cheatsheet.md.

Setup

Install the requirements with:
(NOTE: Check if pip is from Python3, else use pip3 to install)

sudo pip install -r requirements.txt

Next open myschool_cmd.py and change the global USERNAME in line 24 to your own username.
You need to run the script with sudo privilege, where in your first run you will be prompt for a password from MySchool. This password will be saved to .password.txt, located in your /root directory, and only root will be able to both read and write.
Optionally you can change all three global variables, inside the script:

  • USERNAME
  • PASSWORD_FILE_NAME
  • USE_DAY_OF_WEEK
  • CURRENT_SEMESTER
  • CURRENT_YEAR

Run

After the setup, you can run the commands that are listed in the cheatsheet, e.g.:
(NOTE: Check if python version is Python3, else use python3 to run the script.)

sudo ./myschool_cmd.py -tt

This command will list your timetable.
(NOTE: If this doesn't work due to encoding, try running the script with: sudo python3 /usr/bin/myschool_cmd.py -tt)

Recommended options (not mandatory)

I recommend first either moving the file or creating a symbolic link from myschool_cmd.py to /usr/bin, with:

sudo ln -s /full/path/to/myschool_cmd.py /usr/bin/myschool_cmd.

After that create an alias so it will be easier to run the script.

For bash users:

Open ~/.bashrc (or ~/.bash_profile if you are using Mac OS X) and append this to the end of the file:

alias ms="sudo myschool_cmd.py"

For zsh users:

Open ~/.zshrc and append this to the end of the file:

alias ms="sudo ./myschool_cmd.py"

Now you should be able to run the script, simply by running:

ms -tt