Various tools for automation at KTH
Project description
This package provides various utilities for automation at KTH. It provides the following modules:
-
kthutils.ug
Access the UG editor through Python. -
kthutils.participants
Read expected course participants through Python. -
kthutils.iprange
Read IP ranges for computers in lab rooms. -
kthutils.forms
Read forms data (CSV) from KTH Forms.
We also provide a command-line interface for the modules. This means that the functionality can be accessed through both Python and the shell.
An example
We want to add the user dbosk
as teacher in the group
edu.courses.DD.DD1317.20232.1.teachers
.
In Python, we would do
import kthutils.credentials
import kthutils.ug
ug = kthutils.ug.UGsession(*kthutils.credentials.get_credentials())
group = ug.find_group_by_name("edu.courses.DD.DD1317.20232.1.teachers")
user = ug.find_user_by_username("dbosk")
ug.add_group_members([user["kthid"]], group["kthid"])
In the shell, we would do
kthutils ug members add edu.courses.DD.DD1317.20232.1.teachers dbosk
Installation and documentation
Install the tools using pip
:
python3 -m pip install -U kthutils
You can read the documentation by running pydoc
on the package:
python3 -m pydoc kthutils
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kthutils-1.22.tar.gz
.
File metadata
- Download URL: kthutils-1.22.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff948723811b338379ed880da83e1362f8e630f374ade80dcfc1aef6cb70915 |
|
MD5 | 53fcec8260e5887929b293c84fc0700e |
|
BLAKE2b-256 | 513ab702500fa7811d2ae143247e6640db7f3625a040233ba2b1f99afca52400 |
File details
Details for the file kthutils-1.22-py3-none-any.whl
.
File metadata
- Download URL: kthutils-1.22-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.2.0-39-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b149dd5d12dbf2c6d9104adf9e1345a281fc2dbf7139aa00e1cbe90081903e |
|
MD5 | 0e6bc8bb96d71ab0dad261a3fcfee93b |
|
BLAKE2b-256 | c5b2ab893541598a21399c49b04c01fd976658095b907a2bcbf6b6dab3ecd898 |