Skip to content

Commit 448cc3a

Browse files
עידן וילנסקיעידן וילנסקי
authored andcommitted
Update version to
1.0.3 - Fix GitHub Actions workflow deprecation - Update country code validation - Add missing changelog entries
1 parent 569e115 commit 448cc3a

File tree

8 files changed

+45
-24
lines changed

8 files changed

+45
-24
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: python -m build
3131

3232
- name: Upload build artifacts
33-
uses: actions/upload-artifact@v3
33+
uses: actions/upload-artifact@v4
3434
with:
3535
name: dist-files
3636
path: dist/
@@ -54,7 +54,7 @@ jobs:
5454
python-version: '3.8'
5555

5656
- name: Download build artifacts
57-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5858
with:
5959
name: dist-files
6060
path: dist/

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ 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.3] - 2025-08-19
9+
10+
### Fixed
11+
- Updated GitHub Actions workflow to use `actions/upload-artifact@v4` and `actions/download-artifact@v4` to resolve CI/CD pipeline failures
12+
- Fixed deprecated action versions that were causing automatic build failures
13+
14+
### Changed
15+
- Enhanced `validate_country_code()` function to accept both 2-letter ISO country codes and empty strings
16+
- Improved validation flexibility for country code parameters
17+
18+
## [1.0.2] - 2025-08-18
19+
20+
### Fixed
21+
- Resolved issues with zone opening functionality
22+
- Fixed zone management and configuration problems
23+
24+
### Added
25+
- Created comprehensive test units for improved code reliability
26+
- Added unit tests for core SDK functionality
27+
828
## [1.0.1] - 2025-08-11
929

1030
### Changed

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.2"
35+
__version__ = "1.0.3"
3636
__author__ = "Bright Data"
3737
__email__ = "[email protected]"
3838

brightdata/api/scraper.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ def scrape(
2626
self,
2727
url: Union[str, List[str]],
2828
zone: str,
29-
response_format: str = "json",
29+
response_format: str = "raw",
3030
method: str = "GET",
31-
country: str = "us",
31+
country: str = "",
3232
data_format: str = "markdown",
3333
async_request: bool = False,
3434
max_workers: int = 10,
@@ -42,10 +42,10 @@ def scrape(
4242
**Parameters:**
4343
- `url` (str | List[str]): Single URL string or list of URLs to scrape
4444
- `zone` (str): Your Bright Data zone identifier
45-
- `response_format` (str, optional): Response format - `"json"` for structured data, `"raw"` for HTML string (default: `"json"`)
45+
- `response_format` (str, optional): Response format - `"json"` for structured data, `"raw"` for HTML string (default: `"raw"`)
4646
- `method` (str, optional): HTTP method for the request (default: `"GET"`)
4747
- `country` (str, optional): Two-letter ISO country code for proxy location (default: `"us"`)
48-
- `data_format` (str, optional): Additional format transformation (default: `"markdown"`)
48+
- `data_format` (str, optional): Additional format transformation (default: `"html"`)
4949
- `async_request` (bool, optional): Enable asynchronous processing (default: `False`)
5050
- `max_workers` (int, optional): Maximum parallel workers for multiple URLs (default: `10`)
5151
- `timeout` (int, optional): Request timeout in seconds (default: `30`)
@@ -142,7 +142,6 @@ def _perform_single_scrape(
142142
"url": url,
143143
"format": response_format,
144144
"method": method,
145-
"country": country,
146145
"data_format": data_format
147146
}
148147

brightdata/api/search.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def search(
2929
query: Union[str, List[str]],
3030
search_engine: str = "google",
3131
zone: str = None,
32-
response_format: str = "json",
32+
response_format: str = "raw",
3333
method: str = "GET",
34-
country: str = "us",
34+
country: str = "",
3535
data_format: str = "markdown",
3636
async_request: bool = False,
3737
max_workers: int = 10,
@@ -47,7 +47,7 @@ def search(
4747
- `query` (str | List[str]): Search query string or list of search queries
4848
- `search_engine` (str, optional): Search engine to use - `"google"`, `"bing"`, or `"yandex"` (default: `"google"`)
4949
- `zone` (str, optional): Your Bright Data zone identifier (default: `None`)
50-
- `response_format` (str, optional): Response format - `"json"` for structured data, `"raw"` for HTML string (default: `"json"`)
50+
- `response_format` (str, optional): Response format - `"json"` for structured data, `"raw"` for HTML string (default: `"raw"`)
5151
- `method` (str, optional): HTTP method for the request (default: `"GET"`)
5252
- `country` (str, optional): Two-letter ISO country code for proxy location (default: `"us"`)
5353
- `data_format` (str, optional): Additional format transformation (default: `"markdown"`)
@@ -161,7 +161,6 @@ def _perform_single_search(
161161
"url": url,
162162
"format": response_format,
163163
"method": method,
164-
"country": country,
165164
"data_format": data_format
166165
}
167166

brightdata/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ def scrape(
138138
self,
139139
url: Union[str, List[str]],
140140
zone: str = None,
141-
response_format: str = "json",
141+
response_format: str = "raw",
142142
method: str = "GET",
143-
country: str = "us",
143+
country: str = "",
144144
data_format: str = "markdown",
145145
async_request: bool = False,
146146
max_workers: int = None,
@@ -156,7 +156,7 @@ def scrape(
156156
- `zone` (str, optional): Zone identifier (default: auto-configured web_unlocker_zone)
157157
- `response_format` (str, optional): Response format - `"json"` for structured data, `"raw"` for HTML string (default: `"json"`)
158158
- `method` (str, optional): HTTP method for the request (default: `"GET"`)
159-
- `country` (str, optional): Two-letter ISO country code for proxy location (default: `"us"`)
159+
- `country` (str, optional): Two-letter ISO country code for proxy location (defaults to fastest connection)
160160
- `data_format` (str, optional): Additional format transformation (default: `"markdown"`)
161161
- `async_request` (bool, optional): Enable asynchronous processing (default: `False`)
162162
- `max_workers` (int, optional): Maximum parallel workers for multiple URLs (default: `10`)
@@ -201,9 +201,9 @@ def search(
201201
query: Union[str, List[str]],
202202
search_engine: str = "google",
203203
zone: str = None,
204-
response_format: str = "json",
204+
response_format: str = "raw",
205205
method: str = "GET",
206-
country: str = "us",
206+
country: str = "",
207207
data_format: str = "markdown",
208208
async_request: bool = False,
209209
max_workers: int = None,

brightdata/utils/validation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ def validate_country_code(country: str) -> None:
6666
raise ValidationError(f"Country code must be a string, got {type(country).__name__}")
6767

6868
country = country.strip().lower()
69+
if len(country) == 0:
70+
return
71+
6972
if len(country) != 2:
70-
raise ValidationError("Country code must be exactly 2 characters (ISO 3166-1 alpha-2)")
73+
raise ValidationError("Country code must be exactly 2 characters (ISO 3166-1 alpha-2) or empty")
7174

7275
if not country.isalpha():
7376
raise ValidationError("Country code must contain only letters")

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "brightdata-sdk"
7-
version = "1.0.2"
7+
version = "1.0.3"
88
description = "Python SDK for Bright Data Web Scraping and SERP APIs"
99
authors = [
1010
{name = "Bright Data", email = "[email protected]"}
@@ -52,11 +52,11 @@ test = [
5252
]
5353

5454
[project.urls]
55-
Homepage = "https://github.com/brightdata/brightdata-sdk-python"
56-
Documentation = "https://github.com/brightdata/brightdata-sdk-python#readme"
57-
Repository = "https://github.com/brightdata/brightdata-sdk-python"
58-
"Bug Reports" = "https://github.com/brightdata/brightdata-sdk-python/issues"
59-
Changelog = "https://github.com/brightdata/brightdata-sdk-python/blob/main/CHANGELOG.md"
55+
Homepage = "https://github.com/brightdata/bright-data-sdk-python"
56+
Documentation = "https://github.com/brightdata/bright-data-sdk-python#readme"
57+
Repository = "https://github.com/brightdata/bright-data-sdk-python"
58+
"Bug Reports" = "https://github.com/brightdata/bright-data-sdk-python/issues"
59+
Changelog = "https://github.com/brightdata/bright-data-sdk-python/blob/main/CHANGELOG.md"
6060

6161
[tool.setuptools.packages.find]
6262
include = ["brightdata*"]

0 commit comments

Comments
 (0)