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.4.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter2pytest-0.3.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jupyter2pytest-0.3.4.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jupyter2pytest-0.3.4.tar.gz
Algorithm Hash digest
SHA256 4075cbf434d2392a1e27775afc16a49d62c3f0a44757ade6e96a1941c675d13a
MD5 54baecd5b510530a4fb5b95e175f397c
BLAKE2b-256 6f1c69b51df924d3af1cc7de0074d16641d946bec88ef2874981b927e701179b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jupyter2pytest-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for jupyter2pytest-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cb10b0b407edf00fe39f2544dfdbfdf4416e629df4e32c854f84cc133f95f263
MD5 b0ee270b38e9b9a1d3af19d0faf20bc4
BLAKE2b-256 66a2a293948265e265f470887482e4bd8fe325b587ab3eec70798a65b38928ee

See more details on using hashes here.

Supported by

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