browserbase 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {browserbase-1.4.0 → browserbase-1.5.0}/.gitignore +0 -1
- browserbase-1.5.0/.release-please-manifest.json +3 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/CHANGELOG.md +154 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/CONTRIBUTING.md +2 -4
- {browserbase-1.4.0 → browserbase-1.5.0}/LICENSE +1 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/PKG-INFO +49 -42
- {browserbase-1.4.0 → browserbase-1.5.0}/README.md +42 -39
- {browserbase-1.4.0 → browserbase-1.5.0}/SECURITY.md +2 -2
- {browserbase-1.4.0 → browserbase-1.5.0}/api.md +1 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/bin/check-release-environment +1 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_extensions.py +1 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/pyproject.toml +77 -15
- {browserbase-1.4.0 → browserbase-1.5.0}/requirements-dev.lock +97 -50
- browserbase-1.5.0/requirements.lock +76 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/__init__.py +5 -2
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_base_client.py +210 -26
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_client.py +186 -52
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_compat.py +51 -51
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_files.py +4 -4
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_models.py +133 -64
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_qs.py +7 -7
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_response.py +3 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_streaming.py +20 -15
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_types.py +65 -12
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/__init__.py +9 -2
- browserbase-1.5.0/src/browserbase/_utils/_compat.py +45 -0
- browserbase-1.5.0/src/browserbase/_utils/_datetime_parse.py +136 -0
- browserbase-1.5.0/src/browserbase/_utils/_json.py +35 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_sync.py +3 -31
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_transform.py +13 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_typing.py +6 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_utils.py +5 -6
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_version.py +1 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/contexts.py +97 -15
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/extensions.py +11 -11
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/projects.py +13 -13
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/downloads.py +3 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/logs.py +3 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/recording.py +3 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/sessions.py +63 -61
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/uploads.py +3 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/context_create_params.py +4 -3
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session.py +0 -6
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session_create_params.py +44 -61
- browserbase-1.5.0/src/browserbase/types/session_create_response.py +18 -0
- browserbase-1.5.0/src/browserbase/types/session_retrieve_response.py +20 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session_update_params.py +7 -6
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/sessions/test_downloads.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/sessions/test_logs.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/sessions/test_recording.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/sessions/test_uploads.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/test_contexts.py +93 -13
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/test_extensions.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/test_projects.py +3 -1
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/test_sessions.py +53 -57
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/conftest.py +39 -6
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_client.py +519 -252
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_models.py +100 -28
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_transform.py +17 -10
- browserbase-1.5.0/tests/test_utils/test_datetime_parse.py +110 -0
- browserbase-1.5.0/tests/test_utils/test_json.py +126 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/utils.py +13 -5
- browserbase-1.4.0/.release-please-manifest.json +0 -3
- browserbase-1.4.0/mypy.ini +0 -50
- browserbase-1.4.0/requirements.lock +0 -45
- browserbase-1.4.0/src/browserbase/types/session_create_response.py +0 -64
- browserbase-1.4.0/src/browserbase/types/session_retrieve_response.py +0 -64
- {browserbase-1.4.0 → browserbase-1.5.0}/MIGRATION.md +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/bin/publish-pypi +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/.keep +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/e2e/README.md +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/e2e/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/e2e/test_playwright.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/e2e/test_selenium.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/extensions/.gitignore +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/extensions/browserbase-test/hello.html +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/extensions/browserbase-test/images/logo.png +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/extensions/browserbase-test/manifest.json +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/extensions/browserbase-test/scripts/content.js +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/packages/logo.png +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_basic.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_captcha.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_contexts.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_downloads.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_proxy.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/playwright_upload.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/examples/selenium_basic.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/noxfile.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/release-please-config.json +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_constants.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_exceptions.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_resource.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_logs.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_proxy.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_reflection.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_resources_proxy.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/_utils/_streams.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/lib/.keep +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/py.typed +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/resources/sessions/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/context.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/context_create_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/context_update_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/extension.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/extension_create_params.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/project.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/project_list_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/project_usage.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session_list_params.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session_list_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/session_live_urls.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/log_list_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/recording_retrieve_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/session_log.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/session_recording.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/upload_create_params.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/src/browserbase/types/sessions/upload_create_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/api_resources/sessions/__init__.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/sample_file.txt +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_deepcopy.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_extract_files.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_files.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_qs.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_required_args.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_response.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_streaming.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_utils/test_proxy.py +0 -0
- {browserbase-1.4.0 → browserbase-1.5.0}/tests/test_utils/test_typing.py +0 -0
|
@@ -1,5 +1,159 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0-alpha.2 (2026-03-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.5.0-alpha.1...v1.5.0-alpha.2](https://github.com/browserbase/sdk-python/compare/v1.5.0-alpha.1...v1.5.0-alpha.2)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* [CORE-] Restore models and components in SDK ([49f2dab](https://github.com/browserbase/sdk-python/commit/49f2dab3af74ead628337f9475c381023505db6f))
|
|
10
|
+
* **api:** api update ([1c149cb](https://github.com/browserbase/sdk-python/commit/1c149cb5559ce87c275e8e3ff8dabe60f44cb592))
|
|
11
|
+
* **api:** api update ([72aa790](https://github.com/browserbase/sdk-python/commit/72aa790fc596e3762ea73a605134ebbc4ffe0d74))
|
|
12
|
+
* **api:** api update ([a0edac2](https://github.com/browserbase/sdk-python/commit/a0edac2143ff73bc099bf5455191970d46b63628))
|
|
13
|
+
* **api:** api update ([0b8da8a](https://github.com/browserbase/sdk-python/commit/0b8da8acb8aa4a299655719a2b31d472f8d9750f))
|
|
14
|
+
* **api:** api update ([20dcbdc](https://github.com/browserbase/sdk-python/commit/20dcbdc81a95efe53e2e57ff7b205e8a3c023bbc))
|
|
15
|
+
* **api:** api update ([97edfd0](https://github.com/browserbase/sdk-python/commit/97edfd04ce506478373c878b68cab3a8d6adc80d))
|
|
16
|
+
* **api:** manual updates ([892fe71](https://github.com/browserbase/sdk-python/commit/892fe7135c9c454526e7bcf76b4c830b57aa6c22))
|
|
17
|
+
* **api:** manual updates ([32e4d51](https://github.com/browserbase/sdk-python/commit/32e4d5194c9b2da94b7d0da9ce16de2208b47a2d))
|
|
18
|
+
* **api:** manual updates ([3bf8100](https://github.com/browserbase/sdk-python/commit/3bf8100929de96894b568a39a85a1763d46a6cc9))
|
|
19
|
+
* **api:** manual updates ([f46e475](https://github.com/browserbase/sdk-python/commit/f46e475d63812af0f7e53971429adee2dd207d33))
|
|
20
|
+
* **api:** manual updates ([7ace939](https://github.com/browserbase/sdk-python/commit/7ace9396d265afabebd57169e6a32dcedec3b0d4))
|
|
21
|
+
* **api:** manual updates ([94d9db6](https://github.com/browserbase/sdk-python/commit/94d9db6142e868b739649027144eade26e092cb3))
|
|
22
|
+
* **api:** manual updates ([e281b89](https://github.com/browserbase/sdk-python/commit/e281b8958b9a5b30ca90af0db36693a1eeaed8c5))
|
|
23
|
+
* **api:** manual updates ([f0ba58f](https://github.com/browserbase/sdk-python/commit/f0ba58f620f3b30e4f275cce521de1d6e7fd7164))
|
|
24
|
+
* **client:** add custom JSON encoder for extended type support ([da8ce14](https://github.com/browserbase/sdk-python/commit/da8ce14deb91e1da722dbafa3f7e35bfd1fbd983))
|
|
25
|
+
* **client:** add support for binary request streaming ([972c837](https://github.com/browserbase/sdk-python/commit/972c8370ed69360de2479cf0fc818be3df4679cf))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **client:** close streams without requiring full consumption ([bb617be](https://github.com/browserbase/sdk-python/commit/bb617bee85cc709ea14c4b53eac06058f28318e9))
|
|
31
|
+
* compat with Python 3.14 ([8f4df7c](https://github.com/browserbase/sdk-python/commit/8f4df7c2a20dd87d54d5ca12a8060a25223d2ef5))
|
|
32
|
+
* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([135104e](https://github.com/browserbase/sdk-python/commit/135104eec5555bd650d25743dd91587e9c74e549))
|
|
33
|
+
* ensure streams are always closed ([588f8f4](https://github.com/browserbase/sdk-python/commit/588f8f480efaa914d5bbcb693dadd97936d66750))
|
|
34
|
+
* **pydantic:** ignore model extras in pydantic v2 ([#156](https://github.com/browserbase/sdk-python/issues/156)) ([9cae18c](https://github.com/browserbase/sdk-python/commit/9cae18c71078c8baae46bfb13298a8eadcfe5675))
|
|
35
|
+
* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([6e13710](https://github.com/browserbase/sdk-python/commit/6e1371033109ed3a2519660bcc0da3f44f65f097))
|
|
36
|
+
* use async_to_httpx_files in patch method ([4370dab](https://github.com/browserbase/sdk-python/commit/4370dab0f116d5535259ee557c0dddf3fc006c80))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Chores
|
|
40
|
+
|
|
41
|
+
* add missing docstrings ([0332edf](https://github.com/browserbase/sdk-python/commit/0332edf2964f32119e074d86baf3ef35e30f1b8d))
|
|
42
|
+
* add Python 3.14 classifier and testing ([ec88bf3](https://github.com/browserbase/sdk-python/commit/ec88bf3f829ced4db3ee9bbaa249d0f447d0095d))
|
|
43
|
+
* bump `httpx-aiohttp` version to 0.1.9 ([42685a1](https://github.com/browserbase/sdk-python/commit/42685a189cf7a465d8696fbc8902123567f1e9e0))
|
|
44
|
+
* **ci:** upgrade `actions/github-script` ([9363c3d](https://github.com/browserbase/sdk-python/commit/9363c3dd4142917eca9e7f5872d68d73b0400a17))
|
|
45
|
+
* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([b0d4efb](https://github.com/browserbase/sdk-python/commit/b0d4efb5945050ddfa449e468306e39aadeccf6a))
|
|
46
|
+
* **docs:** use environment variables for authentication in code snippets ([97a777f](https://github.com/browserbase/sdk-python/commit/97a777f837a1f06940e05506e4b0237ace54cef8))
|
|
47
|
+
* format all `api.md` files ([36b3fc5](https://github.com/browserbase/sdk-python/commit/36b3fc50c44221848b583e5d5f66e06e9f857a14))
|
|
48
|
+
* **internal/tests:** avoid race condition with implicit client cleanup ([6ca21dc](https://github.com/browserbase/sdk-python/commit/6ca21dcf117d076b9baaa43e0b1efd676c518845))
|
|
49
|
+
* **internal:** add `--fix` argument to lint script ([b96137c](https://github.com/browserbase/sdk-python/commit/b96137ced74f55b77e904026ab76b8bf306a7543))
|
|
50
|
+
* **internal:** add missing files argument to base client ([851f268](https://github.com/browserbase/sdk-python/commit/851f268b6fbfa815f819bd3390d732ee26445b09))
|
|
51
|
+
* **internal:** add request options to SSE classes ([0451d35](https://github.com/browserbase/sdk-python/commit/0451d3509b3bd14695e506ecc5ece3367a91eba6))
|
|
52
|
+
* **internal:** bump dependencies ([b0c3306](https://github.com/browserbase/sdk-python/commit/b0c33068ffe4c033748a4ca7e4394cdd7c4c97be))
|
|
53
|
+
* **internal:** codegen related update ([5dad097](https://github.com/browserbase/sdk-python/commit/5dad0978043a3fe8d65c5ff06a064e2d9b40cda9))
|
|
54
|
+
* **internal:** detect missing future annotations with ruff ([ea60157](https://github.com/browserbase/sdk-python/commit/ea60157e52c3f8477ecf20f2a39ec2a722c83fed))
|
|
55
|
+
* **internal:** fix lint error on Python 3.14 ([ba06a3e](https://github.com/browserbase/sdk-python/commit/ba06a3e6d617c4b10be4874856006797fdec6e93))
|
|
56
|
+
* **internal:** grammar fix (it's -> its) ([1d6aebd](https://github.com/browserbase/sdk-python/commit/1d6aebda8211f3ffe1602420cfca5672d84561bd))
|
|
57
|
+
* **internal:** make `test_proxy_environment_variables` more resilient ([b768b4f](https://github.com/browserbase/sdk-python/commit/b768b4f48ad6ed219cb3b7407baf0f598452f044))
|
|
58
|
+
* **internal:** make `test_proxy_environment_variables` more resilient to env ([976c1fb](https://github.com/browserbase/sdk-python/commit/976c1fb236eddec936bdcbc73844a36a91f41397))
|
|
59
|
+
* **internal:** update `actions/checkout` version ([7b01d95](https://github.com/browserbase/sdk-python/commit/7b01d951f1e4abaa345ee686d8b08c9066f183ca))
|
|
60
|
+
* **package:** drop Python 3.8 support ([e36cf2b](https://github.com/browserbase/sdk-python/commit/e36cf2bcad59f24078b30d5e463e0e2325f9439c))
|
|
61
|
+
* speedup initial import ([ca27085](https://github.com/browserbase/sdk-python/commit/ca270852b7f1c3dd5544f73daeec8ddb41eac253))
|
|
62
|
+
* update lockfile ([738e9be](https://github.com/browserbase/sdk-python/commit/738e9be4acd99ad82e69ea876f1249948310f896))
|
|
63
|
+
* update mock server docs ([9c92875](https://github.com/browserbase/sdk-python/commit/9c928759fb88085da94df9921ef35663d1da926e))
|
|
64
|
+
|
|
65
|
+
## 1.5.0-alpha.1 (2025-10-07)
|
|
66
|
+
|
|
67
|
+
Full Changelog: [v1.5.0-alpha.0...v1.5.0-alpha.1](https://github.com/browserbase/sdk-python/compare/v1.5.0-alpha.0...v1.5.0-alpha.1)
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* **api:** api update ([3bdf24e](https://github.com/browserbase/sdk-python/commit/3bdf24e69fd14e6e488af830e6e5a7786c21640d))
|
|
72
|
+
* **api:** manual updates ([99b1cfb](https://github.com/browserbase/sdk-python/commit/99b1cfb41a51af014f5c350f0850331cd73abf08))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Chores
|
|
76
|
+
|
|
77
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([6915700](https://github.com/browserbase/sdk-python/commit/69157006cc0df8f9e5effd0f53d79df88fe14e7d))
|
|
78
|
+
* **internal:** move mypy configurations to `pyproject.toml` file ([545938f](https://github.com/browserbase/sdk-python/commit/545938fde4ace7142c413f9e0ac25e3b9c717980))
|
|
79
|
+
* **internal:** update pydantic dependency ([4dcad8e](https://github.com/browserbase/sdk-python/commit/4dcad8e96f1220e79f3e9b5cdee2e19dfb5a1e11))
|
|
80
|
+
* **tests:** simplify `get_platform` test ([6421017](https://github.com/browserbase/sdk-python/commit/64210177c60ca05c5d0eead33c3ecee3f4d18718))
|
|
81
|
+
* **types:** change optional parameter type from NotGiven to Omit ([a46d293](https://github.com/browserbase/sdk-python/commit/a46d293766d0eb89b93739af0fbbd038eea083bd))
|
|
82
|
+
|
|
83
|
+
## 1.5.0-alpha.0 (2025-09-05)
|
|
84
|
+
|
|
85
|
+
Full Changelog: [v1.4.0...v1.5.0-alpha.0](https://github.com/browserbase/sdk-python/compare/v1.4.0...v1.5.0-alpha.0)
|
|
86
|
+
|
|
87
|
+
### Features
|
|
88
|
+
|
|
89
|
+
* **api:** api update ([e94ddbd](https://github.com/browserbase/sdk-python/commit/e94ddbd8777b97d4e8ab193e1bf3eaad983ecec9))
|
|
90
|
+
* **api:** api update ([28115fb](https://github.com/browserbase/sdk-python/commit/28115fb584336dbf5b08043ad8f9cf1d911240ea))
|
|
91
|
+
* **api:** api update ([3209287](https://github.com/browserbase/sdk-python/commit/32092872a3d4d48824b4d77d517ffdb06470ad95))
|
|
92
|
+
* **api:** api update ([f38e029](https://github.com/browserbase/sdk-python/commit/f38e02981ae0777cb3d922845902b2673dc832fa))
|
|
93
|
+
* **api:** api update ([1d9f769](https://github.com/browserbase/sdk-python/commit/1d9f7694bc0d465ce758ddcec41359e9cd1a08ad))
|
|
94
|
+
* **api:** api update ([d72f39f](https://github.com/browserbase/sdk-python/commit/d72f39fbe29342cfc77e9b224f2ad0a5a77aaae4))
|
|
95
|
+
* **api:** api update ([6d449b3](https://github.com/browserbase/sdk-python/commit/6d449b3deb284a72528877a8729f4cf7a418275d))
|
|
96
|
+
* **api:** api update ([8bd5f8b](https://github.com/browserbase/sdk-python/commit/8bd5f8bcca3a2e5baadfc06009546692e63eb744))
|
|
97
|
+
* **api:** api update ([1ce99ef](https://github.com/browserbase/sdk-python/commit/1ce99efe89c1d0757ca3100cca8619faa4082f74))
|
|
98
|
+
* **api:** api update ([1cbb849](https://github.com/browserbase/sdk-python/commit/1cbb8498bf70c15c001f620b821519216cbadd97))
|
|
99
|
+
* **api:** manual updates ([5893fc6](https://github.com/browserbase/sdk-python/commit/5893fc6165cfd88378d6725317e30c7cb6faf8df))
|
|
100
|
+
* **api:** manual updates ([074f06d](https://github.com/browserbase/sdk-python/commit/074f06d0dfb08554229348828afd2cc1defe94ee))
|
|
101
|
+
* clean up environment call outs ([82c38c4](https://github.com/browserbase/sdk-python/commit/82c38c494a175c1b6b38bab3615916c30ba25d14))
|
|
102
|
+
* **client:** add follow_redirects request option ([a8b0b5e](https://github.com/browserbase/sdk-python/commit/a8b0b5e4c6445e0e8c0d3673a090aabab09a50fd))
|
|
103
|
+
* **client:** add support for aiohttp ([3516092](https://github.com/browserbase/sdk-python/commit/35160921e262f147cc723a754f14cfd9875603f5))
|
|
104
|
+
* **client:** support file upload requests ([2f338f0](https://github.com/browserbase/sdk-python/commit/2f338f009e556ef9be05f49816b17cef138bda17))
|
|
105
|
+
* improve future compat with pydantic v3 ([8b5256c](https://github.com/browserbase/sdk-python/commit/8b5256c801e1423a4daf6bf49de7509a32ebfde2))
|
|
106
|
+
* **types:** replace List[str] with SequenceNotStr in params ([55083f6](https://github.com/browserbase/sdk-python/commit/55083f678b68020fae835af5cd58e0e5deea2888))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
* avoid newer type syntax ([85f597b](https://github.com/browserbase/sdk-python/commit/85f597b34d149138f1b5afdc52062cb131e3a30a))
|
|
112
|
+
* **ci:** correct conditional ([a36b873](https://github.com/browserbase/sdk-python/commit/a36b87379b404613673720dd9f498ed76dfe5c3a))
|
|
113
|
+
* **ci:** release-doctor — report correct token name ([61b97ff](https://github.com/browserbase/sdk-python/commit/61b97fff5ea92bade293c5f5f4a84b0d991375e7))
|
|
114
|
+
* **client:** correctly parse binary response | stream ([9614c4c](https://github.com/browserbase/sdk-python/commit/9614c4c05bc57ea60100aec9a194aee7a39e701b))
|
|
115
|
+
* **client:** don't send Content-Type header on GET requests ([c4c4185](https://github.com/browserbase/sdk-python/commit/c4c4185de32b28c09565b6fe84efd65fd411abb9))
|
|
116
|
+
* fix extension types in playwright_extensions ([8b652e7](https://github.com/browserbase/sdk-python/commit/8b652e78be1493d03e13d2a116cbc6969a880e58))
|
|
117
|
+
* **parsing:** correctly handle nested discriminated unions ([d020678](https://github.com/browserbase/sdk-python/commit/d0206786894ecfb22e0924edb8a227414b17788d))
|
|
118
|
+
* **parsing:** ignore empty metadata ([118c4d4](https://github.com/browserbase/sdk-python/commit/118c4d41bda811d2d942793d8ab029b272c7a5c6))
|
|
119
|
+
* **parsing:** parse extra field types ([c7ef875](https://github.com/browserbase/sdk-python/commit/c7ef87549e324fb06fab945e1754ef7b56b30031))
|
|
120
|
+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([e298407](https://github.com/browserbase/sdk-python/commit/e2984077537fd6dee0191329a083ad0ccf9fd76f))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Chores
|
|
124
|
+
|
|
125
|
+
* **ci:** change upload type ([e42da7c](https://github.com/browserbase/sdk-python/commit/e42da7c1fed216ff2b15223c49f1111bc0ef16e5))
|
|
126
|
+
* **ci:** enable for pull requests ([03a6db7](https://github.com/browserbase/sdk-python/commit/03a6db72e98bf1606bf68928b2ac5029cba088df))
|
|
127
|
+
* **ci:** only run for pushes and fork pull requests ([c8cb51f](https://github.com/browserbase/sdk-python/commit/c8cb51f311f4d39863127fab189c95d84a186bc6))
|
|
128
|
+
* **docs:** grammar improvements ([f32a9e2](https://github.com/browserbase/sdk-python/commit/f32a9e258a9b0b4d29c24137d5a7207907f00f9b))
|
|
129
|
+
* **docs:** remove reference to rye shell ([07d129a](https://github.com/browserbase/sdk-python/commit/07d129a04211037d123b06d36347741960e75323))
|
|
130
|
+
* **docs:** remove unnecessary param examples ([62209dc](https://github.com/browserbase/sdk-python/commit/62209dcac034f40ac8b3b8a119e532201a227680))
|
|
131
|
+
* **internal:** add Sequence related utils ([34b0dd6](https://github.com/browserbase/sdk-python/commit/34b0dd6b4297fafc2bcb9e8243c8d3c2e2e435fc))
|
|
132
|
+
* **internal:** bump pinned h11 dep ([5e3270d](https://github.com/browserbase/sdk-python/commit/5e3270da2e4f41efdd345d073a42d6791eb22a84))
|
|
133
|
+
* **internal:** change ci workflow machines ([14c0ac4](https://github.com/browserbase/sdk-python/commit/14c0ac49a6d9d42f5401a5c24ddb8586b3998fb2))
|
|
134
|
+
* **internal:** codegen related update ([f979aff](https://github.com/browserbase/sdk-python/commit/f979aff605c0d74efb561e0b169ad39b486ab5a0))
|
|
135
|
+
* **internal:** codegen related update ([12de9f3](https://github.com/browserbase/sdk-python/commit/12de9f324fbb40bec91cd7c6b16af1440c4f7373))
|
|
136
|
+
* **internal:** codegen related update ([c4157cb](https://github.com/browserbase/sdk-python/commit/c4157cb8470b1d0ca67e6757f4fe9146a630cc82))
|
|
137
|
+
* **internal:** codegen related update ([ccb2c95](https://github.com/browserbase/sdk-python/commit/ccb2c95002bb6a38e1eb8b9a84e4a335d5ee1a13))
|
|
138
|
+
* **internal:** fix ruff target version ([e6a3df4](https://github.com/browserbase/sdk-python/commit/e6a3df40564b4ba3d23514e0b42221010d465bf6))
|
|
139
|
+
* **internal:** update comment in script ([a7aec17](https://github.com/browserbase/sdk-python/commit/a7aec17c02632684dfeb7759dd6a5322efe092ce))
|
|
140
|
+
* **internal:** update conftest.py ([5d3a2b1](https://github.com/browserbase/sdk-python/commit/5d3a2b1906ca5fca5c84c6d6684a8a62b6700479))
|
|
141
|
+
* **internal:** update pyright exclude list ([33ba4b4](https://github.com/browserbase/sdk-python/commit/33ba4b47ddeb8c0aa19a11f35a7cea9aa9a0966d))
|
|
142
|
+
* **package:** mark python 3.13 as supported ([2450b8e](https://github.com/browserbase/sdk-python/commit/2450b8eb2349adde689febd09269915d41e7a590))
|
|
143
|
+
* **project:** add settings file for vscode ([a406241](https://github.com/browserbase/sdk-python/commit/a4062413b2fce397d59ea9ceaec7ed0565880fe2))
|
|
144
|
+
* **readme:** fix version rendering on pypi ([a8afe1a](https://github.com/browserbase/sdk-python/commit/a8afe1a67c48080ef202cac88da9b5d59534799a))
|
|
145
|
+
* **readme:** update badges ([869a3f4](https://github.com/browserbase/sdk-python/commit/869a3f4dd7e6f19225b697aeee89ce98a2174c0a))
|
|
146
|
+
* **tests:** add tests for httpx client instantiation & proxies ([9c5d88c](https://github.com/browserbase/sdk-python/commit/9c5d88cb4cbbda5aa618cba2f5217bacd4a228cc))
|
|
147
|
+
* **tests:** run tests in parallel ([94308de](https://github.com/browserbase/sdk-python/commit/94308dea065f54268145b175a13e0dbfd2a9cc81))
|
|
148
|
+
* **tests:** skip some failing tests on the latest python versions ([7bc40f0](https://github.com/browserbase/sdk-python/commit/7bc40f068d290a479a0d4070ef54e8f8c4ef598d))
|
|
149
|
+
* update @stainless-api/prism-cli to v5.15.0 ([b48933b](https://github.com/browserbase/sdk-python/commit/b48933b2f68eafaa554662eb7f41bf960a74d8b6))
|
|
150
|
+
* update github action ([d57dc03](https://github.com/browserbase/sdk-python/commit/d57dc0398b083556ed7ceee265efcf282062005d))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Documentation
|
|
154
|
+
|
|
155
|
+
* **client:** fix httpx.Timeout documentation reference ([4bbda56](https://github.com/browserbase/sdk-python/commit/4bbda56cdb4adf677f67011f42f5c3e324a5f60e))
|
|
156
|
+
|
|
3
157
|
## 1.4.0 (2025-05-16)
|
|
4
158
|
|
|
5
159
|
Full Changelog: [v1.3.0...v1.4.0](https://github.com/browserbase/sdk-python/compare/v1.3.0...v1.4.0)
|
|
@@ -17,8 +17,7 @@ $ rye sync --all-features
|
|
|
17
17
|
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
|
-
|
|
21
|
-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
|
|
20
|
+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
|
|
22
21
|
$ source .venv/bin/activate
|
|
23
22
|
|
|
24
23
|
# now you can omit the `rye run` prefix
|
|
@@ -89,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl
|
|
|
89
88
|
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
90
89
|
|
|
91
90
|
```sh
|
|
92
|
-
|
|
93
|
-
$ npx prism mock path/to/your/openapi.yml
|
|
91
|
+
$ ./scripts/mock
|
|
94
92
|
```
|
|
95
93
|
|
|
96
94
|
```sh
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Browserbase
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: browserbase
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: The official Python library for the Browserbase API
|
|
5
5
|
Project-URL: Homepage, https://github.com/browserbase/sdk-python
|
|
6
6
|
Project-URL: Repository, https://github.com/browserbase/sdk-python
|
|
@@ -13,27 +13,32 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Operating System :: POSIX
|
|
15
15
|
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
23
|
Classifier: Typing :: Typed
|
|
23
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.9
|
|
24
25
|
Requires-Dist: anyio<5,>=3.5.0
|
|
25
26
|
Requires-Dist: distro<2,>=1.7.0
|
|
26
27
|
Requires-Dist: httpx<1,>=0.23.0
|
|
27
28
|
Requires-Dist: pydantic<3,>=1.9.0
|
|
28
29
|
Requires-Dist: sniffio
|
|
29
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
|
+
Provides-Extra: aiohttp
|
|
32
|
+
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
30
34
|
Description-Content-Type: text/markdown
|
|
31
35
|
|
|
32
36
|
# Browserbase Python API library
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
<!-- prettier-ignore -->
|
|
39
|
+
[)](https://pypi.org/project/browserbase/)
|
|
35
40
|
|
|
36
|
-
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.
|
|
41
|
+
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.9+
|
|
37
42
|
application. The library includes type definitions for all request params and response fields,
|
|
38
43
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
39
44
|
|
|
@@ -47,7 +52,7 @@ The REST API documentation can be found on [docs.browserbase.com](https://docs.b
|
|
|
47
52
|
|
|
48
53
|
```sh
|
|
49
54
|
# install from PyPI
|
|
50
|
-
pip install browserbase
|
|
55
|
+
pip install '--pre browserbase'
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
## Usage
|
|
@@ -70,7 +75,7 @@ client = Browserbase(
|
|
|
70
75
|
session = client.sessions.create(
|
|
71
76
|
project_id=BROWSERBASE_PROJECT_ID,
|
|
72
77
|
)
|
|
73
|
-
|
|
78
|
+
```
|
|
74
79
|
|
|
75
80
|
|
|
76
81
|
def run(playwright: Playwright) -> None:
|
|
@@ -112,6 +117,39 @@ rye run example playwright_basic # replace with the example you want to run
|
|
|
112
117
|
> [!NOTE]
|
|
113
118
|
> Make sure you have a `.env` file that matches the [.env.example](https://github.com/browserbase/sdk-python/tree/main/.env.example) file in the root of this repository.
|
|
114
119
|
|
|
120
|
+
### With aiohttp
|
|
121
|
+
|
|
122
|
+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
|
|
123
|
+
|
|
124
|
+
You can enable this by installing `aiohttp`:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
# install from PyPI
|
|
128
|
+
pip install '--pre browserbase[aiohttp]'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
import os
|
|
135
|
+
import asyncio
|
|
136
|
+
from browserbase import DefaultAioHttpClient
|
|
137
|
+
from browserbase import AsyncBrowserbase
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
async def main() -> None:
|
|
141
|
+
async with AsyncBrowserbase(
|
|
142
|
+
api_key=os.environ.get("BROWSERBASE_API_KEY"), # This is the default and can be omitted
|
|
143
|
+
http_client=DefaultAioHttpClient(),
|
|
144
|
+
) as client:
|
|
145
|
+
session = await client.sessions.create(
|
|
146
|
+
project_id="your_project_id",
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
asyncio.run(main())
|
|
151
|
+
```
|
|
152
|
+
|
|
115
153
|
## Using types
|
|
116
154
|
|
|
117
155
|
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
|
|
@@ -131,38 +169,7 @@ from browserbase import Browserbase
|
|
|
131
169
|
client = Browserbase()
|
|
132
170
|
|
|
133
171
|
session = client.sessions.create(
|
|
134
|
-
|
|
135
|
-
browser_settings={
|
|
136
|
-
"advanced_stealth": True,
|
|
137
|
-
"block_ads": True,
|
|
138
|
-
"captcha_image_selector": "captchaImageSelector",
|
|
139
|
-
"captcha_input_selector": "captchaInputSelector",
|
|
140
|
-
"context": {
|
|
141
|
-
"id": "id",
|
|
142
|
-
"persist": True,
|
|
143
|
-
},
|
|
144
|
-
"extension_id": "extensionId",
|
|
145
|
-
"fingerprint": {
|
|
146
|
-
"browsers": ["chrome"],
|
|
147
|
-
"devices": ["desktop"],
|
|
148
|
-
"http_version": "1",
|
|
149
|
-
"locales": ["string"],
|
|
150
|
-
"operating_systems": ["android"],
|
|
151
|
-
"screen": {
|
|
152
|
-
"max_height": 0,
|
|
153
|
-
"max_width": 0,
|
|
154
|
-
"min_height": 0,
|
|
155
|
-
"min_width": 0,
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
"log_session": True,
|
|
159
|
-
"record_session": True,
|
|
160
|
-
"solve_captchas": True,
|
|
161
|
-
"viewport": {
|
|
162
|
-
"height": 0,
|
|
163
|
-
"width": 0,
|
|
164
|
-
},
|
|
165
|
-
},
|
|
172
|
+
browser_settings={},
|
|
166
173
|
)
|
|
167
174
|
print(session.browser_settings)
|
|
168
175
|
```
|
|
@@ -253,7 +260,7 @@ client.with_options(max_retries=5).sessions.create(
|
|
|
253
260
|
### Timeouts
|
|
254
261
|
|
|
255
262
|
By default requests time out after 1 minute. You can configure this with a `timeout` option,
|
|
256
|
-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
263
|
+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
257
264
|
|
|
258
265
|
```python
|
|
259
266
|
from browserbase import Browserbase
|
|
@@ -319,7 +326,7 @@ response = client.sessions.with_raw_response.create(
|
|
|
319
326
|
print(response.headers.get('X-My-Header'))
|
|
320
327
|
|
|
321
328
|
session = response.parse() # get the object that `sessions.create()` would have returned
|
|
322
|
-
print(session
|
|
329
|
+
print(session)
|
|
323
330
|
```
|
|
324
331
|
|
|
325
332
|
These methods return an [`APIResponse`](https://github.com/browserbase/sdk-python/tree/main/src/browserbase/_response.py) object.
|
|
@@ -445,7 +452,7 @@ print(browserbase.__version__)
|
|
|
445
452
|
|
|
446
453
|
## Requirements
|
|
447
454
|
|
|
448
|
-
Python 3.
|
|
455
|
+
Python 3.9 or higher.
|
|
449
456
|
|
|
450
457
|
## Contributing
|
|
451
458
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Browserbase Python API library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- prettier-ignore -->
|
|
4
|
+
[)](https://pypi.org/project/browserbase/)
|
|
4
5
|
|
|
5
|
-
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.
|
|
6
|
+
The Browserbase Python library provides convenient access to the Browserbase REST API from any Python 3.9+
|
|
6
7
|
application. The library includes type definitions for all request params and response fields,
|
|
7
8
|
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
|
|
8
9
|
|
|
@@ -16,7 +17,7 @@ The REST API documentation can be found on [docs.browserbase.com](https://docs.b
|
|
|
16
17
|
|
|
17
18
|
```sh
|
|
18
19
|
# install from PyPI
|
|
19
|
-
pip install browserbase
|
|
20
|
+
pip install '--pre browserbase'
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
## Usage
|
|
@@ -39,7 +40,7 @@ client = Browserbase(
|
|
|
39
40
|
session = client.sessions.create(
|
|
40
41
|
project_id=BROWSERBASE_PROJECT_ID,
|
|
41
42
|
)
|
|
42
|
-
|
|
43
|
+
```
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
def run(playwright: Playwright) -> None:
|
|
@@ -81,6 +82,39 @@ rye run example playwright_basic # replace with the example you want to run
|
|
|
81
82
|
> [!NOTE]
|
|
82
83
|
> Make sure you have a `.env` file that matches the [.env.example](.env.example) file in the root of this repository.
|
|
83
84
|
|
|
85
|
+
### With aiohttp
|
|
86
|
+
|
|
87
|
+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
|
|
88
|
+
|
|
89
|
+
You can enable this by installing `aiohttp`:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
# install from PyPI
|
|
93
|
+
pip install '--pre browserbase[aiohttp]'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import os
|
|
100
|
+
import asyncio
|
|
101
|
+
from browserbase import DefaultAioHttpClient
|
|
102
|
+
from browserbase import AsyncBrowserbase
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
async def main() -> None:
|
|
106
|
+
async with AsyncBrowserbase(
|
|
107
|
+
api_key=os.environ.get("BROWSERBASE_API_KEY"), # This is the default and can be omitted
|
|
108
|
+
http_client=DefaultAioHttpClient(),
|
|
109
|
+
) as client:
|
|
110
|
+
session = await client.sessions.create(
|
|
111
|
+
project_id="your_project_id",
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
asyncio.run(main())
|
|
116
|
+
```
|
|
117
|
+
|
|
84
118
|
## Using types
|
|
85
119
|
|
|
86
120
|
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
|
|
@@ -100,38 +134,7 @@ from browserbase import Browserbase
|
|
|
100
134
|
client = Browserbase()
|
|
101
135
|
|
|
102
136
|
session = client.sessions.create(
|
|
103
|
-
|
|
104
|
-
browser_settings={
|
|
105
|
-
"advanced_stealth": True,
|
|
106
|
-
"block_ads": True,
|
|
107
|
-
"captcha_image_selector": "captchaImageSelector",
|
|
108
|
-
"captcha_input_selector": "captchaInputSelector",
|
|
109
|
-
"context": {
|
|
110
|
-
"id": "id",
|
|
111
|
-
"persist": True,
|
|
112
|
-
},
|
|
113
|
-
"extension_id": "extensionId",
|
|
114
|
-
"fingerprint": {
|
|
115
|
-
"browsers": ["chrome"],
|
|
116
|
-
"devices": ["desktop"],
|
|
117
|
-
"http_version": "1",
|
|
118
|
-
"locales": ["string"],
|
|
119
|
-
"operating_systems": ["android"],
|
|
120
|
-
"screen": {
|
|
121
|
-
"max_height": 0,
|
|
122
|
-
"max_width": 0,
|
|
123
|
-
"min_height": 0,
|
|
124
|
-
"min_width": 0,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
"log_session": True,
|
|
128
|
-
"record_session": True,
|
|
129
|
-
"solve_captchas": True,
|
|
130
|
-
"viewport": {
|
|
131
|
-
"height": 0,
|
|
132
|
-
"width": 0,
|
|
133
|
-
},
|
|
134
|
-
},
|
|
137
|
+
browser_settings={},
|
|
135
138
|
)
|
|
136
139
|
print(session.browser_settings)
|
|
137
140
|
```
|
|
@@ -222,7 +225,7 @@ client.with_options(max_retries=5).sessions.create(
|
|
|
222
225
|
### Timeouts
|
|
223
226
|
|
|
224
227
|
By default requests time out after 1 minute. You can configure this with a `timeout` option,
|
|
225
|
-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
228
|
+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
226
229
|
|
|
227
230
|
```python
|
|
228
231
|
from browserbase import Browserbase
|
|
@@ -288,7 +291,7 @@ response = client.sessions.with_raw_response.create(
|
|
|
288
291
|
print(response.headers.get('X-My-Header'))
|
|
289
292
|
|
|
290
293
|
session = response.parse() # get the object that `sessions.create()` would have returned
|
|
291
|
-
print(session
|
|
294
|
+
print(session)
|
|
292
295
|
```
|
|
293
296
|
|
|
294
297
|
These methods return an [`APIResponse`](https://github.com/browserbase/sdk-python/tree/main/src/browserbase/_response.py) object.
|
|
@@ -414,7 +417,7 @@ print(browserbase.__version__)
|
|
|
414
417
|
|
|
415
418
|
## Requirements
|
|
416
419
|
|
|
417
|
-
Python 3.
|
|
420
|
+
Python 3.9 or higher.
|
|
418
421
|
|
|
419
422
|
## Contributing
|
|
420
423
|
|
|
@@ -16,11 +16,11 @@ before making any information public.
|
|
|
16
16
|
## Reporting Non-SDK Related Security Issues
|
|
17
17
|
|
|
18
18
|
If you encounter security issues that are not directly related to SDKs but pertain to the services
|
|
19
|
-
or products provided by Browserbase please follow the respective company's security reporting guidelines.
|
|
19
|
+
or products provided by Browserbase, please follow the respective company's security reporting guidelines.
|
|
20
20
|
|
|
21
21
|
### Browserbase Terms and Policies
|
|
22
22
|
|
|
23
|
-
Please contact support@browserbase.com for any questions or concerns regarding security of our services.
|
|
23
|
+
Please contact support@browserbase.com for any questions or concerns regarding the security of our services.
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
@@ -11,6 +11,7 @@ Methods:
|
|
|
11
11
|
- <code title="post /v1/contexts">client.contexts.<a href="./src/browserbase/resources/contexts.py">create</a>(\*\*<a href="src/browserbase/types/context_create_params.py">params</a>) -> <a href="./src/browserbase/types/context_create_response.py">ContextCreateResponse</a></code>
|
|
12
12
|
- <code title="get /v1/contexts/{id}">client.contexts.<a href="./src/browserbase/resources/contexts.py">retrieve</a>(id) -> <a href="./src/browserbase/types/context.py">Context</a></code>
|
|
13
13
|
- <code title="put /v1/contexts/{id}">client.contexts.<a href="./src/browserbase/resources/contexts.py">update</a>(id) -> <a href="./src/browserbase/types/context_update_response.py">ContextUpdateResponse</a></code>
|
|
14
|
+
- <code title="delete /v1/contexts/{id}">client.contexts.<a href="./src/browserbase/resources/contexts.py">delete</a>(id) -> None</code>
|
|
14
15
|
|
|
15
16
|
# Extensions
|
|
16
17
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
errors=()
|
|
4
4
|
|
|
5
5
|
if [ -z "${PYPI_TOKEN}" ]; then
|
|
6
|
-
errors+=("The
|
|
6
|
+
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
|
|
7
7
|
fi
|
|
8
8
|
|
|
9
9
|
lenErrors=${#errors[@]}
|
|
@@ -47,7 +47,7 @@ def zip_extension(path: Path = PATH_TO_EXTENSION, save_local: bool = False) -> B
|
|
|
47
47
|
|
|
48
48
|
def create_extension() -> str:
|
|
49
49
|
zip_data = zip_extension(save_local=True)
|
|
50
|
-
extension
|
|
50
|
+
extension = bb.extensions.create(file=("extension.zip", zip_data.getvalue()))
|
|
51
51
|
return extension.id
|
|
52
52
|
|
|
53
53
|
|