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/51/3a/b702500fa7811d2ae143247e6640db7f3625a040233ba2b1f99afca52400/kthutils-1.22.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.22",
"project_urls": {
"Bug Tracker": "https://github.com/dbosk/kthutils/issues",
"Homepage": "https://github.com/dbosk/kthutils",
"Releases": "https://github.com/dbosk/kthutils/releases",
"Repository": "https://github.com/dbosk/kthutils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c5b2ab893541598a21399c49b04c01fd976658095b907a2bcbf6b6dab3ecd898",
"md5": "0e6bc8bb96d71ab0dad261a3fcfee93b",
"sha256": "c4b149dd5d12dbf2c6d9104adf9e1345a281fc2dbf7139aa00e1cbe90081903e"
},
"downloads": -1,
"filename": "kthutils-1.22-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e6bc8bb96d71ab0dad261a3fcfee93b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 46621,
"upload_time": "2024-10-15T14:02:39",
"upload_time_iso_8601": "2024-10-15T14:02:39.138609Z",
"url": "https://files.pythonhosted.org/packages/c5/b2/ab893541598a21399c49b04c01fd976658095b907a2bcbf6b6dab3ecd898/kthutils-1.22-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "513ab702500fa7811d2ae143247e6640db7f3625a040233ba2b1f99afca52400",
"md5": "53fcec8260e5887929b293c84fc0700e",
"sha256": "0ff948723811b338379ed880da83e1362f8e630f374ade80dcfc1aef6cb70915"
},
"downloads": -1,
"filename": "kthutils-1.22.tar.gz",
"has_sig": false,
"md5_digest": "53fcec8260e5887929b293c84fc0700e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 34931,
"upload_time": "2024-10-15T14:02:43",
"upload_time_iso_8601": "2024-10-15T14:02:43.435093Z",
"url": "https://files.pythonhosted.org/packages/51/3a/b702500fa7811d2ae143247e6640db7f3625a040233ba2b1f99afca52400/kthutils-1.22.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-15 14:02:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbosk",
"github_project": "kthutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kthutils"
}