fknorr / studip-client

CLI Client for the Stud.IP University Access Portal
GNU General Public License v3.0
3 stars 3 forks source link
crawler studip studip-client university web

This tool is broken by the recent Stud.IP web interface update and will not be fixed. Please move on to studip-fuse.

Stud.IP Client

studip-client is a CLI application for synchronizing the directory tree from a Stud.IP university account to the local file system.

It does this by creating a local database of course files, downloading them into its repository and presenting them in the file system as one or several different views.

studip-client is currently only implemented for the University of Passau (https://uni-passau.de/).

Installation

Make sure you have at least Python 3.4 installed. There are two ways to use studip-client:

Install system-wide

To install the application for all users, run

sudo ./setup.py install

This requires setuptools to be available. The setup script will automatically install all prerequisites and add the studip executable to $PATH.

Then you can simply do

$ studip <operation>

Run from source directory

To run studip-client locally, install all dependencies via

$ pip3 install requests
$ pip3 install appdirs

or a similar command to your package manager. Afterwards, you can run

$ ./studip.py <operation>

Usage

Usually all you'll ever need is

$ studip sync

which will connect to Stud.IP, update the local database and fetch all files not yet present locally.

The general synopsis of studip-client is

$ studip <operation> [-d directory]

The most important operations are

If no directory is given, the most recently used one is assumed, if studip-client has not been run before, the directory is read from the standard input.

Configuration

At the moment, the only way to modify studip-client's configuration is by editing <sync-dir>/.studip/studip.conf. It is divided into three sections:

Courses

Courses are added automatically through update and can be managed manually at a later point in time using the course command.

course list will print a list of existing courses and their attributes. Cells marked with * are auto-generated and can be manually set using the editing commands below.

The course set-* family of commands modify one or several courses. The range argument refers to the first column of course list and is of the form 1,3-4,7-9, meaning that the attribute should be set for courses 1, 3, 4, 7, 8 and 9.

Views

How files are checked out into the sync directory is controlled by views. Each view consists of a directory tree containing hard-links to the original files in .studip/files/. The following operations are available to show and modify views:

When studip-client is first invoked, a default view will be created. If you want to change the directory structure, you first need to remove it - If multiple views are to be created, they need to reside in subdirectories, which the default view does not.

For example:

$ studip view rm default
$ studip view add my_view base my_subdir charset ascii

The rm operation removes the directory tree, but keeps any files that weren't created by studip-client. This works even if managed files have been renamed by the user.

Here, when creating the new view, the base attribute is set to my_subdir and the charset to ASCII. The following attributes are available:

Management

There are additional commands for repository management:

Security

studip-client works by crawling the Stud.IP web interface and will therefore ask for your username and password. The credentials are stored locally in <sync-dir>/.studip/studip.conf and encrypted with a machine-local auto-generated key found in ~/.cache/studip/secret so that simply obtaining a copy of your config file is not enough to recover your password.

All connections to the university servers transporting the login data are made via HTTPS. Your credentials will not be copied or distributed in any other way.

If you're interested in verifying this claim manually, the relevant source code can be found in studip/application.py, Application.open_session().