Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bctrl-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bctrl-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file bctrl-0.1.0.tar.gz.

File metadata

  • Download URL: bctrl-0.1.0.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

Hashes for bctrl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9b27a3067f2b99929672fb7acbb784f51324647eea758673da739344e396c77
MD5 5cfeb95456ca246e1371ced06d27be03
BLAKE2b-256 77227a5bcd8afcde4baa5c476534ffe3ad22e0f801b98a62884c338b7344d014

See more details on using hashes here.

Provenance

The following attestation bundles were made for bctrl-0.1.0.tar.gz:

Publisher: publish.yml on bctrlhq/sdk-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bctrl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bctrl-0.1.0-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

Hashes for bctrl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a006c501e7378e37433e5dfdd2648414256d03dfce487ed32f10e67c2d7b0c1
MD5 4051520756d0f8f12b82069ea5805d2e
BLAKE2b-256 2cf5a7d59a341452d60a957f6746ac6b83449d46fa36782c96191e21ab658468

See more details on using hashes here.

Provenance

The following attestation bundles were made for bctrl-0.1.0-py3-none-any.whl:

Publisher: publish.yml on bctrlhq/sdk-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page