Quickstart
marimo-gradescope turns a single marimo notebook into a student notebook and a Gradescope autograder.
The notebook contains the solutions and the tests, and the tests are plain pytest functions.
Install
Section titled “Install”Install it as a uv tool:
uv tool install marimo-gradescopeThe command is marimogs.
Start an assignment
Section titled “Start an assignment”marimogs init A1marimogs edit A1init creates A1/A1.py, a notebook with a short guide and two example questions.
You write the whole assignment in marimo’s editor.
Example
Section titled “Example”The assignment’s settings go in a cell of their own:
@app.celldef _(): mogs.assignment(name="A1") returnA question consists of a function, its tests, and a grade cell with its points:
@app.functiondef mean(xs): # BEGIN SOLUTION return sum(xs) / len(xs) # END SOLUTION
@app.celldef _(): def test_q1_whole_numbers(): assert mean([1, 2, 3]) == 2
return
@app.celldef _(): # HIDDEN def test_q1_negative(): assert mean([-4, 4, -6]) == -2
return
@app.celldef _(): mogs.grade("q1", points=4) returnThe build removes the # HIDDEN cell and the mogs.assignment cell from the student notebook.
Only Gradescope runs the hidden tests.
Say the notebook is examples/demo/hw.py.
Then:
marimogs build examples/demoThe command prints what to do with the result:
All done!Upload to Gradescope : examples/demo/dist/autograder/hw-autograder-2026_09_30T12_30_41_890583.zipDistribute to students: examples/demo/dist/student/hw.zipUpload the autograder zip to Gradescope.
Give hw.zip to your students and point them to the student guide.
It contains the student notebook, its public tests and its data files.
dist/autograder/hw.py is the student notebook with the full solution.
Submit it on Gradescope to check the autograder.
It should get full marks.
See examples/demo for the complete assignment.