Skip to content

Commit be88a80

Browse files
עידן וילנסקיעידן וילנסקי
authored andcommitted
Release v1.0.1: Replace browser_zone with serp_zone parameter
- Replace browser_zone with serp_zone in bdclient constructor - Enable serp_zone configuration directly from client - Add admin permissions requirement in docstring - Update documentation, examples, and tests - Version bump to 1.0.1
1 parent 50f411a commit be88a80

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.1] - 2025-08-11
9+
10+
### Changed
11+
- Replaced `browser_zone` parameter with `serp_zone` parameter in `bdclient` constructor
12+
- `serp_zone` can now be configured directly from the client instead of only via environment variable
13+
- Updated documentation and tests to reflect the parameter change
14+
15+
### Removed
16+
- `browser_zone` parameter from `bdclient` constructor (was unused in the codebase)
17+
818
## [1.0.0] - 2024-08-10
919

1020
### Added

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ Or you can use a custom zone name
5353
client = bdclient(
5454
api_token="your_token",
5555
auto_create_zones=False, # Else it creates the Zone automatically
56-
web_unlocker_zone="custom_zone", # Custom zone name (serp_zone for search requests)
56+
web_unlocker_zone="custom_zone", # Custom zone name for web scraping
57+
serp_zone="custom_serp_zone" # Custom zone name for search requests
5758
)
5859
```
5960
> [!TIP]

brightdata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
APIError
3333
)
3434

35-
__version__ = "1.0.0"
35+
__version__ = "1.0.1"
3636
__author__ = "Bright Data"
3737
__email__ = "[email protected]"
3838

brightdata/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .utils import ZoneManager, setup_logging, get_logger
99
from .exceptions import ValidationError, AuthenticationError, APIError
1010

11-
__version__ = "1.0.0"
11+
__version__ = "1.0.1"
1212

1313
logger = get_logger('client')
1414

@@ -28,7 +28,7 @@ def __init__(
2828
api_token: str = None,
2929
auto_create_zones: bool = True,
3030
web_unlocker_zone: str = None,
31-
browser_zone: str = None,
31+
serp_zone: str = None,
3232
log_level: str = "INFO",
3333
structured_logging: bool = True,
3434
verbose: bool = None
@@ -37,12 +37,13 @@ def __init__(
3737
Initialize the Bright Data client with your API token
3838
3939
Create an account at https://brightdata.com/ to get your API token.
40+
Go to settings > API keys , and verify that your API key have "Admin" permissions.
4041
4142
Args:
4243
api_token: Your Bright Data API token (can also be set via BRIGHTDATA_API_TOKEN env var)
4344
auto_create_zones: Automatically create required zones if they don't exist (default: True)
4445
web_unlocker_zone: Custom zone name for web unlocker (default: from env or 'sdk_unlocker')
45-
browser_zone: Custom zone name for browser API (default: from env or 'sdk_browser')
46+
serp_zone: Custom zone name for SERP API (default: from env or 'sdk_serp')
4647
log_level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
4748
structured_logging: Whether to use structured JSON logging (default: True)
4849
verbose: Enable verbose logging (default: False). Can also be set via BRIGHTDATA_VERBOSE env var.
@@ -78,8 +79,7 @@ def __init__(
7879
logger.info(f"API token validated successfully: {token_preview}")
7980

8081
self.web_unlocker_zone = web_unlocker_zone or os.getenv('WEB_UNLOCKER_ZONE', 'sdk_unlocker')
81-
self.browser_zone = browser_zone or os.getenv('BROWSER_ZONE', 'sdk_browser')
82-
self.serp_zone = os.getenv('SERP_ZONE', 'sdk_serp')
82+
self.serp_zone = serp_zone or os.getenv('SERP_ZONE', 'sdk_serp')
8383
self.auto_create_zones = auto_create_zones
8484

8585
self.session = requests.Session()

examples/search_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from brightdata import bdclient
77

8-
client = bdclient(api_token="your-api-token") #can also be taken from .env file
8+
client = bdclient(api_token="your-api-key",auto_create_zones=False, serp_zone="your-custom-serp-zone") # zone and API token can also be defined in .env file
99

1010
query = ["iphone 16", "coffee maker", "portable projector", "sony headphones",
1111
"laptop stand", "power bank", "running shoes", "android tablet",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "brightdata"
7-
version = "1.0.0"
7+
version = "1.0.1"
88
description = "Python SDK for Bright Data Web Scraping and SERP APIs"
99
authors = [
1010
{name = "Bright Data", email = "[email protected]"}

tests/test_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def test_client_zone_defaults(self):
4141
with patch.dict(os.environ, {}, clear=True):
4242
client = bdclient(api_token="test_token", auto_create_zones=False)
4343
assert client.web_unlocker_zone == "sdk_unlocker"
44-
assert client.browser_zone == "sdk_browser"
4544
assert client.serp_zone == "sdk_serp"
4645

4746
def test_client_custom_zones(self):
@@ -50,11 +49,11 @@ def test_client_custom_zones(self):
5049
client = bdclient(
5150
api_token="test_token",
5251
web_unlocker_zone="custom_unlocker",
53-
browser_zone="custom_browser",
52+
serp_zone="custom_serp",
5453
auto_create_zones=False
5554
)
5655
assert client.web_unlocker_zone == "custom_unlocker"
57-
assert client.browser_zone == "custom_browser"
56+
assert client.serp_zone == "custom_serp"
5857

5958

6059
class TestClientMethods:

0 commit comments

Comments
 (0)