Skip to main content

A judge for your programs, run and test your programs through Python

Project description

CodeRunner 🏃

A judge 👨🏽‍⚖️ for your programs, run and test your programs through Python

PyPI Build Status codecov PyPI - Format PyPI - Python Version Documentation Status PyPI - Downloads

Installation

Install using pip from PyPI

pip install coderunner

or directly from GitHub if you cannot wait to test new features

pip install git+https://github.com/codeclassroom/CodeRunner.git

Usage

import coderunner

source_code = "path-to/test_python.py"
language = "Python"
expected_output = "path-to/output.txt"
standard_input = "path-to/input.txt"

# use this if you have a standard input to Program
r = coderunner.code(source_code, language, expected_output, standard_input)

# otherwise
r = coderunner.code(source_code, language, expected_output)

# you can also ignore both fields
r = coderunner.code(source_code, language)

# Use path=False if not using file paths
r = coderunner.code("Hello, World", language, "Hello, World", path=False)

r.run()
print(r.getOutput())
print(r.getError())
# See Documentation for more methods.

Documentation

CodeRunner Documentation

Development

Prerequisites
  • Python 3.6+
  • virtualenv
  1. Create virtual environment.
virtualenv -p python3 venv && cd venv && source bin/activate
  1. Clone the repository.
git https://github.com/codeclassroom/CodeRunner.git
  1. Install Dependencies.
pip install -r requirements.txt
  1. Run tests.
python tests.py
  1. Lint the project with
flake8 coderunner --max-line-length=88 --ignore=F401
black --check --diff coderunner

📝 Changelog

See the CHANGELOG.md file for details.

:fire: Powered By

Judge0 API - Free, robust and scalable open-source online code execution system

Author

👥 Bhupesh Varshney

forthebadge

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

👋 Contributing

Please read the CONTRIBUTING guidelines for the process of submitting pull requests to us.

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

coderunner-0.7.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

coderunner-0.7-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file coderunner-0.7.tar.gz.

File metadata

  • Download URL: coderunner-0.7.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for coderunner-0.7.tar.gz
Algorithm Hash digest
SHA256 7ab9a5b766030443cb18434571955456d921ad9f7a4b2f4cbce5285e8ca2ed84
MD5 db7a919b6dfdb326b72774173e498153
BLAKE2b-256 6db2ac05e1fcbfc1c52db97d05c936f9ef2c5d5e1ebd59417882fe3c2398893a

See more details on using hashes here.

File details

Details for the file coderunner-0.7-py3-none-any.whl.

File metadata

  • Download URL: coderunner-0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for coderunner-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 454077ee10699fb7e3c421b3d49b21b810666e232e72d8f2ccf4d113549a7504
MD5 6a04a7c2dc3e5afe2fefbb0b31fe5c0e
BLAKE2b-256 fd340c1f169f9f04d902771776c12a9f8205b2192eed03c76c768c98de1dc49b

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