Skip to main content

GRADESCOPE

A Python wrapper for Gradescope to easily retrieve data from your Gradescope Courses.

license last-commit repo-top-language repo-language-count

Overview

Gradescope is a Python package project designed to provide seamless interaction with the Gradescope service, offering functionalities such as login, fetching course and assignment information, and submission downloads. By encapsulating key entities like Courses, Assignments, and Members, Gradescope provides a structured approach for managing data in JSON and CSV formats. The project aims to simplify tasks for users by providing wrapper functions that handle data retrieving and API calls.


Installation

pip install gradescope-tool

Example Usage

from gradescope import *

gs = Gradescope('username', 'password')

courses = gs.get_courses(role=Role.INSTRUCTOR)
# courses:
# [Course(
#    course_id=123456,
#    url='/courses/123456',
#    role='instructor',
#    term='Spring 2024',
#    short_name='Math 2B',
#    full_name='Math 2B: Calculus'
# ), ...]

assignments = gs.get_assignments(courses[0])
# assignments:
# [Assignment(
#    assignment_id=654321,
#    assignment_type='assignment',
#    url='/courses/123456/assignments/654321',
#    title='Assignment 1',
#    container_id=None,
#    versioned=False,
#    version_index=None,
#    version_name=None,
#    total_points='100.0',
#    student_submission=True,
#    created_at='Apr 01',
#    release_date='2024-04-01T00:00',
#    due_date='2024-04-07T23:59',
#    hard_due_date='2024-04-10T23:59',
#    time_limit=None,
#    active_submissions=250,
#    grading_progress=100,
#    published=True,
#    regrade_requests_open=False,
#    regrade_requests_possible=True,
#    regrade_request_count=0,
#    due_or_created_at_date='2024-04-07T23:59'
# ), ...]

members = gs.get_members(courses[0])
# members:
# [Member(
#    member_id='112233',
#    full_name='Peter Anteater',
#    first_name='Peter',
#    last_name='Anteater',
#    role='0',
#    sid='1234567890',
#    email='uci.mascot@uci.edu'
# ), ...]

past_submissions = gs.get_past_submissions(courses[0], assignments[0], members[0])
# past_submissions:
# [Submission(
#    course_id=123456,
#    assignment_id=654321,
#    member_id='112233',
#    submission_id=987654321,
#    created_at='2024-04-07T12:34:56.655388-07:00',
#    score=55.55,
#    url='/courses/123456/assignments/654321/submissions/987654321'
# ), ...]

gradebook = gs.get_gradebook(courses[0], members[0])
save_json('./gradebook.json', gradebook, encoder=EnhancedJSONEncoder)

grades_csv = gs.get_assignment_grades(assignments[0])
save_csv('./assignment_grades.csv', grades_csv)

gs.download_file('./submission.zip', past_submission[-1].get_file_url())

Modules

File Summary
gradescope.py Manage interaction with Gradescope API. Provide functionality such as login; retrieving course, assignment, member, past submissions, and gradebook data; and submission downloads.
dataclass.py Defines data classes for Courses, Assignments, Members, and Submissions in Gradescope. Supports generating URLs and download links.
constants.py Defines base URLs and role mappings for Gradescope API integration.
utils.py Provide dataclasse to dictionaries encoder and functions for easy loading/saving JSON and CSV files.
errors.py Defines custom exception classes for handling different error scenarios in the Gradescope API interactions. Includes LoginError, NotLoggedInError, and ResponseError classes to manage login failures, unauthorized access, and general response issues.

Contributing

Contributions are welcome! Here are several ways you can contribute:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/Teaching-and-Learning-in-Computing/Gradescope
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!

Contribution


License

This project is protected under the MIT License.


Disclaimer

By using this package, you acknowledge and agree to the following terms:

  • High Traffic Warning: This package may generate a high volume of traffic and excessive API calls to websites or services, which could affect the performance of these sites or services.

  • Potential Consequences: Misuse of this package or unintended operation can lead to circumstances such as account suspension or permanent ban from the affected websites or services.

By using this package, you agree that you are using it at your own risk. You should comply with all applicable laws and regulations, and respect the terms of service of any website or service you interact with.

Release files for gradescope-tool 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gradescope-tool 0.1.4
File Size Uploaded
gradescope_tool-0.1.4.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gradescope-tool 0.1.4
File Interpreter ABI Platform
gradescope_tool-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.9 kB

Release files / gradescope_tool-0.1.4.tar.gz

Download URL gradescope_tool-0.1.4.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e52df70e10abf7a2e0de702f25fab7776bc8823c8001ca2fd487092fdb107f88
BLAKE2b-256 checksum
How to use checksums
44667a73678c3c6eb759cf5ab25d9baac4a1653542a644f60474ea51bbc87035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2025.

Transparency log

Release files / gradescope_tool-0.1.4-py3-none-any.whl

Download URL gradescope_tool-0.1.4-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c02d6e6e95aa2916cb0bf825e8c02ac0dad7695ba9558281e768500669d4c831
BLAKE2b-256 checksum
How to use checksums
d3e64491de6e41d0733f08a3694f2b7a06a27ee40397844949f9ea3c1f78952d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page