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.1.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.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crownest-0.1.1.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crownest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1ba15a39d86644e6e4c082c9eefbe6e493dcc184bafdcda506ff6802f4d38834
MD5 d0e47e5ea1f08efc0d12b120b8063cf7
BLAKE2b-256 6ade7bb2bee760e0b05440c5be81e22b2aba753eb1f936fb8d262339312e8f5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for crownest-0.1.1.tar.gz:

Publisher: release.yml on crownest-dev/crownest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: crownest-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for crownest-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c6f1186608df63c6644aff4999b726c582f9a1ddace439b9b8710c1f6959c99
MD5 b69ce44d5d62421bb68f1819326298be
BLAKE2b-256 06b34090ceded7002bb91ef17d32b995a38f750a92b52e0a64fb06bb490473c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crownest-0.1.1-py3-none-any.whl:

Publisher: release.yml on crownest-dev/crownest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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