cVisor — Python SDK
A ctypes FFI wrapper over the libcvisor C ABI. Linux-only.
Install (uv)
uv add cvisor
Usage
from cvisor import Sandbox
with Sandbox() as sb:
out = sb.run("echo hello")
print(out.stdout) # "hello\n"
print(out.stderr) # ""
Sandbox.run(cmd) blocks until the sandboxed command exits and returns an
Output with .stdout / .stderr (str) and .stdout_bytes / .stderr_bytes.
Interactive console
Launch an IPython REPL with a live sandbox preloaded:
uv run --extra console cvisor # or: python -m cvisor
cVisor interactive console
sb -> a Sandbox instance
sh("cmd") -> run a shell command in the sandbox, printing stdout/stderr
Sandbox -> create your own: Sandbox()
In [1]: sh("echo hello; uname -n")
hello
cvisor
Without the console extra (IPython) it falls back to the stdlib REPL.
Development
The SDK loads libcvisor.so. Build it from the repo root and point the SDK at
it via the CVISOR_LIB environment variable, or let the package resolve a copy
bundled under cvisor/_native/:
# from the repo root — builds libcvisor.so into cvisor/_native/
cargo xtask ffi
# run the tests with uv
cd sdks/python
uv run pytest
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 cvisor-0.1.0.tar.gz.
File metadata
- Download URL: cvisor-0.1.0.tar.gz
- Upload date:
- Size: 582.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45f5bee1659b3cf24cadd6a0407b0cf827c1ea66407ad091b81070563713153d
|
|
| MD5 |
be605ad841ce66e5793ad8072f8b8ff0
|
|
| BLAKE2b-256 |
acedb883f79147dffc3c98798865711344b8510b4bb30711397db7ed89066f71
|
File details
Details for the file cvisor-0.1.0-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: cvisor-0.1.0-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 295.8 kB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
479609dc4928bd11709d28185ae686800cc3b054fcf0a67a7dc8b1d49c14a7ce
|
|
| MD5 |
e511272e9592c81cc0806d0c69c092cb
|
|
| BLAKE2b-256 |
0c921ba20d874cb5057975a0a65c482343adabcfac0069ff2f094979289d6e85
|
File details
Details for the file cvisor-0.1.0-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: cvisor-0.1.0-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 276.7 kB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11033e61befa0847d692cdbdec1767353d173b4944631c88b44b26dec0b73ae5
|
|
| MD5 |
5f10cbe687877fe329c0ec6e0947ca3b
|
|
| BLAKE2b-256 |
97d1f5a8f555f0ad38267befb7c2b77ef66f95f8cc12cea16ba31c60e5a1b8ee
|
File details
Details for the file cvisor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cvisor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 568.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d2f0c2a4050ec611cb922e7e71f9af07796ebfdfcd7426b437029db8a31131a
|
|
| MD5 |
566bc6073211f46258eb3c70cb0e0409
|
|
| BLAKE2b-256 |
b507cf7e857484cecdf5fbd6bab176431eb07a9b6dca3b56ba6df7f19dec6232
|