CO
codeclassroom/CodeRunner
A judge ๐จ๐ฝโโ๏ธ for your programs, run and test your programs using python
CodeRunner ๐
A judge ๐จ๐ฝโโ๏ธ for your programs, run and test your programs using Python
Installation
Install using pip from PyPI
pip install coderunneror directly from GitHub if you cannot wait to test new features
pip install git+https://github.com/codeclassroom/CodeRunner.gitUsage
from coderunner import coderunner
import os
from dotenv import load_dotenv
load_dotenv()
source_code = "testfiles/" + "test_python_input.py"
language = "Python3"
output = "testfiles/output/" + "output2.txt"
Input = "testfiles/input/" + "input.txt"
API_KEY = os.environ["API_KEY"]
r = coderunner.code(source_code, language, output, Input)
# Necessary step to initialize API keys & URL
r.api(key=API_KEY)
# run the code
r.run()
print("Running r :")
print("Status : " + r.getStatus())
print("Output : " + r.getOutput())
# See Documentation for more methods.Documentation
Development
Prerequisites
- Python 3.6+
- virtualenv
- Create virtual environment.
virtualenv -p python3 venv && cd venv && source bin/activate- Clone the repository.
git https://github.com/codeclassroom/CodeRunner.git- Install Dependencies.
pip install -r requirements.txt- Run tests.
python tests.py- Lint the project with
flake8 coderunner --max-line-length=88 --ignore=F401
black --check --diff coderunner๐ Changelog
See the CHANGELOG.md file for details.
๐ฅ Powered By
Judge0 API - Free, robust and scalable open-source online code execution system
Author
๐ฅ Bhupesh Varshney
- Twitter: @bhupeshimself
- DEV: bhupesh
๐ 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.
On this page
Languages
Python85.9%Java4.7%C++3.8%Shell3.3%C2.2%
MIT License
Created July 13, 2019
Updated July 26, 2025