Skip to main content

Novita Agent Sandbox SDK for Python

A Python SDK for Novita Agent Sandbox environments that provides code execution, desktop automation, and cloud computing capabilities..

📖 Documentation • 🔑 Get API Key

Features

  • Code Interpreter: Execute Python, JavaScript, and other languages in isolated environments
  • Desktop Automation: Control desktop applications and GUI interactions
  • Cloud Computing: Scalable sandbox environments for various computing tasks
  • Data Visualization: Built-in charting and visualization capabilities
  • File System Operations: Complete file system management and monitoring

Installation

pip install novita-sandbox
pip install novita-sandbox[runtime]
pip install novita-sandbox[code-interpreter]
pip install novita-sandbox[desktop]
pip install novita-sandbox[all]

runtime is for users who only need Agent Runtime-related features; all includes every optional dependency.

Quick Start

Authentication

Get your Novita API key from the key management page.

Core Sandbox

Use the high-level Novita client to share one set of credentials across namespaces.

import os
from novita_sandbox import Novita

novita = Novita(api_key=os.getenv("NOVITA_API_KEY", ""))

# Using the official template `base` by default
sandbox = novita.sandbox.create("base")

# File operations
sandbox.files.write('/tmp/test.txt', 'Hello, World!')
content = sandbox.files.read('/tmp/test.txt')

# Command execution
result = sandbox.commands.run('ls -la /tmp')
print(result.stdout)

sandbox.kill()

Code Interpreter

The Code Interpreter sandbox is available through the same client.

import os
from novita_sandbox import Novita

novita = Novita(api_key=os.getenv("NOVITA_API_KEY", ""))

sandbox = novita.code_interpreter.create()

# Execute Python code
result = sandbox.run_code('print("Hello, World!")')
print(result.logs)

sandbox.kill()

Desktop Automation

The Desktop sandbox is available through the same client.

import os
from novita_sandbox import Novita

novita = Novita(api_key=os.getenv("NOVITA_API_KEY", ""))

desktop = novita.desktop.create()

# Take a screenshot
screenshot = desktop.screenshot()

# Automate mouse and keyboard
desktop.left_click(100, 200)
desktop.press('Return')
desktop.write('Hello, World!')

desktop.kill()

Documentation

For comprehensive guides, API references, and examples, visit our official documentation.

Development

Install

poetry install --with dev --extras "all" 

Test

make test
make test-core
make test-code-interpreter
make test-desktop

Metadata

Release files for novita-sandbox 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novita-sandbox 2.1.1
File Size Uploaded
novita_sandbox-2.1.1.tar.gz 529.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for novita-sandbox 2.1.1
File Interpreter ABI Platform
novita_sandbox-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / novita_sandbox-2.1.1.tar.gz

Download URL novita_sandbox-2.1.1.tar.gz
Size 529.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cf9ab8c9fe35953ec00324f68b03ad8dd8a5a0475235c1857c1eb96e784e2b98
BLAKE2b-256 checksum
How to use checksums
506379f1254e806215ae2c3a6db403fc6ca803c05f170d27ca1fa64bc6a827e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.14 Linux/6.17.0-1022-azure

Release files / novita_sandbox-2.1.1-py3-none-any.whl

Download URL novita_sandbox-2.1.1-py3-none-any.whl
Size 660.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36123f0c0c040bdcd0f3ab814692e088d7ce79a9dcfe9564a9a860caebeaaa5c
BLAKE2b-256 checksum
How to use checksums
ce2b962cfc5d398711b52863ca8d14ece59bb70fa615a04cbd1880361b76c036
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.12.14 Linux/6.17.0-1022-azure

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page