Pip installable canvas API used by GT classes
Project description
Installation
Test Repo
This will be updated with the "formal" pypi repo eventually, but for now it's located here.
python3 -m pip install --upgrade --index-url https://test.pypi.org/simple/ canvas-lms-api
Formal Repo
This will be updated with the "formal" pypi repo eventually, but for now it's located here.
python3 -m pip install --upgrade canvas-lms-api
Alternatively, you can download the source code and pip install from that:
git clone https://github.gatech.edu/omscs-ta/canvas-lms-api
cd canvas-lms-api
pip install .
Usage:
Get Canvas Token
Found here: Canvas > Account > Settings > Approved Integrations: > New Access Token.
Get Course Number
There are really 2 ways.
- Use this tool to find all the courses and then use the number below (course is optional so you can set it later)
from canvas_lms_api import Canvas
grader = Canvas(base="https://gatech.instructure.com", token=YOUR TOKEN)
grader.GetCourses()
- Login to canvas
- Go to your course
- eg: https://gatech.instructure.com/courses/46234
- The value for canvas_course is "46234"
Get Assignments Example
from canvas_lms_api import Canvas
grader = Canvas(base="https://gatech.instructure.com", token=YOUR TOKEN, course=Your Course Number)
grader.GetAssignments()
Get Course Users Example
from canvas_lms_api import Canvas
grader = Canvas(base="https://gatech.instructure.com", token=YOUR TOKEN, course=Your Course Number)
grader.GetCourseUsers()
Submit Grades Example
from canvas_lms_api import Canvas
grader = Canvas(base="https://gatech.instructure.com", token=YOUR TOKEN, course=Your Course Number)
# Find your assignment id number see Get Assignments Example
assignment_id = ""
# Find your student id number see Get Course Users Example
student_id = ""
# Set score and comment
score = "75"
comment = "The student failed to complete the assignment\nAnd they got thse points wrong\n(-10) for poor guessing"
grader.SubmitGrade(assignment_id, student_id, score, comment, visibility=False)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
canvas-lms-api-0.1.8.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for canvas_lms_api-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2ba185b07bf5824e7469ea0e72a57ff9df44c9adc41028d74866ca485f3d36 |
|
MD5 | 19e36def973f35ea330a7b6df0c03fd4 |
|
BLAKE2b-256 | e08e7742af22c20d2c15d7270cdd5cdd5c6e60e60aa35790ff5b7e0428a24676 |