Skip to main content

Python SDK for Watasu

Project description

Watasu Python SDK

Python SDK for Watasu.

Install

pip install watasu

Set WATASU_API_KEY before using the SDK.

Usage

from watasu import Sandbox

sbx = Sandbox()
sbx.files.write("/home/user/a.py", "print(2 + 2)")
result = sbx.commands.run("python /home/user/a.py")
print(result.stdout)
sbx.kill()

Sandbox(), Sandbox.create, and Sandbox.connect return only after the Watasu API supplies a usable data-plane session. The SDK does not poll sandbox readiness.

from watasu import Sandbox

with Sandbox.create() as sbx:
    result = sbx.commands.run("echo hello")
    print(result.stdout)

Leaving the context manager calls kill().

Async API

from watasu import AsyncSandbox


async def main() -> None:
    sbx = await AsyncSandbox.create()
    await sbx.kill()

Unsupported compatibility surfaces raise explicit not-implemented errors instead of silently falling back to client-side polling.

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

watasu-0.1.3.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

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

watasu-0.1.3-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file watasu-0.1.3.tar.gz.

File metadata

  • Download URL: watasu-0.1.3.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for watasu-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8ca0e550ca32328609ded76b9c7e9ed5ce74873a2646eb943afe7fbfc19e1389
MD5 3dcfd7894acb81c9974a3c781f0f9591
BLAKE2b-256 08120c6219c218e194462b8fab0d67057d975830849d6283e408bedbb3b2a0c0

See more details on using hashes here.

File details

Details for the file watasu-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: watasu-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for watasu-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3226fe1de066c32a7338982d5aeda3a04af213e26e426658ed649c0a48ece6b9
MD5 798af15b7004a154a5af67df8d39ca23
BLAKE2b-256 15cb4b044c76ea61d9683c91a69d00e83f7d81a384dbbbd1b8f4b92b83bedc33

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