Eryx
eryx (noun): A genus of sand boas (Erycinae) - non-venomous snakes that live in sand. Perfect for "Python running inside a sandbox."
A Python sandbox with async callbacks powered by WebAssembly.
Features
- Async callback mechanism - Callbacks are exposed as direct async functions (e.g.,
await get_time()) - Parallel execution - Multiple callbacks can run concurrently via
asyncio.gather() - Execution tracing - Line-level progress reporting via
sys.settrace - Introspection - Python can discover available callbacks at runtime
- Composable runtime libraries - Pre-built APIs with Python wrappers and type stubs
- LLM-friendly - Type stubs (
.pyi) for including in context windows
Quick Start
use Sandbox;
async
With Callbacks
Use the #[callback] macro for strongly-typed callbacks with automatic JSON Schema generation:
use ;
use ;
/// Returns the current Unix timestamp
async
/// Echoes back the message
async
async
Dynamic Callbacks
For runtime-defined callbacks (e.g., from configuration or plugins):
use ;
use json;
let greet = builder
.param
.build;
let sandbox = builder
.with_callback
.build?;
With Runtime Libraries
Runtime libraries bundle callbacks with Python wrappers and type stubs:
use ;
let library = new
.with_callback
.with_preamble
.with_stubs;
let sandbox = builder
.with_library
.build?;
License
MIT OR Apache-2.0