Metadata-Version: 2.4
Name: gvisor
Version: 2026.11.2.0
Summary: Python bindings for gVisor.
License: Apache-2.0
Project-URL: Homepage, https://gvisor.dev
Project-URL: Bug-Tracker, https://github.com/google/gvisor/issues
Project-URL: Repository, https://github.com/google/gvisor
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Operating System Kernels
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# gVisor Python Bindings

Python bindings for [gVisor](https://github.com/google/gvisor).

## Overview

gVisor is an application kernel, written in Go, that implements a substantial
portion of the Linux system surface. It includes an Open Container Initiative
(OCI) runtime called `runsc` that provides an isolation boundary between the
application and the host kernel. The `runsc` runtime delivers strong sandbox
isolation while still allowing applications to behave as they would under
standard runtimes.

These Python bindings provide a programmable interface to interact with gVisor.

## Installation

```bash
pip install gvisor
```

The bindings run sandboxes with `runsc`, which needs the sidecar binaries that
ship with it. Install a full gVisor release from the `apt` repository or the
release tarball, as described in the
[gVisor installation guide](https://gvisor.dev/docs/user_guide/install/). The
package uses the `runsc` on your `PATH`, or the binary set in `RUNSC_PATH`.

## Quickstart

```python
from gvisor import Mount, NetworkMode, Sandbox

with Sandbox(
    network=NetworkMode.NONE,
    mounts=[Mount.tmpfs("/tmp")],
) as sb:
    stdout, _ = sb.exec("uname", "-a")
    print(stdout)

    stdout, _ = sb.exec("sh", "-c", "echo hi > /tmp/out && cat /tmp/out")
    print(stdout)
```

## Documentation

*   [Quickstart](https://gvisor.dev/docs/sdk/python/quickstart/)
*   [API reference](https://gvisor.dev/docs/sdk/python/)
*   [Examples](https://github.com/google/gvisor/tree/master/examples/sandboxexec/python)

## License

Apache License 2.0
