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/ef/a0/653c3644f9a686f75dd1fbf616aaca7a447b48b3dab423b2da331236e7d3/kthutils-1.27.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.27",
"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": "2ceeeab3248b5c40e91e79392daebe7af0f14402aa385c30cd0e397dd20c1cc5",
"md5": "91717d5ee24c6b8225b32fe0e6e8753c",
"sha256": "8080085c9ed23f27fefefbb183a654b65a0fdd666418477b61c8c2b8578b50a1"
},
"downloads": -1,
"filename": "kthutils-1.27-py3-none-any.whl",
"has_sig": false,
"md5_digest": "91717d5ee24c6b8225b32fe0e6e8753c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 46753,
"upload_time": "2025-10-09T07:05:40",
"upload_time_iso_8601": "2025-10-09T07:05:40.468438Z",
"url": "https://files.pythonhosted.org/packages/2c/ee/eab3248b5c40e91e79392daebe7af0f14402aa385c30cd0e397dd20c1cc5/kthutils-1.27-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "efa0653c3644f9a686f75dd1fbf616aaca7a447b48b3dab423b2da331236e7d3",
"md5": "7b0d645456f5303db1ae9338849cc3e3",
"sha256": "a21636b469dc9a0837d41b3c10c6423509a5ae4fb8e988b34ef4b810379c81fd"
},
"downloads": -1,
"filename": "kthutils-1.27.tar.gz",
"has_sig": false,
"md5_digest": "7b0d645456f5303db1ae9338849cc3e3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 77589,
"upload_time": "2025-10-09T07:05:42",
"upload_time_iso_8601": "2025-10-09T07:05:42.144872Z",
"url": "https://files.pythonhosted.org/packages/ef/a0/653c3644f9a686f75dd1fbf616aaca7a447b48b3dab423b2da331236e7d3/kthutils-1.27.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-09 07:05:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbosk",
"github_project": "kthutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kthutils"
}