Course selection for Universities with SamaSoft system (سامانه آموزشی سما) has always been a major hassle for me and my collegemates. This is due to the fact that this system requires an excessive number of browser requests to select the courses (making the procedure very inefficent). This puts a unnecessarily large load on university's servers and usually results in the servers going down.
This script aims to execute the procedure in a single request. It should take a few seconds to select all of your desired courses while putting much less load on the servers.
First, you'll need to clone this repository to your local drive via the following command:
$ git clone https://github.com/Mahan-AK/Sama_Course_Selector.git
$ cd Sama_Course_SelectorAlternatively, if you don't have git installed, you can download the zip file for this repository and extract it.
This script is written in python 3 and requires selenium and requests libraries.
You can install the required libraries by running the following command:
$ pip install -r requirements.txtIf that command results in an error, you can also try:
$ python -m pip install -r requirements.txtFirst, You will need to edit config.txt file and fill the required fields (you can find an example config file here):
| Variable | Description |
|---|---|
| host | Sama main website |
| term | Current term code (Check config.txt for more info) |
| std_num | Student ID |
| passwd1 | Sama password |
| std_sel | List of desired courses to select |
Now we can run the code:
$ python SamaCourseSelector.py -c CONFIG_FILE -t ACTION_TIMEProgram Usage2:
Usage: python SamaCourseSelector.py -c path_to_config_file -t starting_time
Example: python SamaCourseSelector.py -c config.txt -t 9:00
Options:
-h, --help show this help message and exit
-c CONFIG_FILE
-t ACTION_TIME
I have only tested the script for sama system of University of Tabriz, but it should work with other sama based systems. If you happen to test it for other university, please email me with the results.
