Skip to main content

gsExport

gsExport is a utility designed to help educators simplify and streamline the process of grading student notebooks. Designed to alleviate the struggles realized in UC Berkeley’s Data 8, the system allows students to easily export Jupyter notebooks as PDFs which are segmented to allow for easy grading through the Gradescope interface.

Features

The system is easy to use, once installed on the client computer.

In order to generate the PDF file for a notebook, students simply run the following commands

import gsExport
gsExport.generateSubmission("hw01a.ipynb")

The exporting tool does the following:

  • We diff the student’s notebook with the default “beginning” notebook, to see what regions students actually contributed to. By doing so, we eliminate a lot of the text/in-place code which doesn’t need to be graded

  • Using a custom LaTex template, we export to PDF (with pagebreaks as necessary)

Structure Requirements

How to work with gsExport

In your notebook, add the following

  • add the text #newpage in the Markdown cells before which you’d like to pagebreak (for example, the beginning of a question)

  • add ‘#student’ on all cells in which you expect the student to write information

To generate the new notebook, run the following commands in the shell

jupyter nbconvert hw01a.ipynb --NotebookExporter.preprocessors="['gsExport.gsExportPreprocessor']" --to notebook

which will generate a notebook with all the appropriate structure in hw01a.nbconvert.ipynb. The following structure inside the IPython notebook is added

  • The number of ‘#newpages’ in nb[‘metadata’][‘number_of_pages’]

  • All cells with ‘#student’ set cell[‘metadata’][‘#student’] = True, and the line with ‘#student’ is removed

  • We save a list of MD5 checksums of each cell in the notebook metadata: nb[‘metadata][‘checksums’]

Installation

pip install gsExport
pip install git+git://github.com/dibyaghosh/gsExport # alternatively

Development

  • exporter.py - contains the main logic for the exporter

  • utils.py - contains utilities for importing and exporting notebooks

  • ok_grading.py - contains the OK autograder and export logic

For those interested in bundling files

See setup.py for the commands required to install bundled files See utils.py for the commands required to fetch the bundled files (this is actually quite jank right now, because of a weird bug with Jupyter nbConvert )

Metadata

Release files for gsExport 0.19.1.1

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

Source distribution (sdist)

Source distribution for gsExport 0.19.1.1
File Size Uploaded Provenance Actions
gsExport-0.19.1.1.tar.gz 5.9 kB Without provenance Details for gsExport-0.19.1.1.tar.gz

Release files / gsExport-0.19.1.1.tar.gz

Download URL gsExport-0.19.1.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
65037137ab331e88b14c4e5129583d3bd223b7bc536d1e66a105177bce2b7371
BLAKE2b-256 checksum
How to use checksums
17294ffc5a7de2ae4a9c0f78527281fcc94f6a63f8218df31797d204eb7ff71e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.5.0.1 requests/2.14.2 setuptools/29.0.1.post20161207 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.4

Security for gsExport 0.19.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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