Moru SDK that gives agents cloud environments
Project description
Moru Python SDK
Moru SDK for Python provides cloud sandbox environments for AI agents.
Quick Start
1. Create an Account
Sign up for a free account at moru.io/dashboard.
2. Get Your API Key
- Go to the API Keys tab in your dashboard
- Click Create API Key
- Copy your new API key
3. Install the SDK
pip install moru
4. Set Your API Key
export MORU_API_KEY=your_api_key
5. Create a Sandbox and Run Commands
from moru import Sandbox
# Create a sandbox using the 'base' template (default)
sandbox = Sandbox.create()
print(f"Sandbox created: {sandbox.sandbox_id}")
# Run a command
result = sandbox.commands.run("echo 'Hello from Moru!'")
print(f"Output: {result.stdout}")
print(f"Exit code: {result.exit_code}")
# Write and read files
sandbox.files.write("/tmp/hello.txt", "Hello from Moru!")
content = sandbox.files.read("/tmp/hello.txt")
print(f"File content: {content}")
# Clean up
sandbox.kill()
Using Async
For async applications, use AsyncSandbox:
import asyncio
from moru import AsyncSandbox
async def main():
sandbox = await AsyncSandbox.create()
result = await sandbox.commands.run("python3 --version")
print(result.stdout)
await sandbox.kill()
asyncio.run(main())
Using a Custom Template
Create templates via the dashboard or CLI.
# Use a custom template
sandbox = Sandbox.create("my-template")
result = sandbox.commands.run("echo 'Running in custom template'")
print(result.stdout)
sandbox.kill()
Documentation
For full documentation, visit docs.moru.io.
Acknowledgement
This project is a fork of E2B.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moru-0.2.0.tar.gz.
File metadata
- Download URL: moru-0.2.0.tar.gz
- Upload date:
- Size: 121.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.9.25 Linux/6.8.0-1044-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b229e9abfd74a9d3f146125521c793571cff845b97794e944e35b7cc738f7c2
|
|
| MD5 |
33f0152eea14eb101263c31c33e17d81
|
|
| BLAKE2b-256 |
918dfea67959cfdfae234916b98fd5008128343c22b3f84339bf6957891a12ed
|
File details
Details for the file moru-0.2.0-py3-none-any.whl.
File metadata
- Download URL: moru-0.2.0-py3-none-any.whl
- Upload date:
- Size: 229.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.9.25 Linux/6.8.0-1044-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43ad18e7926cc7e0bd50694e1f7e161709e1b0dfc5f1a597a970129a8de0ad01
|
|
| MD5 |
37376cbb2a9f860b869e9feeb21dad11
|
|
| BLAKE2b-256 |
17e20b27953fff34ed3b5018bf0d47fb57a6e8f53315dee4b963159ccd1e768c
|