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.47.tar.gz (6.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_code_interpreter-0.1.47-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.47.tar.gz
Algorithm Hash digest
SHA256 391c9e16ef45f52c83c73952a5dcb3eb251ec5c666841367fb79d7f8494e4e54
MD5 564afcdf2a2f639724e56e7b351fcdbf
BLAKE2b-256 a3b13c1b3c51f40e5b0b17be0bba2ca52e534c4b3dae9650cb8c65f2c9a0547b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.47-py3-none-any.whl
Algorithm Hash digest
SHA256 9b17275150e2a4dc160d62886c7e5d9c70da86dc0db2bd1b2f159d98324a4856
MD5 8d7821dc92dcddb036a89d98a57937f0
BLAKE2b-256 239d451fd99c63f3e869be2abe35c5582d8ac1d6db2a493dc968e3e31ddd2c87

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