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.

  • kthutils.stayawhile
    Access the Stay A While queue API.

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.35.tar.gz (100.1 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.35-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kthutils-1.35.tar.gz
  • Upload date:
  • Size: 100.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.7 Linux/6.17.0-19-generic

File hashes

Hashes for kthutils-1.35.tar.gz
Algorithm Hash digest
SHA256 d1446e8bddfc56c6c100a8123c74865d25b990e06f6683461fd63d7ece080c85
MD5 12779ff84912dac98fdd4572890096e2
BLAKE2b-256 b5e01ae100e613c2c66bce1c7d11018dc5f92d5bb49984443fd33243eb955f78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kthutils-1.35-py3-none-any.whl
  • Upload date:
  • Size: 77.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.7 Linux/6.17.0-19-generic

File hashes

Hashes for kthutils-1.35-py3-none-any.whl
Algorithm Hash digest
SHA256 74292c7da08a78a5991b54befe554b1da95fc49ae5d64ec24baea2d66380e77e
MD5 56dabd6a54f8548a443f258d714c998e
BLAKE2b-256 3a35d149d5aa7cef3e0f8cfbf439c5a559e4e9301292adde26fca4a9e25cc78e

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