A Python client library for CoreWeave Sandboxes (CWSandboxes), offering a programmatic interface to manage sandboxed environments for secure execution of workloads on the CoreWeave platform. It is currently at version 0.16.0 and maintains an active release cadence with frequent updates.
pip install cwsandboxVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create and run a simple command within a CoreWeave Sandbox using the `cwsandbox` client library. It highlights the use of `Sandbox.run` to initiate a sandbox and `sb.stop().result()` to wait for its completion and retrieve the output. Authentication typically relies on environment variables or a configured CoreWeave client.
Ensure `COREWEAVE_API_KEY` and `COREWEAVE_PROJECT_ID` (or equivalent CoreWeave client configuration) are correctly set in your environment before using the library. Refer to CoreWeave's official authentication documentation for details.
Understand that `cwsandbox` is an API client for managing remote execution environments provided by CoreWeave. If you need to sandbox Python code locally, consider dedicated Python sandboxing tools or OS-level isolation (e.g., containers).
Always ensure that `sb.stop()` is called for any `Sandbox` instance you create, ideally within a `try...finally` block or by using a context manager if available, to guarantee resource cleanup.
For robust asynchronous applications, consult the official documentation (if available) for native async methods (e.g., `await Sandbox.arun()`, `await sb.astop()`) to avoid blocking the event loop. For synchronous applications, ensure you understand where blocking operations occur.
Install the library using pip: `pip install cwsandbox`
Set the `COREWEAVE_API_KEY` and `COREWEAVE_PROJECT_ID` environment variables with your valid CoreWeave credentials before running your application.
Always ensure `sb.stop()` is called on your `Sandbox` instance. Consider using a `try...finally` block or an `async with` context manager for automatic cleanup: `with Sandbox.run(...) as sb: ...` or `async with Sandbox.run(...) as sb: ...`.
Verify your internet connectivity, check the CoreWeave platform's status, and ensure your `cwsandbox` configuration points to the correct API endpoint.
No dependency data recorded yet.