# 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": 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/2d/b6/3ae04979bda9bf36a7358bdde7a8fa3828e760c35e58d66de82502b2a561/canvaslms-4.6.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.6",
"project_urls": {
"Bug Tracker": "https://github.com/dbosk/canvaslms/issues",
"Homepage": "https://github.com/dbosk/canvaslms",
"Releases": "https://github.com/dbosk/canvaslms/releases",
"Repository": "https://github.com/dbosk/canvaslms"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7844ce14fac983739d8a4d03c3677ce1e9182e252338166789bfff3c2eedf8fe",
"md5": "f20222cab9afd31aea7d25792f5410ba",
"sha256": "185195b86fdeb6d83686e9e20abe4749c5d493c38fb18596952e5f6253e84eca"
},
"downloads": -1,
"filename": "canvaslms-4.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f20222cab9afd31aea7d25792f5410ba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 90986,
"upload_time": "2025-01-07T11:01:16",
"upload_time_iso_8601": "2025-01-07T11:01:16.357947Z",
"url": "https://files.pythonhosted.org/packages/78/44/ce14fac983739d8a4d03c3677ce1e9182e252338166789bfff3c2eedf8fe/canvaslms-4.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2db63ae04979bda9bf36a7358bdde7a8fa3828e760c35e58d66de82502b2a561",
"md5": "a9fcabe36935ae8d1d0cdfbeed785579",
"sha256": "f0c78b7d6e177ecf3fab93bdf7d95312fbf7e01e0e60c1490e8ca9c47df02f64"
},
"downloads": -1,
"filename": "canvaslms-4.6.tar.gz",
"has_sig": false,
"md5_digest": "a9fcabe36935ae8d1d0cdfbeed785579",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 64181,
"upload_time": "2025-01-07T11:01:19",
"upload_time_iso_8601": "2025-01-07T11:01:19.430072Z",
"url": "https://files.pythonhosted.org/packages/2d/b6/3ae04979bda9bf36a7358bdde7a8fa3828e760c35e58d66de82502b2a561/canvaslms-4.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-07 11:01:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbosk",
"github_project": "canvaslms",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "canvaslms"
}