In-process Python SDK for the RunPilot RPA orchestrator (the client bots use to talk back to the server).
Project description
runpilot — Python SDK
In-process Python SDK for the RunPilot RPA orchestrator. This is the library your bot imports to talk back to the RunPilot server from inside a run: report progress, stream logs, fetch credentials, upload artifacts, poll interrupt/kill signals and pull DataPool items.
Think of it as the runtime bridge between an RPA script and the orchestrator that
scheduled it. The runner injects the connection details as environment variables;
the SDK reads them and gives you a single Orchestrator object.
Installation
pip install runpilot
Requires Python 3.9+. The only runtime dependency is requests.
Quick start
Inside a run, build the client from the environment the runner injected:
from runpilot import Orchestrator
bot = Orchestrator.from_env() # reads RUNPILOT_SERVER + run token / api key
ctx = bot.get_run() # the run + task context
bot.report_progress(10, "starting")
api_key = bot.get_credential("stripe", "SECRET_KEY")
pool = bot.datapool("invoices") # claim-and-report DataPool items
while (item := pool.next_item()) is not None:
process(item.data)
item.report_done() # or item.report_error(business=True, message=...)
art = bot.upload_artifact("out/report.pdf")
signals = bot.get_signals() # cooperative interrupt / kill
if signals.kill_requested or signals.interrupt_requested:
bot.finish("failure", "interrupted")
raise SystemExit(0)
bot.finish("success", "processed 42 rows") # canonical: success | failure
Environment variables
Orchestrator.from_env() reads:
| Variable | Purpose |
|---|---|
RUNPILOT_SERVER |
Base URL of the orchestrator (no path), e.g. https://api.runpilot.dev |
RUNPILOT_RUN_TOKEN |
Per-run token (RUN_TOKEN mode — the in-run path) |
RUNPILOT_RUN_ID |
Run ID that accompanies the run token |
RUNPILOT_API_KEY |
Organization API key (management mode) |
RUN_TOKEN mode is what you get inside a run; the in-run methods
(report_progress, get_credential, datapool, upload_artifact, finish, …)
require it.
Testing your bot — fully offline
Orchestrator.mock() returns a client that never performs a network request.
Every in-run call is recorded on .calls and returns a sensible canned value, so
you can unit-test a bot without a live server:
from runpilot import Orchestrator
bot = Orchestrator.mock(
run={"run": {"id": "run_1"}, "task": {"name": "demo"}},
credentials={("stripe", "SECRET_KEY"): "sk_test_123"},
datapool={"invoices": [{"id": "inv_1", "data": {"amount": 10}}]},
)
bot.report_progress(50, "halfway")
assert bot.get_credential("stripe", "SECRET_KEY") == "sk_test_123"
assert bot.calls[-1]["method"] == "get_credential"
API surface
from runpilot import ...
| Export | What it is |
|---|---|
Orchestrator |
The client. from_env(), mock(), get_run(), report_progress(), log(), get_credential(), upload_artifact(), get_signals(), datapool(), finish() |
DataPool, DataPoolItem |
Claim-and-report work queue; pool.next_item(), then item.report_done() / item.report_error() |
Run, RunContext, Task, Artifact, Signals |
Typed models returned by the client |
RunPilotError and subclasses |
ConfigurationError, AuthModeError, AuthenticationError, NotFoundError, ApiError, RunAlreadyFinishedError, RunTerminalError |
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file visus_sdk_runpilot-0.2.1.tar.gz.
File metadata
- Download URL: visus_sdk_runpilot-0.2.1.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9c6a54772aae12975265bdebab8bf475a9c2740101044da824ab8d4562faf13
|
|
| MD5 |
e3b7782b691662cadbc6e9d07e53ceb7
|
|
| BLAKE2b-256 |
8188004ca37558f43d3b637cf7a5528d02397a7dca915cf010ac04a6a66d875f
|
Provenance
The following attestation bundles were made for visus_sdk_runpilot-0.2.1.tar.gz:
Publisher:
publish.yml on botvisus/visus-sdk-runpilot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visus_sdk_runpilot-0.2.1.tar.gz -
Subject digest:
b9c6a54772aae12975265bdebab8bf475a9c2740101044da824ab8d4562faf13 - Sigstore transparency entry: 2168746446
- Sigstore integration time:
-
Permalink:
botvisus/visus-sdk-runpilot@b7bab35e517e23b45ac321bfbdf47e21414ea009 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/botvisus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b7bab35e517e23b45ac321bfbdf47e21414ea009 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file visus_sdk_runpilot-0.2.1-py3-none-any.whl.
File metadata
- Download URL: visus_sdk_runpilot-0.2.1-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f1a6346feb2510a5b7de43c9fdcf582b0d6687c4c698731d8df07c0413157d
|
|
| MD5 |
e7916d1ae76846861f5219f4abe1e6e7
|
|
| BLAKE2b-256 |
b2f9514aa0cdffc3ff5403a9c0c782539e2aad039c15b4f6dfa197deadd5c92b
|
Provenance
The following attestation bundles were made for visus_sdk_runpilot-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on botvisus/visus-sdk-runpilot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visus_sdk_runpilot-0.2.1-py3-none-any.whl -
Subject digest:
10f1a6346feb2510a5b7de43c9fdcf582b0d6687c4c698731d8df07c0413157d - Sigstore transparency entry: 2168746464
- Sigstore integration time:
-
Permalink:
botvisus/visus-sdk-runpilot@b7bab35e517e23b45ac321bfbdf47e21414ea009 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/botvisus
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b7bab35e517e23b45ac321bfbdf47e21414ea009 -
Trigger Event:
workflow_dispatch
-
Statement type: