Metadata-Version: 2.4
Name: crownest
Version: 0.1.0
Summary: Python SDK for CrowNest cloud sandboxes.
Project-URL: Homepage, https://crownest.dev
Project-URL: Documentation, https://crownest.dev/docs
Project-URL: Repository, https://github.com/crownest-dev/crownest
Project-URL: Issues, https://github.com/crownest-dev/crownest/issues
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai-agents,code-interpreter,sandbox
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Description-Content-Type: text/markdown

# CrowNest Python SDK

Python client for CrowNest cloud sandboxes.

```bash
pip install crownest
export CROWNEST_API_KEY="cn_live_..."
```

```python
from crownest import CrowNest

with CrowNest() as client:
    sandbox = client.sandboxes.create(template="python", ttl_ms=60 * 60_000)
    sandbox.files.write(
        "/workspace/main.py",
        "from pathlib import Path\nPath('/workspace/output.txt').write_text('hello')\n",
    )
    command = sandbox.commands.run(
        "python3 /workspace/main.py",
        collect=[{"path": "/workspace/output.txt", "name": "output.txt"}],
        collect_on="success",
    )
    print(command["status"], command.get("exitCode"))
    print(sandbox.files.read("/workspace/output.txt"))
```

Async usage is available through `AsyncCrowNest`:

```python
from crownest import AsyncCrowNest

async with AsyncCrowNest() as client:
    projects = await client.projects.list()
```

The SDK reads `CROWNEST_API_KEY` by default, accepts `base_url` for local
development, accepts `timeout` for SDK-owned HTTP clients, auto-generates
`Idempotency-Key` for idempotent operations, and raises `CrowNestApiError` with
`status`, `code`, and `details` for API errors.

CrowNest uses Sandboxes for isolated execution, Commands for process
invocations, Workspace files for live working state, Artifacts for durable
outputs, and Previews for authenticated HTTP services.

The hosted CrowNest service and runtime implementation are not part of this
package.

Docs: https://crownest.dev/docs

License: Apache-2.0
