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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file runno-0.1.0.tar.gz.
File metadata
- Download URL: runno-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06b325856ce48057806cfb6436d5707f34b6cf5368c4ead0cd21dded4b89096f
|
|
| MD5 |
4c6b040f8b50465006ff0378c3456ac9
|
|
| BLAKE2b-256 |
b61981efc7e97635a4890c7ebb57e45dc0c43d5ffa8a2f06bf8942e46bc25bf9
|
File details
Details for the file runno-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: runno-0.1.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 81.2 MB
- Tags: CPython 3.13, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd2685cc9338244f3efc4301d9123424d87309abc9d028ec2c621e8791e742d1
|
|
| MD5 |
2ce04a1e737f14eb5e80d082e26125e9
|
|
| BLAKE2b-256 |
2719dded85f7be54b2eb85b39b09df614edf30b6b8ed290c72441d0f1e00cee4
|
File details
Details for the file runno-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: runno-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 79.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
356698db82202c96774e81550822927aebfe42887b5a64bffd274de42ebd954b
|
|
| MD5 |
84e6112863556054c7948588a8936edf
|
|
| BLAKE2b-256 |
0c2f12d6fba1bb3f00265825157249eb5ddc9bf70ed142d3a06c30ca6c49b146
|
File details
Details for the file runno-0.1.0-cp313-cp313-macosx_15_0_x86_64.whl.
File metadata
- Download URL: runno-0.1.0-cp313-cp313-macosx_15_0_x86_64.whl
- Upload date:
- Size: 77.4 MB
- Tags: CPython 3.13, macOS 15.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ac8dcd3a95a1159c9a2dae3e588f383134a94e2e526ddfbf37444522eb5d10d
|
|
| MD5 |
610a65661f415b08f9da3b1c4ff83673
|
|
| BLAKE2b-256 |
dbbce3b85106ef30eb327bafaa73c852fc83109fcf7c74185406647144466909
|
File details
Details for the file runno-0.1.0-cp313-cp313-macosx_15_0_arm64.whl.
File metadata
- Download URL: runno-0.1.0-cp313-cp313-macosx_15_0_arm64.whl
- Upload date:
- Size: 76.9 MB
- Tags: CPython 3.13, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6740aa40f8a9a1c8bc00e4eed15e0a84f1e88613d22bfe987d80aaa99146c85
|
|
| MD5 |
d32f16cfad4df4c82551686b7eedf5cd
|
|
| BLAKE2b-256 |
3355e7a9f1a38eeabcdeab986984ad9de1d816df162dd96988114bc4103243c2
|