Skip to main content

Python SDK for CrowNest cloud sandboxes.

Project description

CrowNest Python SDK

Python client for CrowNest cloud sandboxes.

pip install crownest
export CROWNEST_API_KEY="cn_live_..."
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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crownest-0.1.0.tar.gz (26.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crownest-0.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file crownest-0.1.0.tar.gz.

File metadata

  • Download URL: crownest-0.1.0.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crownest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c93548b988215c41d338d8a2a5c56364a1d604ea7848abb146e44726abd7122
MD5 a72a1ea79de584ea5a8016cc6144e43a
BLAKE2b-256 41bf4a985fabf03fdadf4fb502cd6c185f6754b1272018c3bb520ecccc6f1300

See more details on using hashes here.

File details

Details for the file crownest-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crownest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for crownest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3756bdbb314e38b2c7a9a82bbf2680faf05c829796cd1a5dfb34197d78aba4d
MD5 2e569bed945c9caba5896d4994533d2f
BLAKE2b-256 d5ccfc0138921ca7c9a8c01e86ce7b58117b14d983af73b73b02f10e9db308ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page