This release is a pre-release and may not be stable for production use.
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.
- Course and Assignment Discovery: List available courses and assignments.
- Submission Metadata: Retrieve normalized submission payloads and assignment descriptions.
- Grade and Comment Posting: Post grades/comments for individual students or batch updates.
Installation
pip install canvas-instructor-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)--include-links: Attempt to download URL submissions as files
Additional commands:
canvas-tools list-courses
canvas-tools list-assignments <course_id>
canvas-tools post-grade <course_id> <assignment_id> <user_id> <posted_grade> --comment "Nice work"
canvas-tools post-comment <course_id> <assignment_id> <user_id> "Please add more tests"
Python API
from canvas_tools import (
download_submission_artifacts,
get_assignment_description,
list_assignment_submissions,
list_course_assignments,
list_courses,
post_submission_grade,
)
courses = list_courses()
assignments = list_course_assignments(course_id=12345)
submissions = list_assignment_submissions(course_id=12345, assignment_id=67890)
description = get_assignment_description(course_id=12345, assignment_id=67890)
download_submission_artifacts(course_id=12345, assignment_id=67890, output_dir="my_downloads", include_links=True)
post_submission_grade(course_id=12345, assignment_id=67890, user_id=111, posted_grade="95", comment="Strong submission")
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 on version tags (v*) or 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
Release files for canvas-instructor-tools 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| canvas_instructor_tools-0.1.0a1.tar.gz | 10.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| canvas_instructor_tools-0.1.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / canvas_instructor_tools-0.1.0a1.tar.gz
| Download URL | canvas_instructor_tools-0.1.0a1.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71490446f00d908acc35b0e2ba561082c59488afee268b588eb0de5a34661ebe
|
|
BLAKE2b-256 checksum How to use checksums |
467a7cc885ec85afead786288434f557835d5007f30f9283c078be5df9d7d4a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.
Transparency logRelease files / canvas_instructor_tools-0.1.0a1-py3-none-any.whl
| Download URL | canvas_instructor_tools-0.1.0a1-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0198b8ed68888acc2a73ddc35ed5234ea48ca33a7ffaec0b802e272440b06d0
|
|
BLAKE2b-256 checksum How to use checksums |
0bc239a41d11e5dc6406d535278f4e18b73090c579a8bcbc00dd81b4f21df7af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 16, 2026.
Transparency log