This release is a pre-release and may not be stable for production use.
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.1a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| novita_sandbox-2.1.1a1.tar.gz | 530.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| novita_sandbox-2.1.1a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.2 MB
Release files / novita_sandbox-2.1.1a1.tar.gz
| Download URL | novita_sandbox-2.1.1a1.tar.gz |
|---|---|
| Size | 530.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
278b78d92821178bd0f2eab6e73490300e28e8b347603617a46942b388a12be5
|
|
BLAKE2b-256 checksum How to use checksums |
b26a8615dd3679c1d0de05bbf60a4b80f3b78506a1016630418a04cd261c7493
|
| 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.1a1-py3-none-any.whl
| Download URL | novita_sandbox-2.1.1a1-py3-none-any.whl |
|---|---|
| Size | 660.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c96752ae63f6ecccf396c05d6c4de509f0f0c4a7b8a8ae9069e5d0b62b52453c
|
|
BLAKE2b-256 checksum How to use checksums |
a87a4db82c742fb32032266b9d34f3cbf16a0b6215b0e3a0104871a5cf93a627
|
| 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
|