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.4.tar.gz (59.6 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.4-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: watasu-0.1.4.tar.gz
  • Upload date:
  • Size: 59.6 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.4.tar.gz
Algorithm Hash digest
SHA256 716358157725aaefbfa1a5f21e5cc57d1ad4a08c730af5788b5c87ac097c5300
MD5 a1f31ab41885ae8f7598f25e3f22b598
BLAKE2b-256 5b17c08bd4f18ce72a936edab8cb5d7b3bee28cfd1a8e435dc483e22b5309c5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: watasu-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 30.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9c36065091dc7a009aab286239b465d3c010b30398f55bc3b589e9d9ef2a3746
MD5 4047e42e192bf9d0ad077d13f89bf688
BLAKE2b-256 a22db6a37e135b43baeaee9e62b39ae4fdce3318abdf63acd7e3664deb1eb1b7

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