Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/browser-use/browser-use-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
run: |
bash ./bin/publish-pypi
env:
PYPI_TOKEN: ${{ secrets.BROWSER_USE_PYPI_TOKEN || secrets.PYPI_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'browser-use/browser-use-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
PYPI_TOKEN: ${{ secrets.BROWSER_USE_PYPI_TOKEN || secrets.PYPI_TOKEN }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.2"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-86040fd18419e7b4e0947660d9c0ff1abe21550528d2d2a549736cd16f85a92d.yml
openapi_spec_hash: 7c5de9d0f633db35fd9e250fcc834d1f
config_hash: dc75baa00369cd029594734d872f6927
config_hash: 771e55285d36ab0c796ac0f29840fa8f
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## 0.0.2 (2025-08-09)

Full Changelog: [v0.0.1...v0.0.2](https://github.com/browser-use/browser-use-python/compare/v0.0.1...v0.0.2)

### Chores

* configure new SDK language ([af51d4f](https://github.com/browser-use/browser-use-python/commit/af51d4f1d2ff224d0a2cba426b28d540d74f63ce))
* update SDK settings ([4fcafb0](https://github.com/browser-use/browser-use-python/commit/4fcafb0a1cbd6fda1c28c0996fe3de4eb033b107))
* update SDK settings ([20019d1](https://github.com/browser-use/browser-use-python/commit/20019d1ec80d3c75dfb7ca54131b66e9dc0dd542))
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ pip install git+ssh://[email protected]/stainless-sdks/browser-use-python.git
$ pip install git+ssh://[email protected]/browser-use/browser-use-python.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down Expand Up @@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/browser-use-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/browser-use/browser-use-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Browser Use Python API library

<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/browser_use.svg?label=pypi%20(stable))](https://pypi.org/project/browser_use/)
[![PyPI version](https://img.shields.io/pypi/v/browser-use-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/browser-use-sdk/)

The Browser Use Python library provides convenient access to the Browser Use REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand All @@ -16,13 +16,10 @@ The REST API documentation can be found on [docs.browser-use.com](https://docs.b
## Installation

```sh
# install from this staging repo
pip install git+ssh://[email protected]/stainless-sdks/browser-use-python.git
# install from PyPI
pip install browser-use-sdk
```

> [!NOTE]
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install browser_use`

## Usage

The full API of this library can be found in [api.md](api.md).
Expand Down Expand Up @@ -75,8 +72,8 @@ By default, the async client uses `httpx` for HTTP requests. However, for improv
You can enable this by installing `aiohttp`:

```sh
# install from this staging repo
pip install 'browser_use[aiohttp] @ git+ssh://[email protected]/stainless-sdks/browser-use-python.git'
# install from PyPI
pip install browser-use-sdk[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
Expand Down Expand Up @@ -254,9 +251,9 @@ task = response.parse() # get the object that `tasks.list()` would have returne
print(task.items)
```

These methods return an [`APIResponse`](https://github.com/stainless-sdks/browser-use-python/tree/main/src/browser_use/_response.py) object.
These methods return an [`APIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/browser-use-python/tree/main/src/browser_use/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/browser-use/browser-use-python/tree/main/src/browser_use/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand Down Expand Up @@ -360,7 +357,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/browser-use-python/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/browser-use/browser-use-python/issues) with questions, bugs, or suggestions.

### Determining the installed version

Expand Down
21 changes: 21 additions & 0 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}

if [[ lenErrors -gt 0 ]]; then
echo -e "Found the following errors in the release environment:\n"

for error in "${errors[@]}"; do
echo -e "- $error\n"
done

exit 1
fi

echo "The environment is ready to push releases!"
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "browser_use"
version = "0.0.1"
name = "browser-use-sdk"
version = "0.0.2"
description = "The official Python library for the browser-use API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -35,8 +35,8 @@ classifiers = [
]

[project.urls]
Homepage = "https://github.com/stainless-sdks/browser-use-python"
Repository = "https://github.com/stainless-sdks/browser-use-python"
Homepage = "https://github.com/browser-use/browser-use-python"
Repository = "https://github.com/browser-use/browser-use-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
Expand Down Expand Up @@ -125,7 +125,7 @@ path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# replace relative links with absolute links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/stainless-sdks/browser-use-python/tree/main/\g<2>)'
replacement = '[\1](https://github.com/browser-use/browser-use-python/tree/main/\g<2>)'

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
66 changes: 66 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
"prerelease": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"pull-request-header": "Automated Release PR",
"pull-request-title-pattern": "release: ${version}",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "chore",
"section": "Chores"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "refactor",
"section": "Refactors"
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"release-type": "python",
"extra-files": [
"src/browser_use/_version.py"
]
}
16 changes: 8 additions & 8 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via browser-use
# via browser-use-sdk
# via httpx-aiohttp
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via browser-use
# via browser-use-sdk
# via httpx
argcomplete==3.1.2
# via nox
Expand All @@ -37,7 +37,7 @@ dirty-equals==0.6.0
distlib==0.3.7
# via virtualenv
distro==1.8.0
# via browser-use
# via browser-use-sdk
exceptiongroup==1.2.2
# via anyio
# via pytest
Expand All @@ -53,11 +53,11 @@ h11==0.16.0
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via browser-use
# via browser-use-sdk
# via httpx-aiohttp
# via respx
httpx-aiohttp==0.1.8
# via browser-use
# via browser-use-sdk
idna==3.4
# via anyio
# via httpx
Expand Down Expand Up @@ -90,7 +90,7 @@ propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via browser-use
# via browser-use-sdk
pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
Expand All @@ -114,14 +114,14 @@ six==1.16.0
# via python-dateutil
sniffio==1.3.0
# via anyio
# via browser-use
# via browser-use-sdk
time-machine==2.9.0
tomli==2.0.2
# via mypy
# via pytest
typing-extensions==4.12.2
# via anyio
# via browser-use
# via browser-use-sdk
# via multidict
# via mypy
# via pydantic
Expand Down
16 changes: 8 additions & 8 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via browser-use
# via browser-use-sdk
# via httpx-aiohttp
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via browser-use
# via browser-use-sdk
# via httpx
async-timeout==5.0.1
# via aiohttp
Expand All @@ -30,7 +30,7 @@ certifi==2023.7.22
# via httpcore
# via httpx
distro==1.8.0
# via browser-use
# via browser-use-sdk
exceptiongroup==1.2.2
# via anyio
frozenlist==1.6.2
Expand All @@ -41,10 +41,10 @@ h11==0.16.0
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via browser-use
# via browser-use-sdk
# via httpx-aiohttp
httpx-aiohttp==0.1.8
# via browser-use
# via browser-use-sdk
idna==3.4
# via anyio
# via httpx
Expand All @@ -56,15 +56,15 @@ propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via browser-use
# via browser-use-sdk
pydantic-core==2.27.1
# via pydantic
sniffio==1.3.0
# via anyio
# via browser-use
# via browser-use-sdk
typing-extensions==4.12.2
# via anyio
# via browser-use
# via browser-use-sdk
# via multidict
# via pydantic
# via pydantic-core
Expand Down
Loading
Loading