The Canvas Student Data Export Tool can export nearly all of a student's data from Instructure Canvas Learning Management System (Canvas LMS). This is useful when you are graduating or leaving your college or university, and would like to have a backup of all the data you had in canvas.
The tool exports all of the following data: - Course Assignments - Course Announcements - Course Discussions - Course Pages - Course Files - Course Modules - SingleFile HTML of Assignments, Announcements, Discussions, Modules
The tool will export your data in JSON format, and will organize it nicely into folders named for every term of every year. Example: - Fall 2013 - Econ 101 - course files - modules - Econ 101.json - English 101 - course files - modules - English 101.json - Fall 2014 - Fall 2015 - Fall 2016 - Spring 2014 - Spring 2015 - Spring 2016 - Spring 2017 - Winter 2014 - Winter 2015 - Winter 2016 - Winter 2017 - all_output.json
To run the program, you will need the following dependencies:
pip install requests
pip install jsonpickle
pip install canvasapi
pip install python-dateutil
pip install PyYAML
npm i github:gildas-lormeau/SingleFile
You can install these dependencies using
pip install -r requirements.txt
AND
npm i
Then run from the command line:
python export.py
These are the configuration parameters for the program:
- Canvas API URL - this is the URL of your institution, for example https://example.instructure.com
- Canvas API key - this can be created by going to Canvas and navigating to Account
> Settings
> Approved Integrations
> New Access Token
- Canvas User ID - this can be found at https://example.instructure.com/api/v1/users/self
in the id
field
- Path to Cookies File - file needs to be in netscape format, you can get your cookies via a tool like "Get Cookies.txt" by Rahul Shaw. This can also be left blank if an html images are unwanted.
- Directory in which to download course information to (will be created if not present)
- List of Course IDs that should be skipped
If single file fails to find your browser, you can set a path in singlefile.py. If you also want to run additional singlefile arguments that can also be done there.
To avoid manually entering credentials every time you run the program, you can create a credentials.yaml
file in the same directory as the script that has the following fields:
yaml
API_URL: < URL of your institution >
API_KEY: < API Key from Canvas >
USER_ID: < User ID from Canvas >
COOKIES_PATH: < Path to cookies file >
You can then run the script as normal:
python export.py
I would love to see this script's functionality expanded and improved! I welcome all pull requests :) Thank you!
Bumps jszip from 3.7.1 to 3.10.1.
Sourced from jszip's changelog.
v3.10.1 2022-08-02
- Add sponsorship files.
- If you appreciate the time spent maintaining JSZip then I would really appreciate your sponsorship.
- Consolidate metadata types and expose OnUpdateCallback #851 and #852
- use
const
insteadvar
in example from README.markdown #828- Switch manual download link to HTTPS #839
Internals:
v3.10.0 2022-05-20
- Change setimmediate dependency to more efficient one. Fixes Stuk/jszip#617 (see #829)
- Update types of
currentFile
metadata to includenull
(see #826)v3.9.1 2022-04-06
- Fix recursive definition of
InputFileFormat
introduced in 3.9.0.v3.9.0 2022-04-04
- Update types JSZip#loadAsync to accept a promise for data, and remove arguments from
new JSZip()
(see #752)- Update types for
compressionOptions
to JSZipFileOptions and JSZipGeneratorOptions (see #722)- Add types for
generateInternalStream
(see #774)v3.8.0 2022-03-30
- Santize filenames when files are loaded with
loadAsync
, to avoid "zip slip" attacks. The original filename is available on each zip entry asunsafeOriginalName
. See the documentation. Many thanks to McCaulay Hudson for reporting.
0f2f1e4
3.10.1cae5510
Updates for v3.10.1179c9a0
Update changelog for 3.10.161e1df5
Add Jekyll files to gitignoref299cce
Merge pull request #852 from Stuk/metadata-ts852887a
Consolidate metadata types and expose OnUpdateCallback5be00df
Add sponsorship filesdabe864
Update package-lock for benchmarkcc554da
Merge pull request #841 from stevennyman/patch-2caefbc0
Merge pull request #834 from Stuk/benchmarkDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Describe the bug\
% python export.py
Downloading course list page Was not able to save the URL https://xxxx.instructure.com/courses/ using singlefile. The reported error was No such file or directory
Issue is only with single-file, the rest of the program will still run till completion with expected output/export.
To Reproduce\ Steps to reproduce the behavior:
Manual installation: \
pip install -r requirements.txt
\
sudo apt install git
\
npm i github:gildas-lormeau/SingleFile
Run: python export.py
Connecting to canvas
Creating output directory: ./output
Getting list of all courses
Downloading course list page Was not able to save the URL https://xxxx.instructure.com/courses/ using singlefile. The reported error was No such file or directory Working on 2022 Fall C: CSE XXX: Algorithms (2022 Fall - C) Getting assignments ``` Expected behavior\ Save https://xxxx.instructure.com/courses/ to courses_list.html in ./ouput.
Environment - OS: Ubuntu 22.04.1 LTS\ - Browser: [email protected]\ - [email protected]\ - [email protected]\ - Node.js: v18.12.1\ - npm: 8.5.1
Bumps minimatch from 3.0.4 to 3.1.2.
699c459
3.1.22f2b5ff
fix: trim pattern25d7c0d
3.1.155dda29
fix: treat nocase:true as always having magic5e1fb8d
3.1.0f8145c5
Add 'allowWindowsEscape' option570e8b1
add publishConfig for v3 publishes5b7cd33
3.0.620b4b56
[fix] revert all breaking syntax changes2ff0388
document, expose, and test 'partial:true' optionDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Error after running export.py:
Getting list of all courses
Downloading course list page node:internal/modules/cjs/loader:936 throw err; ^
Error: Cannot find module 'C:\Users\Nick\ALLCOURSES\node_modules\single-file\cli\single-file' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
Having a hard time interpreting this. I have all the packages installed.