Metadata-Version: 2.3
Name: kthutils
Version: 1.26
Summary: Various tools for automation at KTH
License: MIT
Author: Daniel Bosk
Author-email: dbosk@kth.se
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: cachetools (>=5.2.0,<6.0)
Requires-Dist: ladok3 (>=4.13,<5.0)
Requires-Dist: openpyxl (>=3.1.2,<4.0)
Requires-Dist: rich (>=13.3.2,<14.0)
Requires-Dist: typer (>=0.9.0,<1.0)
Requires-Dist: typerconf (>=2.6,<3.0)
Requires-Dist: typing-extensions (>=4.9.0,<5.0) ; python_version < "3.9"
Requires-Dist: weblogin (>=1.8,<2.0)
Project-URL: Bug Tracker, https://github.com/dbosk/kthutils/issues
Project-URL: Documentation, https://github.com/dbosk/kthutils/releases
Project-URL: Repository, https://github.com/dbosk/kthutils
Description-Content-Type: text/markdown

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

``` python
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

``` bash
kthutils ug members add edu.courses.DD.DD1317.20232.1.teachers dbosk
```

#### Installation and documentation

Install the tools using `pip`:

``` bash
python3 -m pip install -U kthutils
```

You can read the documentation by running `pydoc` on the package:

``` bash
python3 -m pydoc kthutils
```

