Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

planir

Official Python SDK for planir.io — hosted, hardware-isolated microVM runtimes with a stable public URL per runtime. Sync and async clients.

Install

pip install planir

Usage

import os
from planir import PlanirClient

client = PlanirClient(token=os.environ["PLANIR_TOKEN"])

# List runtimes (one page; pass cursor=page.next_cursor for the next one)
page = client.runtimes.list()
for runtime in page.runtimes:
    print(runtime.id)

# Create a runtime
runtime = client.runtimes.create(request={"image": "ghcr.io/acme/agent:latest"})
print(runtime.urls)

Commands and terminals

import sys

# Run exact argv. Planir does not add a shell.
box = client.runtimes.runtime(runtime.id)
result = box.commands.run(["git", "status", "--short"])
print(result.stdout)

# Keep a process running and control it through one handle.
command = box.commands.start(
    ["python", "worker.py"], tag="worker"
)
command.send_input("work\n")
command.close_stdin()
completed = command.wait(on_stdout=sys.stdout.buffer.write)

# Open a PTY when the program needs a terminal.
terminal = box.pty.create(["/bin/sh"], cols=120, rows=30)
terminal.send_input("pwd\n")
terminal.resize(160, 40)

run() and wait() raise CommandExitError or PtyExitError on a non-zero exit; the error's result retains the exit code and captured output.

The client defaults to https://api.planir.io; pass base_url to point elsewhere (e.g. a mock server in tests). An async client is available as AsyncPlanirClient. Its Process methods use the same names and are awaitable. commands.connect(pid_or_tag) and pty.connect(pid_or_tag) reconnect to future output; output produced while disconnected is not replayed. disconnect() closes only the attachment; discard that handle and call connect() again to reattach. Use capture=False with an output callback for streams that must not be buffered in SDK memory. Sync callbacks run during run() or wait(); async callbacks start with the handle. A custom httpx_client also requires process_http_client, because Process calls use Connect's native Pyqwest client.

License

Apache-2.0

Release files for planir 0.1.0b9

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

Source distribution (sdist)

Source distribution for planir 0.1.0b9
File Size Uploaded
planir-0.1.0b9.tar.gz 117.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for planir 0.1.0b9
File Interpreter ABI Platform
planir-0.1.0b9-py3-none-any.whl Python 3 none any Details

Total release size: 323.9 kB

Release files / planir-0.1.0b9.tar.gz

Download URL planir-0.1.0b9.tar.gz
Size 117.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f4c52c00995f14d37bd6e955e7b2733b0cf70a7ab2beeb891b5c50fa7631bb41
BLAKE2b-256 checksum
How to use checksums
df4c8e88a06f2e10d76178219cdbd626c0ab8a84f421354cd8e7e2d349f4fe4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / planir-0.1.0b9-py3-none-any.whl

Download URL planir-0.1.0b9-py3-none-any.whl
Size 206.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1159b88a43fdb84a035c6852c8c8168685fb364e6e586899ad8024cc447fac28
BLAKE2b-256 checksum
How to use checksums
bd6456f671e67911df602027fa3c2b82e56c641bdb540313fc3e34f31f0313c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log
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