Skip to main content

RunCode Python API

This API is as simaple as send your code and getting execution result.

Install

pip install runcode

Python Example

from runcode import Runner

runner = Runner(
    api_key="",
    callback_url="",
)

runner.execute(
        code="""
print("Hello world")
start = input()
end = input()
for i in range(int(start), int(end)):
    print(i)
""",
        input="1\n10",
        compiler=Runner.python39,
    )
    

You need to provide two parameters here.
api_key - you will get it from runcode.io dashboard after loging.
callback_url - Your application URL to process execution result.
compiler - You can choose any of the available compilers from RunCode docs.

Django Example

from runcode import Runner

runner = Runner()

runner.execute(
        code="""
print("Hello world")
start = input()
end = input()
for i in range(int(start), int(end)):
    print(i)
""",
        input="1\n10",
        compiler=Runner.python39,
    )

You need to specify compiler here. compiler - You can choose any of the available compilers from RunCode docs.

You need to add two parameters to settings.py file.

RUNCODE_API_KEY - you will get it from runcode.io dashboard after loging.
RUNCODE_CALLBACK_URL - Your application URL to process execution result.

Available compilers

python39 = "python-3.9.7"
gcc49 = "gcc-4.9"
cpp49 = "g++-4.9"
openjdk11 = "openjdk-11"
dotnet5 = "dotnet-5"
python27 = "python-2.7.18"
php81 = "php-8.1"
fsharp5 = "fsharp-5"
ruby30 = "ruby-3.0.2"

For further support, contact hello@runcode.io

Metadata

Release files for runcode 0.2.1

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

Built distribution (wheel)

Table of built distributions (wheels) for runcode 0.2.1
File Interpreter ABI Platform
runcode-0.2.1-py3-none-any.whl Python 3 none any Details

Release files / runcode-0.2.1-py3-none-any.whl

Download URL runcode-0.2.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7005cb30d5eeb1f11fa7b4f8c4395090c5adef78ce3ee5df6a6a40c04321260f
BLAKE2b-256 checksum
How to use checksums
e00e18f3d70c62260e235e209e5f1d597e3b78b1a389d650dba2eb0e7d0c465b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file

0.2

2 release files

0.1

2 release files

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