Remote browser automation for AI agents - Python SDK
Project description
bctrl
Python SDK for the BCTRL public API.
Install
pip install bctrl
Quick Start
from bctrl import Bctrl
from pydantic import BaseModel, ConfigDict
class Invoice(BaseModel):
model_config = ConfigDict(extra="forbid")
invoiceNumber: str
total: float
bctrl = Bctrl(api_key="bctrl_...")
with bctrl.runtimes.started_browser(name="checkout") as browser:
print(browser.connect_url)
invocation = bctrl.runtimes.invocations.create_and_wait(
browser.runtime_id,
action="extract",
instruction="Extract the invoice number and total.",
output_model=Invoice,
)
invoice = invocation["parsed_output"]
print(invoice.invoiceNumber, invoice.total)
for event in bctrl.runs.events.stream(browser.run_id):
print(event)
Python methods use snake_case; the SDK sends the API's camelCase fields on the
wire. For example, runtime_path becomes runtimePath.
Design
- Sync-first client.
- Route-first namespaces that mirror the API reference.
- Raw response bodies as dictionaries.
- Pydantic model support for invocation output schemas.
- Python context managers for runtime lifecycle cleanup.
- Sync SSE iterators for run events and activity.
- Explicit helpers for pagination, multipart uploads, and
create_and_wait. - No hidden follow-up requests or stateful resource refreshes.
License
ISC
Project details
Release history Release notifications | RSS feed
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 bctrl-0.1.1.tar.gz.
File metadata
- Download URL: bctrl-0.1.1.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d8ec8ce1691d546c0b61453ad85099fd01b47e409e72ff253328a79b893af45
|
|
| MD5 |
5d6e91c9beb116f5b3be4f7760aff63c
|
|
| BLAKE2b-256 |
dddd3c0fa657f487d56ad7bb08f3703e17d2ab9bf6fec9f12f9fe125277d1ea5
|
Provenance
The following attestation bundles were made for bctrl-0.1.1.tar.gz:
Publisher:
publish.yml on bctrlhq/sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bctrl-0.1.1.tar.gz -
Subject digest:
1d8ec8ce1691d546c0b61453ad85099fd01b47e409e72ff253328a79b893af45 - Sigstore transparency entry: 2083065097
- Sigstore integration time:
-
Permalink:
bctrlhq/sdk-py@363e69fe007001a72c4828629072891f75fa4c7c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bctrlhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@363e69fe007001a72c4828629072891f75fa4c7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file bctrl-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bctrl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 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 |
e35b130ed6080701e6462109908b0d3cc0df11e2500d1623db02169102ff2165
|
|
| MD5 |
919091508455e18137621deea61b0862
|
|
| BLAKE2b-256 |
6e3cba95e7124967237af55cbd2820ced0a383bc6c6473a6009c94829202f6a7
|
Provenance
The following attestation bundles were made for bctrl-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on bctrlhq/sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bctrl-0.1.1-py3-none-any.whl -
Subject digest:
e35b130ed6080701e6462109908b0d3cc0df11e2500d1623db02169102ff2165 - Sigstore transparency entry: 2083065104
- Sigstore integration time:
-
Permalink:
bctrlhq/sdk-py@363e69fe007001a72c4828629072891f75fa4c7c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/bctrlhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@363e69fe007001a72c4828629072891f75fa4c7c -
Trigger Event:
push
-
Statement type: