Skip to main content

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:

  • --output or -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

  1. Clone the repository.
  2. Install dependencies: pip install -e .
  3. 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 to main.
    • 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

  1. Update Version:

    • Edit pyproject.toml and increment the version (e.g., 0.0.1 -> 0.0.2).
    • Commit and push to main.
  2. Create Release:

    • Go to the GitHub repository page.
    • Click Releases > Draft a new release.
    • Tag version: v0.0.2 (matching your pyproject.toml).
    • Title: v0.0.2.
    • Click Publish release.
  3. Verify:

    • Check the Actions tab to see the Publish to PyPI workflow running.
    • Once green, verify the new version is available on PyPI.

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

canvas_instructor_tools-0.1.0a0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

canvas_instructor_tools-0.1.0a0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file canvas_instructor_tools-0.1.0a0.tar.gz.

File metadata

File hashes

Hashes for canvas_instructor_tools-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 43beb402e34d37fb70f5130452bb4789fc1888f88c9c38736055aeaefe2f94cf
MD5 1a3a8d8972cc9971d3de4528d7c40650
BLAKE2b-256 9f5cf4adeff0b28db4749b297a77c5c3f7c9654a3e39ecdf5dde577cea075596

See more details on using hashes here.

Provenance

The following attestation bundles were made for canvas_instructor_tools-0.1.0a0.tar.gz:

Publisher: publish.yml on gperdrizet/canvas-instructor-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file canvas_instructor_tools-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for canvas_instructor_tools-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 6997dec3b798ca7761de2d80981eb31896b08af668418990fdb40654e76d6400
MD5 5c8bf4afd4550466960e06ea6275f28c
BLAKE2b-256 fe9da843a0967a785a628b47b2672232cfba0cdd9b3983bde6e7376ae0c54605

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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