Skip to content

Commit f84965b

Browse files
committed
ready for merge
1 parent 862e9eb commit f84965b

File tree

6 files changed

+46
-51
lines changed

6 files changed

+46
-51
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
1010
- Custom API URL support
1111

1212
### Changed
13-
- Due to Judge0 API going [freemium](https://github.com/judge0/api/issues/171), the default API URL, [https://api.judge0.com] is no longer available. To use the API signup for a plan on [RapidAPI](https://rapidapi.com/hermanzdosilovic/api/judge0/pricing)
13+
- Due to Judge0 API going [freemium](https://github.com/judge0/api/issues/171), the default API URL, [https://api.judge0.com] is no longer available. To use the API signup for a plan on [RapidAPI](https://rapidapi.com/hermanzdosilovic/api/judge0/pricing) & use the token to access the API through coderunner.
1414

1515

1616
## [0.8] - May 27, 2020

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,32 @@ pip install git+https://github.com/codeclassroom/CodeRunner.git
3030

3131
```python
3232

33-
import coderunner
33+
from coderunner import coderunner
34+
import os
3435

35-
source_code = "path-to/test_python.py"
36-
language = "Python"
37-
expected_output = "path-to/output.txt"
38-
standard_input = "path-to/input.txt"
36+
from dotenv import load_dotenv
37+
load_dotenv()
3938

40-
# use this if you have a standard input to Program
41-
r = coderunner.code(source_code, language, expected_output, standard_input)
39+
source_code = "testfiles/" + "test_python_input.py"
40+
language = "Python3"
41+
output = "testfiles/output/" + "output2.txt"
42+
Input = "testfiles/input/" + "input.txt"
4243

43-
# otherwise
44-
r = coderunner.code(source_code, language, expected_output)
4544

46-
# you can also ignore both fields
47-
r = coderunner.code(source_code, language)
45+
API_KEY = os.environ["API_KEY"]
4846

49-
# Use path=False if not using file paths
50-
r = coderunner.code("Hello, World", language, "Hello, World", path=False)
47+
r = coderunner.code(source_code, language, output, Input)
5148

49+
# Necessary step to initialize API keys & URL
50+
r.api(key=API_KEY)
51+
52+
# run the code
5253
r.run()
53-
print(r.getOutput())
54-
print(r.getError())
54+
55+
print("Running r :")
56+
print("Status : " + r.getStatus())
57+
print("Output : " + r.getOutput())
58+
5559
# See Documentation for more methods.
5660
```
5761

demo.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
11
from coderunner import coderunner
2-
import pprint
32
import os
43

54
from dotenv import load_dotenv
6-
75
load_dotenv()
86

97
source_code = "testfiles/" + "test_python_input.py"
108
language = "Python3"
119
output = "testfiles/output/" + "output2.txt"
1210
Input = "testfiles/input/" + "input.txt"
1311

14-
1512
API_KEY = os.environ["API_KEY"]
1613

1714
r = coderunner.code(source_code, language, output, Input)
1815

1916
# Necessary step to initialize API keys & URL
2017
r.api(key=API_KEY)
2118

22-
# r2 = coderunner.code("print(\"yo\")", "Python3", "YO", path=False)
23-
24-
# # run the code
19+
# run the code
2520
r.run()
2621

27-
print("Run r :")
22+
print("Running r :")
2823
print("Status : " + r.getStatus())
2924
print("Output : " + r.getOutput())
30-
31-
# r2.run()
32-
33-
# print("Run r2 :")
34-
# print("Status : " + r2.getStatus())
35-
36-
# # check if any error occured
37-
# if r.getError() is not None:
38-
# pprint.pprint("Error : " + r.getError())
39-
# else:
40-
# print("Standard Output : ")
41-
# pprint.pprint(r.getOutput())
42-
# print("Execution Time : " + r.getTime())
43-
# print("Memory : " + str(r.getMemory()))

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
1010
- Custom API URL support
1111

1212
### Changed
13-
- Due to Judge0 API going [freemium](https://github.com/judge0/api/issues/171), the default API URL, [https://api.judge0.com] is no longer available. To use the API signup for a plan on [RapidAPI](https://rapidapi.com/hermanzdosilovic/api/judge0/pricing)
13+
- Due to Judge0 API going [freemium](https://github.com/judge0/api/issues/171), the default API URL, [https://api.judge0.com] is no longer available. To use the API signup for a plan on [RapidAPI](https://rapidapi.com/hermanzdosilovic/api/judge0/pricing) & use the token to access the API through coderunner.
1414

1515

1616
## [0.8] - May 27, 2020

docs/index.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,31 @@ pip install git+https://github.com/codeclassroom/CodeRunner.git
3030

3131
```python
3232

33-
import coderunner
33+
from coderunner import coderunner
34+
import os
3435

35-
source_code = "path-to/test_python.py"
36-
language = "Python"
37-
expected_output = "path-to/output.txt"
38-
standard_input = "path-to/input.txt"
36+
from dotenv import load_dotenv
37+
load_dotenv()
3938

40-
# use this if you have a standard input to Program
41-
r = coderunner.code(source_code, language, expected_output, standard_input)
39+
source_code = "testfiles/" + "test_python_input.py"
40+
language = "Python3"
41+
output = "testfiles/output/" + "output2.txt"
42+
Input = "testfiles/input/" + "input.txt"
4243

43-
# otherwise
44-
r = coderunner.code(source_code, language, expected_output)
4544

46-
# Use path=False if not using file paths
47-
r = coderunner.code("Hello, World", language, "Hello, World", path=False)
45+
API_KEY = os.environ["API_KEY"]
46+
47+
r = coderunner.code(source_code, language, output, Input)
48+
49+
# Necessary step to initialize API keys & URL
50+
r.api(key=API_KEY)
51+
52+
# run the code
53+
r.run()
54+
55+
print("Running r :")
56+
print("Status : " + r.getStatus())
57+
print("Output : " + r.getOutput())
4858
```
4959

5060
## Documentation

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
license="MIT",
1010
author="Bhupesh Varshney",
1111
author_email="varshneybhupesh@gmail.com",
12-
description="A judge for your programs, run and test your programs using Python",
13-
keywords="judge0 coderunner judge0api codeclassroom ",
12+
description="A judge for your programs, run and test your programs using python",
13+
keywords="judge0 coderunner judge0api codeclassroom",
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",
1616
url="https://codeclassroom.github.io/CodeRunner/",

0 commit comments

Comments
 (0)