Skip to main content

Run untrusted code inside the Runno WebAssembly sandbox.

Project description

runno

Package for running code inside the Runno WebAssembly sandbox.

Quickstart

The run_code method allows you to run a snippet of code.

from runno import run_code

code = "print('Hello, World!')"
result = await run_code("python", code)

if result.result_type == "complete":
    print("OUTPUT:")
    print(result.tty)
else:
    print("ERROR")

Available runtimes are: python, quickjs, sqlite, clang, clangpp, ruby, and php-cgi.

Including Files

If you want to process files within your sandbox, you can include them in the file system by using the run_fs method.

from runno import run_code, WASIFS, StringFile
fs: WASIFS = {
    "/program.py": StringFile(
        path="/program.py",
        timestamps=WASITimestamps(
            access=datetime.now(),
            modification=datetime.now(),
            change=datetime.now(),
        ),
        mode="string",
        content="""
print(open('data.csv'))
""",
    ),
    "/data.csv": StringFile(
        path="/data.csv",
        timestamps=WASITimestamps(
            access=datetime.now(),
            modification=datetime.now(),
            change=datetime.now(),
        ),
        mode="string",
        content="""
a,b,c
1,2,3
""",
    )
}

await run_fs(runtime, "/program", fs)

Including Dependencies

You can use the same technique to include pure python packages as dependencies. The interface for this is not super nice right now, but it's on the way.

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

runno-0.1.2.tar.gz (47.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

runno-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (81.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

runno-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl (79.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

runno-0.1.2-cp313-cp313-macosx_15_0_x86_64.whl (77.4 MB view details)

Uploaded CPython 3.13macOS 15.0+ x86-64

runno-0.1.2-cp313-cp313-macosx_15_0_arm64.whl (76.9 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

File details

Details for the file runno-0.1.2.tar.gz.

File metadata

  • Download URL: runno-0.1.2.tar.gz
  • Upload date:
  • Size: 47.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for runno-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4e77db3edf80d4ae1c8de08e754ede2cf98eb060f677bf33b79095435092dedb
MD5 3fd6857a97c356fca14e5aec4e32c6ea
BLAKE2b-256 14a463a75e3db49fd74c2190aabb4ef5b3d46ab2bead511e857423b3f053534c

See more details on using hashes here.

File details

Details for the file runno-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for runno-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 51a9c3ec24fa989991c0c275520e2c7b6b8a83f29baf969fa70b54cc4948da65
MD5 1ace4b029369e371e716733148c55b40
BLAKE2b-256 999c02f11b18838bf215dd8ac7f3005a3a3bb84f62639b5b170c4bf882d0f54c

See more details on using hashes here.

File details

Details for the file runno-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for runno-0.1.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b5299d4c1c59b38d95c1d35cf6d9a2df2caec73cbc207ab439f72a3fe96e1275
MD5 ef321b57fd80917ca68a597d0eb8af70
BLAKE2b-256 72e228e6037d319e57436c47926313aeb15e96901ede59096d2b9e2f8c95bbd7

See more details on using hashes here.

File details

Details for the file runno-0.1.2-cp313-cp313-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for runno-0.1.2-cp313-cp313-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d31f44c95ee8280ec04705081b6f377a71bcb84648d0bf1f26652421d4ca15c4
MD5 820a3ea20dd79b9c861d7f0e868771a3
BLAKE2b-256 747bfbd2c149e913a1750634492fa4d90334473992f0d1840e260871df965661

See more details on using hashes here.

File details

Details for the file runno-0.1.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for runno-0.1.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4cc1773f1a949706ea5b3043b6fc0f1161086cdbdd5159d27f09415a343b9a43
MD5 9cf6023a22b63293edbe7049df142955
BLAKE2b-256 98238411e0b629a508af8cf2d95d39cf83ba61a2886a69ca235bdb93eabdc45e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page