Skip to content

Commit b74f2d0

Browse files
VinciGit00claude
andcommitted
chore: add deprecation notice for v1.x and bump to 1.12.3
The current v1.x SDK will be deprecated in favor of v2.x which introduces a new API surface. This adds a DeprecationWarning and logger warning on client initialization to notify users of the upcoming migration. See: #82 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6485c94 commit b74f2d0

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

scrapegraph-py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "scrapegraph_py"
3-
version = "1.12.2"
3+
version = "1.12.3"
44
description = "ScrapeGraph Python SDK for API"
55
authors = [
66
{ name = "Marco Vinciguerra", email = "marco@scrapegraphai.com" },

scrapegraph-py/scrapegraph_py/async_client.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
>>> asyncio.run(main())
3535
"""
3636
import asyncio
37+
import warnings
3738
from typing import Any, Dict, Optional, Callable
3839

3940
from aiohttp import ClientSession, ClientTimeout, TCPConnector
@@ -173,6 +174,19 @@ def __init__(
173174
"""
174175
logger.info("🔑 Initializing AsyncClient")
175176

177+
warnings.warn(
178+
"scrapegraph-py v1.x is deprecated and will be removed in a future release. "
179+
"Please upgrade to scrapegraph-py v2.x for the new API surface. "
180+
"See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82",
181+
DeprecationWarning,
182+
stacklevel=2,
183+
)
184+
logger.warning(
185+
"scrapegraph-py v1.x is deprecated and will be removed in a future release. "
186+
"Please upgrade to scrapegraph-py v2.x for the new API surface. "
187+
"Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82"
188+
)
189+
176190
# Try to get API key from environment if not provided
177191
if api_key is None:
178192
from os import getenv

scrapegraph-py/scrapegraph_py/client.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
... result = client.scrape(website_url="https://example.com")
2828
"""
2929
import uuid as _uuid
30+
import warnings
3031
from typing import Any, Callable, Dict, Optional
3132
from urllib.parse import urlparse
3233

@@ -178,6 +179,19 @@ def __init__(
178179
"""
179180
logger.info("🔑 Initializing Client")
180181

182+
warnings.warn(
183+
"scrapegraph-py v1.x is deprecated and will be removed in a future release. "
184+
"Please upgrade to scrapegraph-py v2.x for the new API surface. "
185+
"See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82",
186+
DeprecationWarning,
187+
stacklevel=2,
188+
)
189+
logger.warning(
190+
"scrapegraph-py v1.x is deprecated and will be removed in a future release. "
191+
"Please upgrade to scrapegraph-py v2.x for the new API surface. "
192+
"Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82"
193+
)
194+
181195
# Try to get API key from environment if not provided
182196
if api_key is None:
183197
from os import getenv

0 commit comments

Comments
 (0)