Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PPIO Sandbox SDK for Python

Python SDK for PPIO Sandbox environments, providing code execution, desktop automation, and cloud computing capabilities, which is compatible with e2b.

Please read the documentation for more information.

Installation

pip install ppio-sandbox

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

Quick Start

Authentication

You can get the PPIO API key by refer to this documentation.

Core

The basic package provides a way to interact with the sandbox environment.

from ppio_sandbox.core import Sandbox
import os

# Using the official template `base` by default
sandbox = Sandbox.create(
    template="base",
    api_key=os.getenv("PPIO_API_KEY", "")
)

# 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 provides a Jupyter-like environment for executing code using the official code-interpreter-v1 template.

from ppio_sandbox.code_interpreter import Sandbox
import os

sandbox = Sandbox.create(
    api_key=os.getenv("PPIO_API_KEY", "")
)

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

sandbox.kill()

Desktop

The Desktop sandbox allows you to control desktop environments programmatically using the official desktop template.

from ppio_sandbox.desktop import Sandbox
import os

desktop = Sandbox.create(
    api_key=os.getenv("PPIO_API_KEY", "")
)

# Take a screenshot
screenshot = desktop.screenshot()

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

desktop.kill()

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 ppio-sandbox 2.1.0a1

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

Source distribution (sdist)

Source distribution for ppio-sandbox 2.1.0a1
File Size Uploaded
ppio_sandbox-2.1.0a1.tar.gz 529.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ppio-sandbox 2.1.0a1
File Interpreter ABI Platform
ppio_sandbox-2.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / ppio_sandbox-2.1.0a1.tar.gz

Download URL ppio_sandbox-2.1.0a1.tar.gz
Size 529.6 kB
Tags Source
SHA-256 checksum
How to use checksums
028e16c2718a1a40885382a73e6d5d36bfef116f5a402d03dc0b251aa784f50f
BLAKE2b-256 checksum
How to use checksums
0e5e0c893feeae0c812473035c9a7a18f7f4ab5bccade4a66da4c81f7697485b
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 / ppio_sandbox-2.1.0a1-py3-none-any.whl

Download URL ppio_sandbox-2.1.0a1-py3-none-any.whl
Size 643.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1c48940a73e19a04d4b7c1537cf57c2884c2e6f5a7dc5fdbe1c9792ea0b6d3a
BLAKE2b-256 checksum
How to use checksums
4e38be3c684a5dda37d51376157e20a597b7384311a6944ecb58b1093bce39c2
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

2.1.0

2 release files

This release

2.1.0a1 This release

2 release files

1.1.3

2 release files

1.0.5

2 release files

1.0.4

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