A collection of tools for automating Canvas LMS instructor operations.
Project description
Canvas Tools
A Python package for automating common instructor operations on the Canvas LMS.
Features
- Download Submissions: Bulk download all file submissions for a specific assignment, automatically renaming them with the student's name.
Installation
pip install canvas-tools
Configuration
Create a .env file in your working directory with your Canvas credentials:
CANVAS_API_URL=https://your.institution.instructure.com
CANVAS_API_KEY=your_api_key_here
Usage
Command Line Interface
To download submissions for a specific assignment:
# Syntax: canvas-tools download <course_id> <assignment_id>
canvas-tools download 12345 67890
Optional arguments:
--outputor-o: Specify the output directory (default: current directory)
Python API
from canvas_tools import download_assignment_submissions
download_assignment_submissions(
course_id=12345,
assignment_id=67890,
output_dir="my_downloads"
)
Development
- Clone the repository.
- Install dependencies:
pip install -e . - Run tests:
python -m unittest discover tests
CI/CD & Publishing
This project uses GitHub Actions for automated testing and publishing.
Workflow Overview
- CI (
.github/workflows/ci.yml): Runs on every Pull Request and push tomain.- Tests across Python 3.11, 3.12, and 3.13.
- Verifies the package builds successfully.
- Publish (
.github/workflows/publish.yml): Runs when a GitHub Release is published.- Builds the package.
- Publishes to TestPyPI and PyPI using Trusted Publishing (OIDC).
How to Publish a New Version
-
Update Version:
- Edit
pyproject.tomland increment theversion(e.g.,0.0.1->0.0.2). - Commit and push to
main.
- Edit
-
Create Release:
- Go to the GitHub repository page.
- Click Releases > Draft a new release.
- Tag version:
v0.0.2(matching yourpyproject.toml). - Title:
v0.0.2. - Click Publish release.
-
Verify:
- Check the Actions tab to see the
Publish to PyPIworkflow running. - Once green, verify the new version is available on PyPI.
- Check the Actions tab to see the
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file canvas_instructor_tools-0.1.0a0.tar.gz.
File metadata
- Download URL: canvas_instructor_tools-0.1.0a0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43beb402e34d37fb70f5130452bb4789fc1888f88c9c38736055aeaefe2f94cf
|
|
| MD5 |
1a3a8d8972cc9971d3de4528d7c40650
|
|
| BLAKE2b-256 |
9f5cf4adeff0b28db4749b297a77c5c3f7c9654a3e39ecdf5dde577cea075596
|
Provenance
The following attestation bundles were made for canvas_instructor_tools-0.1.0a0.tar.gz:
Publisher:
publish.yml on gperdrizet/canvas-instructor-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canvas_instructor_tools-0.1.0a0.tar.gz -
Subject digest:
43beb402e34d37fb70f5130452bb4789fc1888f88c9c38736055aeaefe2f94cf - Sigstore transparency entry: 790681260
- Sigstore integration time:
-
Permalink:
gperdrizet/canvas-instructor-tools@788abeb5533b3fe6ff882f1c364de3d3b57b5a20 -
Branch / Tag:
refs/tags/0.1.0-alpha - Owner: https://github.com/gperdrizet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@788abeb5533b3fe6ff882f1c364de3d3b57b5a20 -
Trigger Event:
release
-
Statement type:
File details
Details for the file canvas_instructor_tools-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: canvas_instructor_tools-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6997dec3b798ca7761de2d80981eb31896b08af668418990fdb40654e76d6400
|
|
| MD5 |
5c8bf4afd4550466960e06ea6275f28c
|
|
| BLAKE2b-256 |
fe9da843a0967a785a628b47b2672232cfba0cdd9b3983bde6e7376ae0c54605
|
Provenance
The following attestation bundles were made for canvas_instructor_tools-0.1.0a0-py3-none-any.whl:
Publisher:
publish.yml on gperdrizet/canvas-instructor-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
canvas_instructor_tools-0.1.0a0-py3-none-any.whl -
Subject digest:
6997dec3b798ca7761de2d80981eb31896b08af668418990fdb40654e76d6400 - Sigstore transparency entry: 790681262
- Sigstore integration time:
-
Permalink:
gperdrizet/canvas-instructor-tools@788abeb5533b3fe6ff882f1c364de3d3b57b5a20 -
Branch / Tag:
refs/tags/0.1.0-alpha - Owner: https://github.com/gperdrizet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@788abeb5533b3fe6ff882f1c364de3d3b57b5a20 -
Trigger Event:
release
-
Statement type: