A CLI to reformat and review Canvas grades
canvascli downloads grades from Canvas
and converts them into the format required
for final submission to the FSC at UBC.
canvascli requires a recent version of Python and its package manager
After installing those (e.g. via miniconda),
you can run this command from your terminal.
pip install canvascli
canvascli functionality requires that you have created an Canvas API access
so do that first if you don't have one already.
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 simple visualization of the grade distribution.
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:
This will output a table with all the courses
your API token has access to.
canvascli show-courses --help
to view all available options.
If you don't want to be prompted for your Canvas API token each time, you can save it to an environmental variable named CANVAS_PAT (if you are using GitBash's default terminal on Windows, you will not be able to paste into the
canvascliprompt and defining the environmental variable is required).
If you want subcommands and options to complete 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).
First make sure that your zsh general shell completion enabled by adding
autoload -Uz compinit && compinitto 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 shell completion requires bash >= 4.0 (notably macOS ships with 3.x so use zsh instead). If you are using GitBash for Windows, change
.bash_profilein the command below, and note that you will only get shell completion after typing
curl -Ss https://raw.githubusercontent.com/joelostblom/canvascli/main/canvascli-complete.bash > ~/.canvascli-complete.bash && echo ". ~/.canvascli-complete.bash" >> ~/.bashrc
Questions and contributing
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size canvascli-0.3.1.tar.gz (8.9 kB)||File type Source||Python version None||Upload date||Hashes View|