/canvas-file-scraper

Python script to scrape files from Canvas

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Canvas File Scraper

This repo hosts a simple python script to download all available files in all courses on your Canvas page.

Dependencies

If you use pipenv you can just run pipenv install to setup the environment.

Usage

python canvas-scraper.py <CANVAS_API_KEY> -u <yourschool.instructure.com> -m

canvas_url should be specified like: asdf.instructure.com

For info on how to get an API key please refer to the Canvas Dev course

To get courses from past terms, save the html file of the course list page from your browser to course_list.html in this folder and then run:

cat course_list.html | grep -oE '/courses/[0-9]+' | grep -oE '[0-9]+' | sort -u > course_list.txt

and then run the script

Todo

  • Add async option
  • Add support for more item types
  • Store returned json data from Canvas API