Skip to main content

Plato Python SDK

Python SDK for the Plato platform.

Installation

The package is private — install it from the Plato package index (it upstreams PyPI, so dependencies resolve normally):

pip install plato-sdk-v2 --index-url "https://__token__:$PLATO_API_KEY@plato.so/api/v2/pypi/pypi-store/simple/"

Or with uv:

uv add plato-sdk-v2 --index "https://__token__:$PLATO_API_KEY@plato.so/api/v2/pypi/pypi-store/simple/"

Agent support is in the base package — there is no [agents] extra. The declared extras are dev, segmentation, worlds and db-cleanup (see pyproject.toml).

Configuration

Create a .env file in your project root:

PLATO_API_KEY=your-api-key
PLATO_BASE_URL=https://plato.so  # optional, defaults to https://plato.so

Or set environment variables directly:

export PLATO_API_KEY=your-api-key

Agents

Agents run inside Plato VMs. The first-party agent is computer-use (browser automation, install: pip install plato-agent-computer-use); custom agents subclass plato.agents.BaseAgent — see plato/agents/base.py for the interface and the module docstring in plato/agents/__init__.py for the exported API and worked examples.

CLI Usage

# List available agents
plato agent list

# Get agent config schema
plato agent schema computer-use

# Publish a custom agent to Plato PyPI
plato agent publish ./my-agent

Sessions & Environments

Flow 1: Create Session from Environments

Use this when you want to spin up environments for development, testing, or custom automation.

import asyncio
from plato.v2 import AsyncPlato, Env

async def main():
    plato = AsyncPlato()

    # Create session with one or more environments
    # (heartbeat starts automatically to keep session alive)
    session = await plato.sessions.create(
        envs=[
            Env.simulator("gitea", dataset="blank", alias="gitea"),
            Env.simulator("kanboard", alias="kanboard"),
        ],
        timeout=600,
    )

    # Reset environments to initial state
    await session.reset()

    # Get public URLs for browser access
    public_urls = await session.get_public_url()
    for alias, url in public_urls.items():
        print(f"{alias}: {url}")

    # Get state mutations from all environments
    state = await session.get_state()
    print(state)

    # Cleanup
    await session.close()
    await plato.close()

asyncio.run(main())

Flow 2: Create Session from Test Case

Use this when running evaluations against predefined test cases. This flow includes evaluation at the end.

import asyncio
from plato.v2 import AsyncPlato

async def main():
    plato = AsyncPlato()

    # Create session from a test case public ID.
    # Unlike `envs=`/`artifacts=`, this auto-resets for mutation logging,
    # so no explicit session.reset() is needed.
    session = await plato.sessions.create(testcase="tc_abc123", timeout=600)

    # Get public URLs for browser access
    public_urls = await session.get_public_url()
    for alias, url in public_urls.items():
        print(f"{alias}: {url}")

    # Evaluate task completion
    evaluation = await session.evaluate()
    print(f"Task completed: {evaluation}")

    # Cleanup
    await session.close()
    await plato.close()

asyncio.run(main())

Environment Configuration

Two ways to specify environments:

from plato.v2 import Env

# 1. From simulator (most common)
Env.simulator("gitea")                          # default tag
Env.simulator("gitea", tag="staging")           # specific tag
Env.simulator("gitea", dataset="blank")         # specific dataset
Env.simulator("gitea", alias="my-git")          # custom alias

# 2. From artifact ID
Env.artifact("artifact-abc123")
Env.artifact("artifact-abc123", alias="my-env")

Per-Environment Operations

Access individual environments within a session:

# Get all environments
for env in session.envs:
    print(f"{env.alias}: {env.job_id}")

# Get specific environment by alias
gitea = session.get_env("gitea")

if gitea:
    # Execute shell command
    result = await gitea.execute("whoami", timeout=30)
    print(result)

    # Get state for this environment only
    state = await gitea.get_state()

    # Reset this environment only
    await gitea.reset()

Sync Client

A synchronous client is also available:

from plato.v2 import Plato, Env

plato = Plato()

session = plato.sessions.create(
    envs=[Env.simulator("gitea", alias="gitea")],
    timeout=600,
)

session.reset()

public_urls = session.get_public_url()
state = session.get_state()

session.close()
plato.close()

Documentation

Part of the useplato/plato-client monorepo.

Metadata

Release files for plato-sdk-v2 2.189.0

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

Source distribution (sdist)

Source distribution for plato-sdk-v2 2.189.0
File Size Uploaded Provenance Actions
plato_sdk_v2-2.189.0.tar.gz 1.8 MB Without provenance Details for plato_sdk_v2-2.189.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plato-sdk-v2 2.189.0
File Interpreter ABI Platform Actions
plato_sdk_v2-2.189.0-py3-none-any.whl Python 3 none any Details for plato_sdk_v2-2.189.0-py3-none-any.whl

Total release size: 4.0 MB

Release files / plato_sdk_v2-2.189.0.tar.gz

Download URL plato_sdk_v2-2.189.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
3da7de14c457b93d8ae0f24cc28e30cdfc96c3cb70d40daf005ed09a247d54ea
BLAKE2b-256 checksum
How to use checksums
a2c94f873c9f67f9ee4df33c2e81d030979d5967f7882ed31a459087ff710ecf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / plato_sdk_v2-2.189.0-py3-none-any.whl

Download URL plato_sdk_v2-2.189.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf13fcdcddb0bf10c75171aab9c19793da1914f8cc7c93abe74575e73af7f40
BLAKE2b-256 checksum
How to use checksums
e1380eff07123ed9d23b436d672c1796df33fc9ac3d98b91330e73f10b13e2e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for plato-sdk-v2 2.189.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.189.0 This release

2 release files No provenance

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