Skip to content

Commit 7e77189

Browse files
committed
style: apply black formatting to all files
1 parent bb06cba commit 7e77189

File tree

128 files changed

+4355
-4453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+4355
-4453
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
requires = ["setuptools>=68.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools.packages.find]
6+
where = ["src"]
7+
58
[project]
69
name = "brightdata-sdk"
710
version = "2.0.0"

setup.py

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,84 @@ def read_readme():
1313
with open("README.md", "r", encoding="utf-8") as fh:
1414
return fh.read()
1515

16-
# Read version from __init__.py
16+
# Read version from src/brightdata/__init__.py (src layout)
1717
def read_version():
18-
with open(os.path.join("brightdata", "__init__.py"), "r", encoding="utf-8") as fh:
19-
for line in fh:
20-
if line.startswith("__version__"):
21-
return line.split('"')[1]
22-
return "1.0.0"
18+
version_file = os.path.join("src", "brightdata", "__init__.py")
19+
if os.path.exists(version_file):
20+
with open(version_file, "r", encoding="utf-8") as fh:
21+
for line in fh:
22+
if line.startswith("__version__"):
23+
return line.split('"')[1]
24+
# Fallback to _version.py
25+
version_file = os.path.join("src", "brightdata", "_version.py")
26+
if os.path.exists(version_file):
27+
with open(version_file, "r", encoding="utf-8") as fh:
28+
for line in fh:
29+
if line.startswith("__version__"):
30+
return line.split('"')[1]
31+
return "2.0.0"
2332

2433
setup(
2534
name="brightdata-sdk",
2635
version=read_version(),
2736
author="Bright Data",
2837
author_email="[email protected]",
29-
description="Python SDK for Bright Data Web Scraping and SERP APIs",
38+
description="Modern async-first Python SDK for Bright Data Web Scraping, SERP, and Platform APIs",
3039
long_description=read_readme(),
3140
long_description_content_type="text/markdown",
32-
url="https://github.com/brightdata/brightdata-sdk-python",
33-
packages=find_packages(),
41+
url="https://github.com/brightdata/sdk-python",
42+
package_dir={"": "src"},
43+
packages=find_packages(where="src"),
3444
classifiers=[
35-
"Development Status :: 4 - Beta",
45+
"Development Status :: 5 - Production/Stable",
3646
"Intended Audience :: Developers",
47+
"Intended Audience :: Science/Research",
3748
"License :: OSI Approved :: MIT License",
3849
"Operating System :: OS Independent",
3950
"Programming Language :: Python :: 3",
40-
"Programming Language :: Python :: 3.7",
41-
"Programming Language :: Python :: 3.8",
4251
"Programming Language :: Python :: 3.9",
4352
"Programming Language :: Python :: 3.10",
4453
"Programming Language :: Python :: 3.11",
4554
"Programming Language :: Python :: 3.12",
4655
"Topic :: Internet :: WWW/HTTP",
4756
"Topic :: Software Development :: Libraries :: Python Modules",
4857
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
58+
"Topic :: Scientific/Engineering :: Information Analysis",
59+
"Typing :: Typed",
4960
],
50-
python_requires=">=3.7",
61+
python_requires=">=3.9",
5162
install_requires=[
63+
"aiohttp>=3.8.0",
5264
"requests>=2.25.0",
5365
"python-dotenv>=0.19.0",
5466
],
5567
extras_require={
5668
"dev": [
57-
"pytest>=6.0.0",
58-
"pytest-cov>=2.10.0",
59-
"black>=21.0.0",
69+
"pytest>=7.0.0",
70+
"pytest-cov>=4.0.0",
71+
"pytest-asyncio>=0.21.0",
72+
"black>=23.0.0",
6073
"isort>=5.0.0",
61-
"flake8>=3.8.0",
74+
"flake8>=6.0.0",
75+
"mypy>=1.0.0",
76+
],
77+
"notebooks": [
78+
"jupyter>=1.0.0",
79+
"pandas>=1.5.0",
80+
"matplotlib>=3.5.0",
81+
"tqdm>=4.64.0",
82+
],
83+
},
84+
entry_points={
85+
"console_scripts": [
86+
"brightdata=brightdata.cli.main:main",
6287
],
6388
},
64-
keywords="brightdata, web scraping, proxy, serp, api, data extraction",
89+
keywords="brightdata, web scraping, proxy, serp, api, data extraction, async, pandas, jupyter",
6590
project_urls={
66-
"Bug Reports": "https://github.com/brightdata/brightdata-sdk-python/issues",
67-
"Documentation": "https://github.com/brightdata/brightdata-sdk-python#readme",
68-
"Source": "https://github.com/brightdata/brightdata-sdk-python",
91+
"Bug Reports": "https://github.com/brightdata/sdk-python/issues",
92+
"Documentation": "https://github.com/brightdata/sdk-python#readme",
93+
"Source": "https://github.com/brightdata/sdk-python",
94+
"Changelog": "https://github.com/brightdata/sdk-python/blob/main/CHANGELOG.md",
6995
},
70-
)
96+
)
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Private implementation details."""
2-

src/brightdata/_internal/compat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Python version compatibility (if needed)."""
2-

src/brightdata/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version information."""
2-
__version__ = "2.0.0"
32

3+
__version__ = "2.0.0"

src/brightdata/api/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""API implementations."""
2-

src/brightdata/api/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,34 @@
99
class BaseAPI(ABC):
1010
"""
1111
Base class for all API implementations.
12-
12+
1313
Provides common structure and async/sync wrapper pattern
1414
for all API service classes.
1515
"""
16-
16+
1717
def __init__(self, engine: AsyncEngine):
1818
"""
1919
Initialize base API.
20-
20+
2121
Args:
2222
engine: AsyncEngine instance for HTTP operations.
2323
"""
2424
self.engine = engine
25-
25+
2626
@abstractmethod
2727
async def _execute_async(self, *args: Any, **kwargs: Any) -> Any:
2828
"""
2929
Execute API operation asynchronously.
30-
30+
3131
This method should be implemented by subclasses to perform
3232
the actual async API operation.
3333
"""
3434
pass
35-
35+
3636
def _execute_sync(self, *args: Any, **kwargs: Any) -> Any:
3737
"""
3838
Execute API operation synchronously.
39-
39+
4040
Wraps async method using asyncio.run() for sync compatibility.
4141
"""
4242
try:
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Browser API."""
2-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Main browser API."""
2-
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Connection pooling."""
2-

0 commit comments

Comments
 (0)