Skip to content

Instantly share code, notes, and snippets.

@kevinlin1
Created October 11, 2022 17:33
Show Gist options
  • Save kevinlin1/dd3490a48483d365e7252a6b3a066ea3 to your computer and use it in GitHub Desktop.
Save kevinlin1/dd3490a48483d365e7252a6b3a066ea3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from canvasapi import Canvas
import os
if __name__ == "__main__":
canvas = Canvas("https://canvas.uw.edu", os.getenv("TOKEN"))
course = canvas.get_course(os.getenv("COURSE_ID"))
groups = course.get_groups()
for group in groups:
students = ",".join(user.login_id for user in group.get_users())
print(students + ":" + group.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment