Skip to main content

A fast, safe, and customizable CLI tool to download course content from Canvas.

Project description

Canvas_Downloader

Open Source Educational Canvas LMS Python 3.8+ License: MIT CLI Tool

A fast, safe, and customizable tool to download course content from Canvas (Instructure).

Features:

  • Safe: Strictly read-only. Never modifies, deletes, or uploads any data.
  • Cross-Platform: Works on macOS, Windows, and Linux.
  • Optimized: Uses parallel downloading and smart rate-limiting to be fast without getting blocked.
  • Complete: Can download Files, Modules, Pages, and Assignments (including attached solutions/descriptions).
  • Flexible: download everything in structured folders, or flatten it; ignore specific files; pick specific courses.

Why?

  • I was tired of downloading course content manually
  • I wanted to have a backup of my courses
  • I wanted to be able to access my courses offline
  • I want to feed the downloaded content into a LLM
  • I want to turn my courses into a searchable database
  • I want to turn my courses into a quiz or practice test

⚡ Quick Start

Option 1: Install via Pip (Recommended)

This is the easiest way to use the tool.

pip install canvas_downloader

Then run it anywhere:

canvas-downloader --help

Option 2: Run from Source

  1. Clone the repo:
    git clone https://github.com/jamubc/Canvas_Downloader.git
    cd Canvas_Downloader
    
  2. Install dependencies:
    uv pip install -r requirements.txt
    # OR
    pip install -r requirements.txt
    
  3. Run:
    python downloader.py --help
    

Basic Usage

canvas-downloader \
    --api-token YOUR_API_TOKEN \
    --course-id YOUR_COURSE_ID \
    --output-dir ./my_course_download \
    --canvas-url https://canvas.instructure.com

(Replace YOUR_API_TOKEN, YOUR_COURSE_ID with real values. Use your school's URL for --canvas-url)

For more information see Canvas API Documentation


🛠 Flags

You can customize the download by adding these flags to the command above:

Flag Description
--include-assignments Recommended. Downloads assignment instructions and attached files (solutions, starter code, etc.) into an Assignments/ folder.
--include-submissions Download your own submissions (e.g. uploaded files, graded PDFs) into Assignments/{Name}/Submissions/.
--no-structure Flattens all files into a single directory instead of organizing them by Module/Week.
--ignore-pattern "*.ext" Skips files matching the pattern. Can be used multiple times.
Example: --ignore-pattern "*.zip" --ignore-pattern "*.m"
--no-optimize Disables parallel downloading and smart rate-limiting. Use this if you encounter errors or want a strictly sequential, slower download.
--force Force redownload of all files, ignoring any existing files (bypassing sync logic).
--canvas-url URL Base URL of your Canvas instance. Defaults to https://canvas.instructure.com.
Example: https://canvas.ubc.ca

Example Usage:

uv run python downloader.py \
    --api-token <TOKEN> \
    --course-id 123456 \
    --output-dir ./Fall2024_Backup \
    --canvas-url https://canvas.ubc.ca \
    --include-assignments \
    --ignore-pattern "*.mp4" 

🔄 Re-running

To download new content later, just run the same command again. The script is safe to run multiple times; it will overwrite existing files with the latest versions from Canvas.

🙋 Common Questions (FAQ)

Q: How do I download all my Canvas course contents at once? A: This tool is built exactly for that. It iterates through your entire course (Modules, Files, Assignments, Pages) and saves everything to your local computer in one go.

Q: Can I backup my Canvas courses before I lose access? A: Yes! Use this tool at the end of the semester to create a permanent, offline archive of your materials (PDFs, PPTXs, Videos, etc).

Q: Does this download videos and quiz content? A: It downloads files and assignment descriptions. Video support and specific quiz capture are currently being worked on (see Upcoming Features).

Issues with usage?

Im happy to help, please open an issue on GitHub.

Upcoming Features

  • Downloading Video files (currently unhandled)
  • AI Embedding
  • Plug in usage for 'canvas-mcp-tool' (please reach out if you are interested in testing it!)
  • Repomix integration

License

This project is licensed under the MIT License - see the LICENSE file for details.

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_downloader-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

canvas_downloader-0.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file canvas_downloader-0.1.0.tar.gz.

File metadata

  • Download URL: canvas_downloader-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for canvas_downloader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ffde061157b68f667a9c46b7b86cde3c00f1aa099dece0b7abfd6436a78e76b4
MD5 c0523db4a0c2fe2e80ba475e4930dbbc
BLAKE2b-256 08f86ad97a64b7ca061559023e3a597c945ad210497cb15bcb8468d39676fe64

See more details on using hashes here.

File details

Details for the file canvas_downloader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: canvas_downloader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for canvas_downloader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 759b524461a2c3fd2f748c31601a7eee661d80a2e3db16996fba555bbe67a692
MD5 badc9eb39199bb1bc5aeddab1423859e
BLAKE2b-256 ffbb9195252f575a8234a0944ce23d188dbb615f53029170553833dfcf8e7f5e

See more details on using hashes here.

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