Skip to main content

A CLI to reformat and review Canvas grades

Project description

canvascli

canvascli downloads grades from Canvas and converts them into the format required for final submission to the FSC at UBC.

Installation

canvascli can be installed via pip install 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. Typing canvascli at the command prompt will show the general help message with the available sub-commands:

Usage: canvascli [OPTIONS] COMMAND [ARGS]...

  A CLI to reformat and review Canvas grades.

  Examples:
      # Download grades from canvas and convert them to FSC format
      canvascli prepare-fsc-grades --course-id 53665

      # Show courses accessible by the given API token
      canvascli show-courses

  See the --help for each subcommand for more options.

  If you don't want to be prompted for your Canvas API token, you can save it
  to an environmental variable named CANVAS_PAT.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  prepare-fsc-grades       Prepare course grades for FSC submission.
  show-courses             Show courses accessible by the given API token.

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. This 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 simple visualization of the grade distribution. Run canvascli prepare-fsc-grades --help to view all available options.

If you don't know the Canvas 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

You can set up shell completion for canvascli subcommands and options by saving the relevant completion file from the repo and sourcing it in your terminals configuration file. If you don't want to do this manually, you can run the following command (don't forget to restart your shell afterwards).

Zsh

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

Also make sure that zsh has completion enabled by adding autoload -Uz compinit && compinit to your .zshrc if it is not there already.

Bash

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

Contributing

Contributions are welcome! Please read the guidelines.

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.2.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: canvascli-0.2.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.4

File hashes

Hashes for canvascli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a0acbaf088e6fc3113bd008a6a2df9b7a5df3708d02881a47fc0c65b54ced8d1
MD5 2db4c594cf5f56f63e7714fe0df27fe1
BLAKE2b-256 1eb2d3064c4f606de9d6d72f0775dd770f36d2e101d473f8fe2171f6ea3ae59a

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