Files
donutbrowser/sdk/python/README.md
T
2026-09-09 10:09:14 +04:00

1.1 KiB

donutbrowser

A thin Python client for the Donut Browser local REST API. Every method wraps exactly one documented endpoint; nothing is invented, cached or retried.

The local API is off by default. Switch it on in the app under Settings → Integrations → Local API → "Enable Local API Server", then copy the port and the authentication token from that screen.

pip install -e .            # from this directory
from donutbrowser import DonutClient

with DonutClient(token="...") as client:
    with client.run(profile_id, url="https://example.com", headless=True) as session:
        print(session.cdp_url)

The client reads DONUT_API_TOKEN and DONUT_API_PORT when the token and port are not passed as arguments.

Full documentation, including the Node package and a worked agent example, is in sdk/README.md.

Tests

pip install -e ".[dev]"
pytest

The suite runs entirely against a fake HTTP server on loopback. It never reaches the network and never needs the desktop app.