Skip to main content

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

  1. Go to the API Keys tab in your dashboard
  2. Click Create API Key
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moru-0.2.0.tar.gz (121.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moru-0.2.0-py3-none-any.whl (229.1 kB view details)

Uploaded Python 3

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

Hashes for moru-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8b229e9abfd74a9d3f146125521c793571cff845b97794e944e35b7cc738f7c2
MD5 33f0152eea14eb101263c31c33e17d81
BLAKE2b-256 918dfea67959cfdfae234916b98fd5008128343c22b3f84339bf6957891a12ed

See more details on using hashes here.

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

Hashes for moru-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43ad18e7926cc7e0bd50694e1f7e161709e1b0dfc5f1a597a970129a8de0ad01
MD5 37376cbb2a9f860b869e9feeb21dad11
BLAKE2b-256 17e20b27953fff34ed3b5018bf0d47fb57a6e8f53315dee4b963159ccd1e768c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page