Skip to main content

Typed Python SDK for the Islo sandbox platform

Project description

Islo Python SDK

Typed Python SDK for the Islo sandbox platform. Create, manage, and execute code in isolated VM-based sandboxes.

Installation

pip install islo

Quick Start

from islo import Islo

# Automatically reads ISLO_API_KEY from environment
client = Islo()

# Create a sandbox
sandbox = client.sandboxes.create_sandbox(
    name="my-sandbox",
    image="ubuntu:22.04",
    vcpus=2,
    memory_mb=4096,
)

# Execute a command
result = client.sandboxes.exec_in_sandbox(
    sandbox_name=sandbox.name,
    command=["echo", "hello world"],
)
print(result.exit_code)

# Clean up
client.sandboxes.delete_sandbox(sandbox_name=sandbox.name)

Authentication

Environment variable (recommended)

export ISLO_API_KEY="your-api-key"
client = Islo()  # Picks up ISLO_API_KEY automatically

Explicit token

client = Islo(token="your-api-key")

Auto-refreshing token provider

from islo import Islo
from islo.custom import SyncTokenProvider

provider = SyncTokenProvider(
    base_url="https://api.islo.dev",
    access_key="your-access-key",
)
client = Islo(token=provider)

Configuration

Environment Variable Description Default
ISLO_API_KEY Bearer token for authentication
ISLO_BASE_URL API base URL https://api.islo.dev

Async Support

import asyncio
from islo import AsyncIslo

async def main():
    client = AsyncIslo()
    sandboxes = await client.sandboxes.list_sandboxes()
    print(f"Found {len(sandboxes.items)} sandboxes")

asyncio.run(main())

Development

# Install dependencies
uv sync --dev

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check .
uv run ruff format --check .

Regenerating the SDK

The SDK is generated from the Islo API's OpenAPI spec using Fern:

# Export fresh OpenAPI spec from islo-web-api
cd ../islo-web-api
uv run python -c "import json; from src.api import app; json.dump(app.openapi(), open('../islo-sdk/fern/openapi/openapi.json', 'w'), indent=2)"

# Regenerate
cd ../islo-sdk
fern generate --group python-sdk

# Run tests to verify
uv run pytest tests/ -v

Custom code in src/islo/client.py and src/islo/custom/ is preserved across regenerations via .fernignore.

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

islo-0.2.1.tar.gz (64.2 kB view details)

Uploaded Source

Built Distribution

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

islo-0.2.1-py3-none-any.whl (99.6 kB view details)

Uploaded Python 3

File details

Details for the file islo-0.2.1.tar.gz.

File metadata

  • Download URL: islo-0.2.1.tar.gz
  • Upload date:
  • Size: 64.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for islo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c9a418887a4cb048a26cd2dae2caaf090fb9fde2ae0b74e7190c61aade3ce2c4
MD5 b411382ee0f11e0ac87600545c99307e
BLAKE2b-256 adbb144a15e019d24c05914af324b2d26356ed0c28b54f1854c8cfe3d7cc65fb

See more details on using hashes here.

File details

Details for the file islo-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: islo-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for islo-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d449559e2cbbc95f1d4211f67374b88c70a443f9045b1b5386b38fe4072a01c
MD5 7bddb57e13c8f95685e610b4abd1e01b
BLAKE2b-256 89a2089e3752d795a1cfd53f8ce5d8e0fecf592db52f75e7d7bafaf9b0c649d9

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