Metadata-Version: 2.5
Name: ovrin
Version: 0.1.1
Summary: Python SDK for the Ovrin agent compute cloud.
Project-URL: Homepage, https://ovrin.app
Project-URL: Repository, https://github.com/joshluberisse/OvrinPlatform
Project-URL: Documentation, https://docs.ovrin.app/sdks/python
Author: Neuromorph Systems, LLC
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: typing-extensions>=4.0
Description-Content-Type: text/markdown

# Ovrin Python SDK

Official Python client for the [Ovrin](https://ovrin.app) agent compute cloud.

```bash
pip install ovrin
```

## Quick start

```python
import ovrin

client = ovrin.Client(api_key="ovrin_...")

sandbox = client.sandboxes.create(template="python", timeout=3600)
print(sandbox.id)

result = sandbox.run("python -c 'print(2 + 2)'")
print(result.stdout)  # 4

sandbox.files.write("/workspace/hello.txt", "hi")
print(sandbox.files.read("/workspace/hello.txt"))  # hi

sandbox.kill()
```

The API key defaults to the `OVRIN_API_KEY` environment variable; the base URL defaults to `OVRIN_BASE_URL` (or `https://api.ovrin.app`).

## API surface

- `client.sandboxes.create(..., idempotency_key=None, snapshot_id=None, payments=False)` / `.list()` / `.get(id)` / `.delete(id)` / `.restore(snapshot_id)`
- `sandbox.run(command, timeout=None)` → `CommandResult(stdout, stderr, error)`
- `sandbox.stream(command)` → events as they are produced, rather than only at the end
- `sandbox.run_code(code, context_id=None)` — stateful execution; variables survive between calls
- `sandbox.pause()` / `.resume()` / `.renew(expires_at)` / `.snapshot(name=None)` — a paused sandbox bills no compute
- `sandbox.endpoint(port)` → the public URL for a port inside the sandbox
- `sandbox.files.read(path)` / `.read_bytes(path)` / `.write(path, content)` — bytes round-trip intact
- `sandbox.files.list(path, depth=1)` / `.stat(path)` / `.search(pattern)` / `.delete(path)` / `.move(src, dest)` / `.mkdir(path)`
- `client.snapshots.list()` / `.get(id)` / `.delete(id)`
- `client.templates.list()`
- `client.keys.list()` / `.create()` / `.delete(id)`
- `client.secrets.create(...)` / `.list()` / `.delete(name)`
- `client.memory.add(...)` / `.search(...)` / `.list()` / `.delete(id)`
- `client.payments.set_credentials(...)` / `.clear_credentials()` / `.credentials_status()` / `.create_customer(...)` / `.create_invoice(...)` / `.create_payment_link(...)` / `.list_customers()` / `.list_invoices()` / `.list_payment_links()`
- `client.usage.get()`

## Errors

- `ovrin.AuthenticationError` — invalid/missing API key (401)
- `ovrin.QuotaError` — plan quota exceeded (402)
- `ovrin.NotFoundError` — resource not found (404)
- `ovrin.ApiError` — other upstream errors
