Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kthutils-1.29.tar.gz (77.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kthutils-1.29-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file kthutils-1.29.tar.gz.

File metadata

  • Download URL: kthutils-1.29.tar.gz
  • Upload date:
  • Size: 77.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.8.0-90-generic

File hashes

Hashes for kthutils-1.29.tar.gz
Algorithm Hash digest
SHA256 ee30c5afcf3627c74b844b84dae27f60fb3b96e85e15ce7406fd9e7e1b2bdc8d
MD5 54e37d3072ca94a75b7503f3c642fd0b
BLAKE2b-256 cad1d6adbede66655adbefab4411f9c8dff36dd2df8e8b9690859b5102209625

See more details on using hashes here.

File details

Details for the file kthutils-1.29-py3-none-any.whl.

File metadata

  • Download URL: kthutils-1.29-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.8.0-90-generic

File hashes

Hashes for kthutils-1.29-py3-none-any.whl
Algorithm Hash digest
SHA256 cc04a532b6ceb2bc2c00a2dad9a3bdd6276c476b1cf547af50b5bb961b9fab8e
MD5 ffcddbce4e150565abd13332210117fb
BLAKE2b-256 594623e17e26b138807e4cc0976350308221b8eab90c7c9492ddbb86d1fc292b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page