Grade Jupyter notebooks with Python scripts
Project description
Jupygrader
Table of Contents
Summary
Jupygrader is a Python package for automated grading of Jupyter notebooks. It provides a framework to:
- Execute and grade Jupyter notebooks containing student work and test cases
- Generate comprehensive reports in multiple formats (JSON, HTML, TXT)
- Extract student code from notebooks into separate Python files
- Verify notebook integrity by computing hashes of test cases and submissions
Key Features
- Executes notebooks in a controlled, temporary environment
- Preserves the original notebook while creating graded versions
- Adds grader scripts to notebooks to evaluate test cases
- Generates detailed grading results including:
- Individual test case scores
- Overall scores and summaries
- Success/failure status of each test
- Produces multiple output formats for instructors to review:
- Graded notebook (.ipynb)
- HTML report
- JSON result data
- Plaintext summary
- Extracted Python code
- Includes metadata like Python version, platform, and file hashes for verification
Jupygrader is designed for educational settings where instructors need to grade student work in Jupyter notebooks, providing automated feedback while maintaining records of submissions and grading results.
Installation
pip install jupygrader
Update Jupygrader
pip install --upgrade jupygrader
Usage
import jupygrader
notebook_file_path = 'path/to/notebook.ipynb'
jupygrader.grade_notebook(notebook_file_path)
Specifying the output directory
import jupygrader
notebook_file_path = 'path/to/notebook.ipynb'
output_dir_path = 'path/to/output'
jupygrader.grade_notebook(
notebook_path=notebook_file_path,
output_path=output_dir_path
)
Test
hatch uses pytest as the test runner.
hatch test
Build and Publish
Build artifact
hatch build
Publish to PyPI
hatch publish
# username: __token__
# password: [your-token-value]
Alternatively, you can create a ~/.pypirc file with the token credentials.
~/.pypirc
[pypi]
username = __token__
password = [your-token-value]
License
jupygrader is distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jupygrader-0.1.2.tar.gz.
File metadata
- Download URL: jupygrader-0.1.2.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa2873e3b691a95f234d2f545b9643bd03b23852a9f603e192abff8f6a0da58f
|
|
| MD5 |
f60babb1324ccc1c67275bd202fbb494
|
|
| BLAKE2b-256 |
0f9c2f742bbbdb83d5d309278f8adc8e5e586898ea580fc743a09438aeb1b7a9
|
File details
Details for the file jupygrader-0.1.2-py3-none-any.whl.
File metadata
- Download URL: jupygrader-0.1.2-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eee7cca0d16882e1c4462e64af6855e1c72a16f527e9019eade0830a8a9b9db
|
|
| MD5 |
b36360f5d83940985d8e11edb24e63ce
|
|
| BLAKE2b-256 |
1825ab49128f3905af576fbe11f6d7ee1a57516708735ac33e39e8618aadecfe
|