{"id":23810,"library":"gradescope-utils","title":"gradescope-utils","description":"Utilities for building Gradescope autograders. Current version 0.5.0, released June 2022. The library provides decorators and a JSON test runner to streamline autograder development. Low release cadence.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/gradescope/gradescope-utils","tags":["gradescope","autograder","testing","education"],"install":[{"cmd":"pip install gradescope-utils","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"wrong":"","symbol":"JSONTestRunner","correct":"from gradescope_utils import JSONTestRunner"}],"quickstart":{"code":"import unittest\nfrom gradescope_utils import JSONTestRunner\nfrom gradescope_utils.decorators import weight\n\nclass TestHello(unittest.TestCase):\n    @weight(1)\n    def test_hello(self):\n        self.assertEqual('hello', 'hello')\n\nif __name__ == '__main__':\n    suite = unittest.defaultTestLoader.discover('tests')\n    JSONTestRunner(visibility='visible').run(suite)","lang":"python","description":"Basic autograder using unittest and gradescope-utils decorators."},"warnings":[{"fix":"Update to >=0.3.1 or pass number as a string.","message":"The @number decorator argument must be a string. In version 0.3.1 it was converted to string automatically, but in earlier versions you had to pass a string explicitly.","severity":"gotcha","affected_versions":"<0.3.1"},{"fix":"Set visibility on the runner and ensure individual tests don't override incorrectly.","message":"JSONTestRunner's visibility parameter only works if the test suite top-level visibility is not overridden by individual test visibilities. Use 'visible', 'after_published', or 'hidden'.","severity":"gotcha","affected_versions":">=0.2.7"},{"fix":"Inside the test method, set self.score to the desired score (float or int).","message":"The @partial_credit decorator requires you to set the score via the test case's 'score' attribute; it does not automatically compute partial credit.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"For deeper checks, implement custom validation.","message":"The check_submitted_files utility checks for file existence only; it does not check file content or directory structure beyond the base path.","severity":"gotcha","affected_versions":">=0.2.4"}],"env_vars":null,"search_vec":"'0.5.0':11 '2022':14 'autograd':8,26,32 'build':6 'cadenc':30 'current':9 'decor':18 'develop':27 'educ':34 'gradescop':2,7,31 'gradescope-util':1 'json':21 'june':13 'librari':16 'low':28 'provid':17 'releas':12,29 'runner':23 'streamlin':25 'test':22,33 'util':3,4 'version':10","created_at":"2026-05-01T08:09:44.491934+00:00","updated_at":"2026-05-01T08:09:44.491934+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'JSONTestRunner' from 'gradescope_utils' (/tmp/tmp0ef0j1p1/venv/lib/python3.12/site-packages/gradescope_utils/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.5.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/gradescope/gradescope-utils","docs":null,"changelog":null,"pypi":"https://pypi.org/project/gradescope-utils/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}