Skip to main content

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

cvisor-0.1.0.tar.gz (582.4 kB view details)

Uploaded Source

Built Distributions

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

cvisor-0.1.0-py3-none-musllinux_1_2_x86_64.whl (295.8 kB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

cvisor-0.1.0-py3-none-musllinux_1_2_aarch64.whl (276.7 kB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

cvisor-0.1.0-py3-none-any.whl (568.0 kB view details)

Uploaded Python 3

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

Hashes for cvisor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45f5bee1659b3cf24cadd6a0407b0cf827c1ea66407ad091b81070563713153d
MD5 be605ad841ce66e5793ad8072f8b8ff0
BLAKE2b-256 acedb883f79147dffc3c98798865711344b8510b4bb30711397db7ed89066f71

See more details on using hashes here.

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

Hashes for cvisor-0.1.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 479609dc4928bd11709d28185ae686800cc3b054fcf0a67a7dc8b1d49c14a7ce
MD5 e511272e9592c81cc0806d0c69c092cb
BLAKE2b-256 0c921ba20d874cb5057975a0a65c482343adabcfac0069ff2f094979289d6e85

See more details on using hashes here.

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

Hashes for cvisor-0.1.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 11033e61befa0847d692cdbdec1767353d173b4944631c88b44b26dec0b73ae5
MD5 5f10cbe687877fe329c0ec6e0947ca3b
BLAKE2b-256 97d1f5a8f555f0ad38267befb7c2b77ef66f95f8cc12cea16ba31c60e5a1b8ee

See more details on using hashes here.

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

Hashes for cvisor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d2f0c2a4050ec611cb922e7e71f9af07796ebfdfcd7426b437029db8a31131a
MD5 566bc6073211f46258eb3c70cb0e0409
BLAKE2b-256 b507cf7e857484cecdf5fbd6bab176431eb07a9b6dca3b56ba6df7f19dec6232

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

4 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