Registry / http-networking / plato-sdk-v2

plato-sdk-v2

JSON →
library2.98.0pypypi✓ verified 91d ago

The Plato Python SDK (v2) provides a powerful interface for browser automation and task execution, enabling developers to efficiently create and manage browser environments and execute tasks. It is currently at version 2.62.4 and is under active development, with frequent updates indicated by recent changelogs.

pip install plato-sdk-v2
INSTALL
IMPORT
SIG · PLATO-SDK-V2
P
plato-sdk-v2
http-networkingpythonv2.98.0
Install
29.3s avg
Import
5684ms
Disk
355MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.90.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 34.23s
py 3.11
✓ —
✓ 32.1s
py 3.12
✓ —
✓ 25.65s
py 3.13
✓ —
✓ 25.05s
py 3.9
✕ build_error
✕ build_error
355MB installed
● package 355MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncPlato, Env
✓ from plato.v2 import AsyncPlato, Env
✗ from plato import Plato, PlatoTask
The v2 SDK introduces a new API under `plato.v2`, replacing the `Plato` client and `PlatoTask` from previous versions.

This quickstart demonstrates how to initialize the `AsyncPlato` client, create and manage a session with a simulated environment, execute commands, retrieve state, and ensure proper cleanup. It relies on the `PLATO_API_KEY` environment variable for authentication.

import asyncio import os from plato.v2 import AsyncPlato, Env async def main(): # Ensure PLATO_API_KEY environment variable is set # export PLATO_API_KEY="your_api_key_here" if not os.environ.get("PLATO_API_KEY"): print("Error: PLATO_API_KEY environment variable not set.") print("Please generate your API key from the Plato dashboard and set it.") return # Initialize the client plato = AsyncPlato() # Create a session with an example environment (e.g., 'espocrm' simulator) session = await plato.sessions.create( envs=[Env.simulator("espocrm")] ) try: # Reset the environment to its initial state await session.reset() # Get the public URL to access the application (if applicable) urls = await session.get_public_url() print(f"Access your environment at: {urls}") # Execute a command within the environment result = await session.execute("whoami") print(f"Running as: {result}") # Get the current state of the environment state = await session.get_state() print(f"State: {state}") except Exception as e: print(f"An error occurred: {e}") finally: # Always clean up and close the session await session.close() await plato.close() if __name__ == "__main__": asyncio.run(main())
plato --version
Debug
Known issues
breakingThe SDK v2 introduces significant API changes, moving from direct `Plato` and `PlatoTask` objects to `AsyncPlato` for client interaction and `sessions` for environment management. Code written for SDK v1.x will not be compatible with v2 without modifications.
fix
Update imports from `from plato import ...` to `from plato.v2 import ...`. Refactor client and environment management to use `AsyncPlato` and `session` objects as per the v2 documentation.
affects: All versions migrating from plato-sdk (v1.x) to plato-sdk-v2 (v2.x)
gotchaAPI keys should be managed securely, preferably via the `PLATO_API_KEY` environment variable. Directly embedding API keys in code is discouraged for security reasons.
fix
Set the `PLATO_API_KEY` environment variable. The `AsyncPlato` client will automatically pick it up. If explicit passing is required (e.g., for multiple keys), ensure secure handling.
affects: All
gotchaBrowser environments and sessions must be explicitly closed using `await session.close()` and `await plato.close()` within a `try...finally` block to prevent resource leaks and ensure proper cleanup.
fix
Always wrap your session and client usage in `try...finally` blocks to guarantee that `await session.close()` and `await plato.close()` are called, even if errors occur.
affects: All
Errors
Common errors & fixes
Error: PLATO_API_KEY environment variable not set.
The Plato SDK requires an API key for authentication, which is typically read from the `PLATO_API_KEY` environment variable.
fix
Set the `PLATO_API_KEY` environment variable in your shell (e.g., `export PLATO_API_KEY="your_api_key_here"` on Linux/macOS or `SET PLATO_API_KEY=your_api_key_here` on Windows) or pass it directly when initializing `AsyncPlato` (e.g., `AsyncPlato(api_key="...")`).
Session not starting / connection issues
Problems creating or connecting to a session can stem from network connectivity issues or incorrect/insufficient permissions associated with the provided API key.
fix
Verify your internet connection. Double-check that your `PLATO_API_KEY` is correct and has the necessary permissions for the requested operations by checking your Plato dashboard.
AttributeError: module 'plato' has no attribute 'Plato' or ImportError: cannot import name 'Plato' from 'plato'
This typically occurs when trying to use the older SDK v1 import patterns with `plato-sdk-v2`, which has moved core components to the `plato.v2` submodule.
fix
Update your import statements to use `from plato.v2 import AsyncPlato, Env` (or other v2-specific symbols) and adjust your code to the new v2 API structure.
Upgrade
Version history
2.98.0latest on PyPI · released Jun 13, 2026
Audit
Dependencies
PythonrequiredRequires Python versions 3.10 up to (but not including) 3.14.
Agent activity
4 hits · last 30 days
node
4
Resources
plato-sdk-v2 — pip install plato-sdk-v2 · libregistry