Skip to main content

pythonwhat

Build Status codecov PyPI version Documentation Status

Verify Python code submissions and automatic generation of meaningful feedback. Originally developed for Python exercises on DataCamp, to be used in so-called Submission Correctness Tests, but can also be used independently.

Installation

# latest stable version from PyPi
pip install pythonwhat

# latest development version from GitHub
pip install git+https://github.com/datacamp/pythonwhat

Demo

To experiment locally, you can use setup_state() and write SCTs interactively. The code throws an error when the underlying checks fail.

from pythonwhat.local import setup_state
s = setup_state(stu_code = "x = 5", sol_code = "x = 4")

s.check_object('x')
# No error: x is defined in both student and solution process

s.check_object('x').has_equal_value()
# TestFail: Check the variable `x`. Unexpected expression value: expected `4`, got `5`.

# Debugging state
s._state               # access state object
dir(s._state)          # list all attributes of the state object
s._state.student_code  # access student_code of state object

To learn how to include an SCT in a DataCamp course, visit https://authoring.datacamp.com.

Run tests

Use Python 3.5

# install packages used in tests (should be reduced)
pip install -r requirements.txt

# install pythonwhat
cd /path/to/pythonwhat
pip install -e .
pytest

To disable deprecation warnings: $ export PYTHONWARNINGS="ignore"

For more details, questions and suggestions, contact learn-engineering@datacamp.com.

Release files for pythonwhat 2.13.0

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

Source distribution (sdist)

Source distribution for pythonwhat 2.13.0
File Size Uploaded
pythonwhat-2.13.0.tar.gz 49.8 kB Details

Release files / pythonwhat-2.13.0.tar.gz

Download URL pythonwhat-2.13.0.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fd445637d4e622a761d54fd1d481dba165252672dad9bcb0ec4671da2fcf77ee
BLAKE2b-256 checksum
How to use checksums
eb2bf1a2d0bfaac8cf309c061151148b11a171b541df383452f228487a9d0c43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.30.1

2 release files

2.30.0

2 release files

2.29.0

2 release files

2.28.0

2 release files

2.27.0

2 release files

2.26.0

2 release files

2.25.0

2 release files

2.24.0

1 release file

2.23.1

1 release file

2.23.0

1 release file

2.22.0

1 release file

2.21.0

1 release file

2.20.2

1 release file

2.20.1

1 release file

2.20.0

1 release file

2.19.0

1 release file

2.18.1

1 release file

2.18.0

1 release file

2.17.1

1 release file

2.17.0

1 release file

2.16.2

1 release file

2.16.1

1 release file

2.16.0

1 release file

2.15.3

1 release file

2.15.2

1 release file

2.15.1

1 release file

2.15.0

1 release file

2.14.2

1 release file

2.14.1

1 release file

2.14.0

1 release file

2.13.2

1 release file

2.13.1

1 release file

This release

2.13.0 This release

1 release file

2.12.6

1 release file

2.12.5

1 release file

2.12.4

1 release file

2.12.3

1 release file

2.12.2

1 release file

2.12.1

1 release file

2.12.0

1 release file

2.11.1

1 release file

2.11.0

1 release file

2.10.0

1 release file

2.9.7

1 release file

2.9.6

1 release file

2.9.4

1 release file

2.7.0

1 release file

2.6.1

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