# canvaslms: A CLI to Canvas LMS.
This program provides a command-line interface for Canvas. The command
is `canvaslms` and it has several subcommands in the same style as Git.
`canvaslms` provides output in a format useful for POSIX tools, this
makes automating tasks much easier.
## Getting started
Start by login to your Canvas server
``` {.text}
canvaslms login
```
Let's consider how to grade students logging into the student-shell SSH
server. We store the list of students' Canvas and KTH IDs in a file.
``` {.text}
canvaslms users -c DD1301 -s | cut -f 1,2 > students.csv
```
Then we check who has logged into student-shell.
``` {.text startFrom="2"}
ssh student-shell.sys.kth.se last | cut -f 1 -d " " | sort | uniq \
> logged-in.csv
```
Finally, we check who of our students logged in.
``` {.text startFrom="4"}
for s in $(cut -f 2 students.csv); do
grep $s logged-in.csv && \
```
Finally, we can set their grade to P and add the comment "Well done!" in
Canvas. We set the grades for the two assignments whose titles match the
regular expression `(Preparing the terminal|The terminal)`.
``` {.text startFrom="6"}
canvaslms grade -c DD1301 -a "(Preparing the terminal|The terminal)" \
-u $(grep $s students.csv | cut -f 1) \
-g P -m "Well done!"
done
```
## Installation
Just install the PyPI package:
```
python3 -m pip install canvaslms
```
Some subcommands use `pandoc`, so you will likely have to [install
pandoc][pandoc] on your system manually.
[pandoc]: https://pandoc.org/installing.html
Raw data
{
"_id": null,
"home_page": "https://github.com/dbosk/canvaslms",
"name": "canvaslms",
"maintainer": "Daniel Bosk",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "dbosk@kth.se",
"keywords": null,
"author": "Daniel Bosk",
"author_email": "daniel@bosk.se",
"download_url": "https://files.pythonhosted.org/packages/dd/0b/240304cc55016ce9899176bad26a6a69b6adafb447d00fd26d7536d86e95/canvaslms-4.11.tar.gz",
"platform": null,
"description": "# canvaslms: A CLI to Canvas LMS.\n\nThis program provides a command-line interface for Canvas. The command\nis `canvaslms` and it has several subcommands in the same style as Git.\n`canvaslms` provides output in a format useful for POSIX tools, this\nmakes automating tasks much easier.\n\n## Getting started\n\nStart by login to your Canvas server\n\n``` {.text}\ncanvaslms login\n```\n\nLet's consider how to grade students logging into the student-shell SSH\nserver. We store the list of students' Canvas and KTH IDs in a file.\n\n``` {.text}\ncanvaslms users -c DD1301 -s | cut -f 1,2 > students.csv\n```\n\nThen we check who has logged into student-shell.\n\n``` {.text startFrom=\"2\"}\nssh student-shell.sys.kth.se last | cut -f 1 -d \" \" | sort | uniq \\\n > logged-in.csv\n```\n\nFinally, we check who of our students logged in.\n\n``` {.text startFrom=\"4\"}\nfor s in $(cut -f 2 students.csv); do\n grep $s logged-in.csv && \\\n```\n\nFinally, we can set their grade to P and add the comment \"Well done!\" in\nCanvas. We set the grades for the two assignments whose titles match the\nregular expression `(Preparing the terminal|The terminal)`.\n\n``` {.text startFrom=\"6\"}\n canvaslms grade -c DD1301 -a \"(Preparing the terminal|The terminal)\" \\\n -u $(grep $s students.csv | cut -f 1) \\\n -g P -m \"Well done!\"\ndone\n```\n\n## Installation\n\nJust install the PyPI package:\n```\npython3 -m pip install canvaslms\n```\nSome subcommands use `pandoc`, so you will likely have to [install \npandoc][pandoc] on your system manually.\n\n[pandoc]: https://pandoc.org/installing.html\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Command-line interface to Canvas LMS",
"version": "4.11",
"project_urls": {
"Bug Tracker": "https://github.com/dbosk/canvaslms/issues",
"Documentation": "https://github.com/dbosk/canvaslms/releases",
"Homepage": "https://github.com/dbosk/canvaslms",
"Repository": "https://github.com/dbosk/canvaslms"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "665feeed6ce03fa63e4aec7f65fc9221ea1897904e2daf30a937c2f78da7f8f4",
"md5": "20d2be0c50e1526c527a91aae40db67e",
"sha256": "ee3a6b16d119fca7140d4f1f8cac0f43f91e8f3aa7334f12778cd4b8c87ab779"
},
"downloads": -1,
"filename": "canvaslms-4.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "20d2be0c50e1526c527a91aae40db67e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 57999,
"upload_time": "2025-08-06T08:33:11",
"upload_time_iso_8601": "2025-08-06T08:33:11.774966Z",
"url": "https://files.pythonhosted.org/packages/66/5f/eeed6ce03fa63e4aec7f65fc9221ea1897904e2daf30a937c2f78da7f8f4/canvaslms-4.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dd0b240304cc55016ce9899176bad26a6a69b6adafb447d00fd26d7536d86e95",
"md5": "a6921cba37f8acad89c5c7b23a42fd7f",
"sha256": "ba485518f612d840d851c19506903472ae8387dfae365c3d13d6dc5ae4b07925"
},
"downloads": -1,
"filename": "canvaslms-4.11.tar.gz",
"has_sig": false,
"md5_digest": "a6921cba37f8acad89c5c7b23a42fd7f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 45059,
"upload_time": "2025-08-06T08:33:13",
"upload_time_iso_8601": "2025-08-06T08:33:13.630392Z",
"url": "https://files.pythonhosted.org/packages/dd/0b/240304cc55016ce9899176bad26a6a69b6adafb447d00fd26d7536d86e95/canvaslms-4.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-06 08:33:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbosk",
"github_project": "canvaslms",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "canvaslms"
}