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.72.tar.gz (7.1 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.72-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.72.tar.gz
Algorithm Hash digest
SHA256 d4b5f20352d87a53da06b986f7d477963bebe3cebca2f0790e2033f1e5040112
MD5 fa0046d802a716e68226b6243d130fdc
BLAKE2b-256 6c77170d3d041ce245487635fb76642ea73755b645dc0655f8f52a505f89b124

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.72-py3-none-any.whl
Algorithm Hash digest
SHA256 8efd92f8dff52535c3990907fb59f41a80b3e5c44985137c1704a2eb851800b1
MD5 7d87f4f3f36272c7f2f55c6e8e91f8d3
BLAKE2b-256 e58fa3bb45dba164ddcff6628fd4da9f78d1e422a473677bb240e4d9d13b6924

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