Skip to main content

Code Interpreter SDK for Watasu

Project description

Watasu Code Interpreter Python SDK

Python package for Watasu code interpreter sandboxes.

Install

pip install watasu-code-interpreter

Set WATASU_API_KEY before using the SDK.

Usage

from watasu_code_interpreter import Sandbox

with Sandbox.create() as sbx:
    context = sbx.create_code_context()
    execution = sbx.run_code(
        "print('hello')\n2 + 3",
        context=context,
        on_stdout=lambda message: print(message.line),
    )

    print(execution.text)
    sbx.remove_code_context(context)

Sandbox.create() starts the code-interpreter template by default. Code runs in persistent contexts and returns structured results, logs, and error fields for each execution.

The package installs watasu and exposes the watasu_code_interpreter import path.

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_code_interpreter-0.1.51.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

watasu_code_interpreter-0.1.51-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file watasu_code_interpreter-0.1.51.tar.gz.

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.51.tar.gz
Algorithm Hash digest
SHA256 978b4a334b9ff34508b996959fa90e2f54f96235c6ab26bbcd339d1158664359
MD5 bc588d6b1c674b7be4fd1c2ceca0558a
BLAKE2b-256 f4e2b5a8c29291ebf005a42f219f72595ce736136ab2e9b55deef36ae8ad4c32

See more details on using hashes here.

File details

Details for the file watasu_code_interpreter-0.1.51-py3-none-any.whl.

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.51-py3-none-any.whl
Algorithm Hash digest
SHA256 62ae22c61088031b3d6e13dc84dd1a66a5428b2474791a6b1cce12e1c033b17c
MD5 2e4056ac199a586c3b34a1ce868e9c5e
BLAKE2b-256 4436c394994224033b441fe37a55b74c7fa340438eb22af163687a8eda45cf24

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