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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dbosk/kthutils",
"name": "kthutils",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Daniel Bosk",
"author_email": "dbosk@kth.se",
"download_url": "https://files.pythonhosted.org/packages/f9/53/34c4ef934279490deda98179ec961456d58c6add798c11d6aa0b2f9d2652/kthutils-1.25.tar.gz",
"platform": null,
"description": "This package provides various utilities for automation at KTH. It\nprovides the following modules:\n\n - kthutils.ug \n Access the UG editor through Python.\n\n - kthutils.participants \n Read expected course participants through Python.\n\n - kthutils.iprange \n Read IP ranges for computers in lab rooms.\n\n - kthutils.forms \n Read forms data (CSV) from KTH Forms.\n\nWe also provide a command-line interface for the modules. This means\nthat the functionality can be accessed through both Python and the\nshell.\n\n#### An example\n\nWe want to add the user `dbosk` as teacher in the group\n\n`edu.courses.DD.DD1317.20232.1.teachers`.\n\nIn Python, we would do\n\n``` python\nimport kthutils.credentials\nimport kthutils.ug\n\nug = kthutils.ug.UGsession(*kthutils.credentials.get_credentials())\n\ngroup = ug.find_group_by_name(\"edu.courses.DD.DD1317.20232.1.teachers\")\nuser = ug.find_user_by_username(\"dbosk\")\n\nug.add_group_members([user[\"kthid\"]], group[\"kthid\"])\n```\n\nIn the shell, we would do\n\n``` bash\nkthutils ug members add edu.courses.DD.DD1317.20232.1.teachers dbosk\n```\n\n#### Installation and documentation\n\nInstall the tools using `pip`:\n\n``` bash\npython3 -m pip install -U kthutils\n```\n\nYou can read the documentation by running `pydoc` on the package:\n\n``` bash\npython3 -m pydoc kthutils\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Various tools for automation at KTH",
"version": "1.25",
"project_urls": {
"Bug Tracker": "https://github.com/dbosk/kthutils/issues",
"Documentation": "https://github.com/dbosk/kthutils/releases",
"Homepage": "https://github.com/dbosk/kthutils",
"Repository": "https://github.com/dbosk/kthutils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "28072c1349a04b550571bd277965c331b74346217cc2b3268fa60873ff26bb7d",
"md5": "734b5a9eaf1a5455fa7c9c88fbb0c5d9",
"sha256": "37846a14bc6992a20c31ad11eb4c1671940bbb456ee4702428d97a59d1adbaf6"
},
"downloads": -1,
"filename": "kthutils-1.25-py3-none-any.whl",
"has_sig": false,
"md5_digest": "734b5a9eaf1a5455fa7c9c88fbb0c5d9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 46588,
"upload_time": "2025-08-07T07:22:49",
"upload_time_iso_8601": "2025-08-07T07:22:49.389976Z",
"url": "https://files.pythonhosted.org/packages/28/07/2c1349a04b550571bd277965c331b74346217cc2b3268fa60873ff26bb7d/kthutils-1.25-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f95334c4ef934279490deda98179ec961456d58c6add798c11d6aa0b2f9d2652",
"md5": "e0231167e64c09112d81f18f1755f243",
"sha256": "f3e7671124e0f02b561b38148105968a692e290c942c7a2f3ea4296b300f59b4"
},
"downloads": -1,
"filename": "kthutils-1.25.tar.gz",
"has_sig": false,
"md5_digest": "e0231167e64c09112d81f18f1755f243",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 77489,
"upload_time": "2025-08-07T07:22:50",
"upload_time_iso_8601": "2025-08-07T07:22:50.765708Z",
"url": "https://files.pythonhosted.org/packages/f9/53/34c4ef934279490deda98179ec961456d58c6add798c11d6aa0b2f9d2652/kthutils-1.25.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-07 07:22:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbosk",
"github_project": "kthutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kthutils"
}