Scripts for automating CSCE 361 tasks
These scripts are designed to automate the creation, population, and staffing of repositories for student assignments.
Requires
- python-gitlab
pip3 install python-gitlab
- documentation: https://python-gitlab.readthedocs.io
- canvasapi
pip3 install canvasapi
- documentation: https://canvasapi.readthedocs.io/en/latest/index.html
- https://community.canvaslms.com/videos/3227-pycanvas-a-python-wrapper-for-the-canvas-api-matthew-emond
- I'm pretty sure this isn't the same API wrapper that Chris Bourke is using
Files
-
config.py
- provides URLs and API keys
-
do not commit API keys to repository
- you will need to replace
None
with your API keys (as strings)
- you will need to replace
-
course.py
- provides namespace and group ID
- will need to update each semester
- provides namespace and group ID
-
prep_assignment.py
- An early iteration of automated student pairing, canvas student group creation, and gitlab repo creation. It lacks robustness to odd number of students; it has a quick'n'dirty loop termination that does not guarantee graylist compliance, and project naming is hard-coded.
-
api/
- canvas_classes.py
- Classes to encapsulate concepts from Canvas CMS
- gitlab_classes.py
- Classes to encapsulate concepts from Gitlab VMS
- composite_user.py
- Wrapper class that pairs a user from Canvas with the corresponding user from Gitlab
- canvas_classes.py
Older Files
These are vestigial files that should not be needed further, but we are retaining until we are certain.
- old-automation/
- Directory containing early fall 2019 scripts to clone, create, process, etc., student repositories. The contents of this directory are not needed.
- 1195/
- Directory containing scripts from summer 2019 pilot of new course structure. Should be obsolete (and removed) by end of fall 2019. The contents of this directory are not needed.
- experimentation/
- gitlab_functions.py - provides functions to query & update projects (including its members and issues) - These functions are those we believe are useful for automating pair & team projects for CSCE 361 - These generally are wrappers for calls you could make directly from what python-gitlab provides, but these functions don't require you to memorize the api - includes an enumeration of the fields for User, Project, and Issue - includes side-effect-free example function calls
- gitlab_demo.py
- includes commented-out functions demonstrating the creation of projects, adding users to projects, and creating/updating the projects' issues
- canvas_experiments.py
- includes experimental use of the Canvas API, culminating in creating a group set (group_category), adding groups to it, and adding students to a group