Command-line interface for Google Classroom and Google Drive.
Lets you list courses, view assignments, upload files, and submit work—all from your terminal.
-
Create & activate a virtual environment:
python -m venv .venv # Windows: .venv\Scripts\Activate.ps1 # macOS/Linux: source .venv/bin/activate
-
Install the package:
pip install -e . -
Show paths where config/creds are stored:
gclass paths
-
Place your Google API
credentials.jsonthere, then run:gclass auth
Now you’re ready—try:
gclass list-coursesIf Quickstart fails (like fresh accounts or new APIs), follow the full setup:
- Go to Google Cloud Console
- Click New Project → name it
gclass-cli
- Enable Google Classroom API
- Enable Google Drive API
- Choose External → fill details
- Under Test Users, add your Gmail (the account with Classroom access)
- Credentials → Create Credentials > OAuth Client ID
- App type: Desktop App
- Download the JSON as
credentials.json
gclass pathsCopy the JSON into the printed path.
gclass authLog in, grant permissions. A token.json will be saved.
Test it:
gclass list-coursesCommon commands:
gclass whoami→ display signed-in accountgclass list-courses [--page-size N] [--pick]→ list courses / set defaultgclass list-students --course COURSE_ID→ show course studentsgclass list-assignments --course COURSE_ID→ show coursework & due datesgclass set-default --course COURSE_ID→ set default coursegclass upload --file PATH→ upload a file to Drivegclass open [--course COURSE_ID] [--assignment COURSEWORK_ID]→ open in browsergclass submit --assignment COURSEWORK_ID --file PATH [--course COURSE_ID]→ turn in work
# Pick a course
gclass list-courses --pick
# See assignments
gclass list-assignments --course <classID>
# Submit work
gclass submit --assignment <AssignmentID> --file "report.pdf"src/gclass/cli.py→ CLI with Click & Richsrc/gclass/auth.py→ OAuth + token handlingsrc/gclass/config.py→ paths, settings, scopessrc/gclass/services.py→ Classroom & Drive API helpers