2019-08-15 23:38:16 -06:00
# Introduction
2021-03-16 21:20:56 -06:00
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.
2019-08-15 23:38:16 -06:00
2021-03-16 21:20:56 -06:00
The tool exports all of the following data:
2019-08-15 23:38:16 -06:00
- Course Assignments
- Course Announcements
- Course Discussions
- Course Pages
- Course Files
- Course Modules
2021-03-16 21:20:56 -06:00
The tool will export your data in JSON format, and will organize it nicely into folders named for every term of every year.
Example:
2019-08-15 23:38:16 -06:00
- Fall 2013
- Econ 101
2021-07-03 10:46:24 -06:00
- course files
2019-08-15 23:38:16 -06:00
- modules
- Econ 101.json
- English 101
2021-07-03 10:46:24 -06:00
- course files
2019-08-15 23:38:16 -06:00
- 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
# Getting Started
2021-07-03 10:44:56 -06:00
2019-08-15 23:38:16 -06:00
## Dependencies
To run the program, you will need the following dependencies:
`pip install requests`
`pip install jsonpickle`
2021-07-03 10:48:12 -06:00
`pip install canvasapi`
`pip install python-dateutil`
2021-07-03 10:44:56 -06:00
`pip install PyYAML`
2021-03-16 21:33:05 -06:00
2021-12-18 02:53:30 -07:00
`npm i github:gildas-lormeau/SingleFile`
2021-03-16 21:33:05 -06:00
You can install these dependencies using
2021-12-18 02:53:30 -07:00
`pip install -r requirements.txt` AND
`npm i`
2019-08-15 23:38:16 -06:00
2021-03-16 21:20:56 -06:00
Then run from the command line:
2019-08-15 23:38:16 -06:00
`python export.py`
## Configuration
These are the configuration parameters for the program:
2021-03-16 21:20:56 -06:00
- 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
2019-08-15 23:38:16 -06:00
- Directory in which to download course information to (will be created if not present)
- List of Course IDs that should be skipped
2021-03-16 21:20:56 -06:00
### Loading credentials from a file
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 >
2021-12-24 03:19:29 -07:00
COOKIES_PATH: < Path to cookies file >
2021-03-16 21:20:56 -06:00
```
You can then run the script as normal:
`python export.py`
2019-08-15 23:38:16 -06:00
# Contribute
2021-03-16 21:20:56 -06:00
I would love to see this script's functionality expanded and improved! I welcome all pull requests :) Thank you!