Metadata-Version: 2.4
Name: syva
Version: 0.2.1
Summary: Python SDK for Syva sandboxes
Author: Syva
License-Expression: MIT
Keywords: syva,sandbox,code-execution
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Syva Python SDK

Install:

```bash
pip install syva
```

Use:

```python
from syva import Image, Sandbox

image = Image("base").python("3.12").pip_install("requests")
sandbox = Sandbox.create(image=image)
result = sandbox.process.exec("python3 --version")
print(result.stdout)
sandbox.destroy()
```

Persistent sandboxes snapshot their filesystem when stopped and resume where
they left off. Give a sandbox a name and reconnect to it from anywhere:

```python
from syva import Sandbox

sandbox = Sandbox.get_or_create(name="agent-workspace", image="python-3.12:base")
sandbox.run_command("pip install requests")

sandbox.stop()        # snapshots the filesystem, stops billing compute
sandbox.start()       # boots a new session from the snapshot

fork = sandbox.fork(name="agent-workspace-copy")  # new sandbox, same state
```

Snapshots are billed at $0.08/GiB-month on the compressed delta. Every
snapshot is kept until it expires (30 days after last use by default). Pass
`persistent=False` to `Sandbox.create` for throwaway sandboxes, bound storage
with `keep_last_snapshots={"count": 1}`, or tune settings later with
`sandbox.update(...)` — including rolling back via `current_snapshot_id`.

Set `SYVA_API_KEY` for the hosted API. Set `SYVA_API_URL` to point the SDK at a
local or self-hosted control plane.
