Skip to main content

Official Python SDK for BotManifold - Robot Policy Verification & Competition Platform

Project description

BotManifold SDK

Official Python SDK for BotManifold - Robot Policy Verification & Competition Platform.

Installation

pip install botmanifold

Quick Start

from botmanifold import BotManifoldClient

client = BotManifoldClient(api_key="bm_live_...")

# Verify a policy (primary use case)
report = client.verify.run("my_policy.zip", scenario="messy_room")
print(f"Verdict: {report.verdict}")  # SAFE, UNSAFE, or ERROR
print(f"Score: {report.score}")

# Submit to arena (competition)
submission = client.arena.submit("my_policy.zip", scenario="messy_room")
print(f"Submission ID: {submission.id}")

CLI Usage

# Verify a policy (primary command)
botmanifold verify my_policy.zip --scenario messy_room

# Submit to arena
botmanifold arena submit my_policy.zip --scenario messy_room

# Check submission status
botmanifold arena status <submission_id>

# View leaderboard
botmanifold arena leaderboard --scenario messy_room

API Reference

BotManifoldClient

The main entry point for the SDK.

client = BotManifoldClient(
    api_key="...",      # Or set BOTMANIFOLD_API_KEY env var
    base_url="...",     # Optional, defaults to production
    timeout=30,         # Request timeout in seconds
)

Verify API (Primary)

# Quick verification (waits for result)
report = client.verify.run(
    policy="policy.zip",
    scenario="messy_room",
    num_episodes=5,
    timeout=300,
)

# Check if safe
if report.is_safe:
    print("Policy is safe!")

# Async verification (non-blocking)
job = client.verify.submit(policy, config)
report = client.verify.wait(job.job_id)

Arena API (Competition)

# Submit to competition
submission = client.arena.submit(policy, scenario)

# Check status
status = client.arena.status(submission.id)

# Wait for completion
result = client.arena.wait(submission.id)

# View leaderboard
entries = client.arena.leaderboard(scenario="messy_room", limit=10)

Environment Variables

Variable Description
BOTMANIFOLD_API_KEY API key for authentication
BOTMANIFOLD_API_URL Custom API base URL
BOTARENA_API_KEY Legacy API key (deprecated)

Migration from botarena

The botarena package is deprecated. Update your imports:

# Old (deprecated)
from botarena import Client
client = Client()
submission = client.submit("policy.zip", scenario="messy_room")

# New (recommended)
from botmanifold import BotManifoldClient
client = BotManifoldClient()
report = client.verify.run("policy.zip", scenario="messy_room")  # Primary
submission = client.arena.submit("policy.zip", scenario="messy_room")  # Arena

Development

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run linting
ruff check botmanifold/

License

Proprietary - see LICENSE file.

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

botmanifold-0.3.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

botmanifold-0.3.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file botmanifold-0.3.0.tar.gz.

File metadata

  • Download URL: botmanifold-0.3.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for botmanifold-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a6d836efd99e62c507fa9bd76f834c27d75297c86e7145305869981f1be33964
MD5 4061b25a3bfd5c3fc22b8a9c31a39507
BLAKE2b-256 d899de32af44a31a6c7aa1d03d301799c0e756fb37973884f4c2233345ec8451

See more details on using hashes here.

File details

Details for the file botmanifold-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: botmanifold-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for botmanifold-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2824822a0d438409efc6546206f5a550457fdf0bd63bfc6e0249dcc81dc3e736
MD5 c82fc97b7f6ac8c32db8749701dda80a
BLAKE2b-256 ed5eda947935853a49ab7e1665148a27ca434c6cb3a45ec13b0704d89bf01af5

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