Admin Scripts

From UCT EE Wiki
Jump to navigation Jump to search


The administration scripts are a collection of tools deemed useful in the regular administration process of the department. These tools are primary written in Python.

While the latest tools and instructions can be found at the EE Admin Script GitHub page, this wiki entry should provide enough of an overview to at least get acquainted with the tool-set.

Currently the tools are still in the development process and require a minor set of development knowledge in order to correctly use.

Installation[edit]

The tools use Python for processing. This section will guide you through installation of the tools and its requirements.

  1. Download and install Python
    • On Windows, you can head to the Python website to get the latest version of Python 3. Seselct "Latest Python 3 release". Scroll to the bottom of the page, and select "Windows x86-64 executable installer".
      When installing, ensure you select the "Add Python to environment variables" option
    • If you're using any other operating system, just use the relevant package manager.
  2. Download and install Git
    • On Windows, visit the Git for Windows download site. You can just run through the default installation options if you're not developing anything.
    • If you're using any other operating system, just use the relevant package manager.
  3. Download and install PDFTk (the free version)
    • On Windows, visit the PDFTk site
    • On other operating system, just use the relevant package manager.
  4. Create a Folder where you'd like to keep the tools
    • This could be something like "Admin Scripts" under "My Documents" or your home folder.
  5. Fetch the latest code
    1. Enter into the folder you created
    2. Open a terminal/PowerShell window
      • On Windows, hold down shift and right click, then select "Open PowerShell window here".
    3. Type
      git clone https://github.com/UCT-EE-OCW/EE_Admin_Scripts . --depth=1
      and press enter.
  6. Install the required Python packages
    1. Still within the terminal/PowerShell window, type the following:
      pip install -r requirements.txt
  7. Check to see if it is working

Updating the scripts[edit]

Occasionally you may get notice that the scripts have updated, though the scripts as they are exist in workable form. The easiest way to do this is to visit The GitHub Page and look under the commits column for the latest commit (update).

In order to update the scripts, enter into the folder you created, open a new PowerShell window or terminal, and enter in

git pull

. You may also need to update packages, in which case running

pip install -r requirements.txt

will do this for you.

Usage[edit]

Inside each folder is a README.md with instructions on how to use the script in question. The easiest place to view these is in a basic text editor like Notepad. However, if you wish to view instructions with formatting, navigate to the GitHub Page annd click on the name of the script you'd like to run. There, you will be able to see instructions on how to use the script.