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.71.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.71-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.71.tar.gz
Algorithm Hash digest
SHA256 53b330faa0bb91c7c3201d5f36cf78041d959fdf23377151c6b5ebed8732e61c
MD5 43ab1c9ca9baa226a28e0abd7ac323c5
BLAKE2b-256 e061b57a73ad315b99d5dee2a2a5b457d67146713654ba3c69d7b5f53915b5b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for watasu_code_interpreter-0.1.71-py3-none-any.whl
Algorithm Hash digest
SHA256 e436249bd69fce8502529344dec00d03bc0afe89b51b0d465e69ab2dffeab1b8
MD5 19bb0213e1e9e915cdf962e9dfc63a69
BLAKE2b-256 4ec888871660a5a1cb75ed1c9eb78e917a25700b8cdbac0b2975a392ef75149b

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