Skip to main content

Library for programmatically interacting with Gradescope.

Project description

Gradescope API

PyPI - Version PyPI - Python Version GitHub Actions Workflow Status

Description

This unofficial project serves as a library for programmatically interacting with Gradescope. The primary purpose of this project is to provide students and instructors tools for interacting with Gradescope without having to use the web interface.

For example:

  • Students using this project could automatically query information about their courses and assignments to notify them of upcoming deadlines or new assignments.
  • Instructors could use this project bulk edit assignment due dates or sync student extensions with an external system.

Features

Implemented Features Include:

  • Get all courses for a user
  • Get a list of all assignments for a course
  • Get all extensions for an assignment in a course
  • Add/remove/modify extensions for an assignment in a course
  • Add/remove/modify dates for an assignment in a course
  • Upload submissions to assignments
  • API server to interact with library without Python

Demo

To get a feel for how the API works, we have provided a demo video of the features in-use: link

Note that we only demo interacting with the API server, you can alternatively use the Python library directly.

Setup

To use the project you can install the package from PyPI using pip:

pip install gradescopeapi

For additional methods of installation, refer to the install guide

Usage

The project is designed to be simple and easy to use. As such, we have provided users with two different options for using this project.

Option 1: FastAPI

If you do not want to use Python, you can host the API using the integrated FastAPI server. This way, you can interact with Gradescope using different languages by sending HTTP requests to the API server.

Running the API Server Locally

To run the API server locally on your machine, open the project repository on your machine that you have cloned/forked, and:

  1. Navigate to the src.gradescopeapi.api directory
  2. Run the command: uvicorn api:app --reload to run the server locally
  3. In a web browser, navigate to localhost:8000/docs, to see the auto-generated FastAPI docs

Option 2: Python

Alternatively, you can use Python to use the library directly. We have provided some sample scripts of common tasks one might do:

from gradescopeapi.classes.connection import GSConnection

# create connection and login
connection = GSConnection()
connection.login("email@domain.com", "password")

"""
Fetching all courses for user
"""
courses = connection.account.get_courses()
for course in courses["instructor"]:
    print(course)
for course in courses["student"]:
    print(course)

"""
Getting roster for a course
"""
course_id = "123456"
members = connection.account.get_course_users(course_id)
for member in members:
    print(member)

"""
Getting all assignments for course
"""
assignments = connection.account.get_assignments(course_id)
for assignment in assignments:
    print(assignment)

For more examples of features not covered here such as changing extensions, uploading files, etc., please refer to the tests directory.

Testing

For information on how to run your own tests using gradescopeapi, refer to TESTING.md

Contributing Guidelines

Please refer to the CONTRIBUTING.md file for more information on how to contribute to the project.

Authors

  • Susmitha Kusuma
  • Berry Liu
  • Margaret Jagger
  • Calvin Tian
  • Kevin Zheng

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gradescopeapi-1.8.0.tar.gz (125.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradescopeapi-1.8.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file gradescopeapi-1.8.0.tar.gz.

File metadata

  • Download URL: gradescopeapi-1.8.0.tar.gz
  • Upload date:
  • Size: 125.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gradescopeapi-1.8.0.tar.gz
Algorithm Hash digest
SHA256 3a304547e45ecba2f4abfc7dd29ef71daa0d32c3a55b43e4f1cac7db2fae4bf1
MD5 dd9418769dce3e2de40f7c2a6317f8b5
BLAKE2b-256 3dd5f84dd9b70fc50790e6cd06f4eea58e43fa71c0a0e6f715973f160d52cd30

See more details on using hashes here.

File details

Details for the file gradescopeapi-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: gradescopeapi-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for gradescopeapi-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79430374d8d792717ce153c914ebb86f1598821da660356bbf3b7a8349e4026f
MD5 bd7bd2dcd3854c0ba510532172f8c815
BLAKE2b-256 7f56c3f428085b386d6b26ea4268b2e50aa09eb720b0c759f0a0220ece9fb29e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page