Skip to content

Commit b9e3159

Browse files
authored
Merge pull request #83 from ScrapeGraphAI/chore/deprecation-notice-v1
chore: deprecation notice for v1.x SDK
2 parents 97c7898 + 0c58efb commit b9e3159

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

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://docs.scrapegraphai.com/transition-from-v1-to-v2",
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://docs.scrapegraphai.com/transition-from-v1-to-v2"
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://docs.scrapegraphai.com/transition-from-v1-to-v2",
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://docs.scrapegraphai.com/transition-from-v1-to-v2"
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)