Skip to main content

A CLI to reformat and review Canvas grades

Project description

canvascli

canvascli downloads grades from Canvas, converts them into the format required for final submission to the FSC at UBC, and creates a few helpful visualizations.

Installation

canvascli requires a recent version of Python and its package manager pip. After installing those (e.g. via miniconda), you can run this command from your terminal.

python -m pip install -U canvascli

Usage

All canvascli functionality requires that you have created an Canvas API access token, so do that first if you don't have one already.

When running canvascli, you can either paste your Canvas token when prompted at the command line (ideally using a password manager, e.g. KeePassXC), or store it in an environment variable named CANVAS_PAT.

Typing canvascli at the command prompt will show the general help message including the available sub-commands. The most common use case is probably to prepare final grades for FSC submission, which you can do like so:

canvascli prepare-fsc-grades --course-id 53665

This will save a CSV file in the current directory which can be uploaded to the FSC. The file should automatically be correctly formatted, but it is a good idea to double check in case there are unexpected changes to how UBC inputs course info on Canvas.

canvascli drops students without a grade by default, and creates a few helpful visualizations of the final grades and assignment scores. Run canvascli prepare-fsc-grades --help to view all available options.

If you don't know the Canvas course id of your course, canvascli can check for you:

canvascli show-courses

This will output a table with all the courses your API token has access to. Run canvascli show-courses --help to view all available options.

Shell completion (optional, click to expand)

If you want suggestions for subcommands and option flags when you press TAB you can download the corresponding completion file from the GitHub repository and source it in your terminal's configuration file. If you don't want to do this manually, you can run one of the following commands (don't forget to restart your shell afterwards).

Zsh

First make sure that your zsh general shell completion enabled by adding autoload -Uz compinit && compinit to your .zshrc; it is important that this line is added before running the command below.

curl -Ss https://raw.githubusercontent.com/joelostblom/canvascli/main/canvascli-complete.zsh > ~/.canvascli-complete.zsh && echo ". ~/.canvascli-complete.zsh" >> ~/.zshrc

Bash

Bash shell completion requires bash >= 4.0 (notably macOS ships with 3.x so use zsh instead). If you are using GitBash for Windows, change .bashrc to .bash_profile in the command below, and note that you will only get shell completion after typing cavascli, not canvascli.exe.

curl -Ss https://raw.githubusercontent.com/joelostblom/canvascli/main/canvascli-complete.bash > ~/.canvascli-complete.bash && echo ". ~/.canvascli-complete.bash" >> ~/.bashrc

Questions and contributing

Questions and contributions are welcome! The best way to get in touch is to open a new issue or discussion. Remember to follow the Code of Conduct when you participate in this project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canvascli-0.6.0.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

canvascli-0.6.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file canvascli-0.6.0.tar.gz.

File metadata

  • Download URL: canvascli-0.6.0.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.4

File hashes

Hashes for canvascli-0.6.0.tar.gz
Algorithm Hash digest
SHA256 58e10c30978404b066ad5f2e07a4d323e5602204a19cfd8a4d157da59f6ceca4
MD5 dbb9e3615bcf11cbde42a162004e5a70
BLAKE2b-256 14c94905a2d3f525c57c52d9f06ba469aa039a289c41adcc3f5439ac5c3b1099

See more details on using hashes here.

File details

Details for the file canvascli-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: canvascli-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.4

File hashes

Hashes for canvascli-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5438e6f2a819d9ae961d42d4de33b03ac7a5e6ec119cbb7dea15db071df579e
MD5 0534485ac51aac2301be8903aeea70d8
BLAKE2b-256 d6ce3bbe789ca49c874512dfb6e33eb883c023d9b46b600a1a57661faa29f5b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page