Skip to main content

Converts Jupyter notebooks into pytest capable test files.

Project description

Jupyter Notebook Grader

This is a script that will compile a jupyter notebook with a specified structure into a python script that is pytest compatible.

For use in code, extractor handles extracting cells from a notebook with a given prefix into a TestcellBlock object. compiler deals more with taking an assignment notebook and a notebook with testcases, which can be and often are the same notebook, and with specified prefixes and writing it into a python file capable of running against pytest. For example, the prefix for assignment code could be ### ASSIGNMENT CODE for Puzzle (.*) == where the group in the regex determines what test the code applies to. Prefixes must have at least one group to match against, and that first group will be the identification used. To run as a CLI tool, use python3 -m jupyter2pytest [code file] [code prefix] [test file] [test prefix] [pytest output file].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter2pytest-0.3.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

jupyter2pytest-0.3.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file jupyter2pytest-0.3.2.tar.gz.

File metadata

  • Download URL: jupyter2pytest-0.3.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for jupyter2pytest-0.3.2.tar.gz
Algorithm Hash digest
SHA256 4dca789031ebd67678724ed50a1276dd411785f1592c9709422ff9a51801b51e
MD5 35267ecd2ed38db30d59966ee8ca61a4
BLAKE2b-256 89a6e5b7cfe687da6541ab5dd330340a7f9c50232820bbf4bdc805efb65b23f6

See more details on using hashes here.

File details

Details for the file jupyter2pytest-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter2pytest-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6cfacd155bc94ac1a99c7056b45bdb76ef446f635f7eb56b8d74ebb92f9aa62b
MD5 0d29823f0e7d5ab85ed32f64eb511452
BLAKE2b-256 95cec0663c96b84526d2e4d5d2632690c4e0460a6fb085b29bd4934faeec1917

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page