From b74f2d0f11634a34db097439a9cca503b3119416 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Wed, 8 Apr 2026 19:46:29 +0200 Subject: [PATCH 1/2] 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: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82 Co-Authored-By: Claude Opus 4.6 (1M context) --- scrapegraph-py/pyproject.toml | 2 +- scrapegraph-py/scrapegraph_py/async_client.py | 14 ++++++++++++++ scrapegraph-py/scrapegraph_py/client.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/scrapegraph-py/pyproject.toml b/scrapegraph-py/pyproject.toml index 95ec2db..e662275 100644 --- a/scrapegraph-py/pyproject.toml +++ b/scrapegraph-py/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scrapegraph_py" -version = "1.12.2" +version = "1.12.3" description = "ScrapeGraph Python SDK for API" authors = [ { name = "Marco Vinciguerra", email = "marco@scrapegraphai.com" }, diff --git a/scrapegraph-py/scrapegraph_py/async_client.py b/scrapegraph-py/scrapegraph_py/async_client.py index 5111849..be4c684 100644 --- a/scrapegraph-py/scrapegraph_py/async_client.py +++ b/scrapegraph-py/scrapegraph_py/async_client.py @@ -34,6 +34,7 @@ >>> asyncio.run(main()) """ import asyncio +import warnings from typing import Any, Dict, Optional, Callable from aiohttp import ClientSession, ClientTimeout, TCPConnector @@ -173,6 +174,19 @@ def __init__( """ logger.info("🔑 Initializing AsyncClient") + warnings.warn( + "scrapegraph-py v1.x is deprecated and will be removed in a future release. " + "Please upgrade to scrapegraph-py v2.x for the new API surface. " + "See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82", + DeprecationWarning, + stacklevel=2, + ) + logger.warning( + "scrapegraph-py v1.x is deprecated and will be removed in a future release. " + "Please upgrade to scrapegraph-py v2.x for the new API surface. " + "Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82" + ) + # Try to get API key from environment if not provided if api_key is None: from os import getenv diff --git a/scrapegraph-py/scrapegraph_py/client.py b/scrapegraph-py/scrapegraph_py/client.py index 28fc1bf..02c767c 100644 --- a/scrapegraph-py/scrapegraph_py/client.py +++ b/scrapegraph-py/scrapegraph_py/client.py @@ -27,6 +27,7 @@ ... result = client.scrape(website_url="https://example.com") """ import uuid as _uuid +import warnings from typing import Any, Callable, Dict, Optional from urllib.parse import urlparse @@ -178,6 +179,19 @@ def __init__( """ logger.info("🔑 Initializing Client") + warnings.warn( + "scrapegraph-py v1.x is deprecated and will be removed in a future release. " + "Please upgrade to scrapegraph-py v2.x for the new API surface. " + "See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82", + DeprecationWarning, + stacklevel=2, + ) + logger.warning( + "scrapegraph-py v1.x is deprecated and will be removed in a future release. " + "Please upgrade to scrapegraph-py v2.x for the new API surface. " + "Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82" + ) + # Try to get API key from environment if not provided if api_key is None: from os import getenv From 36c102dbd06ee17803dcf99c1bd627a9f206f904 Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Wed, 8 Apr 2026 19:50:53 +0200 Subject: [PATCH 2/2] fix: update deprecation notice URL to official docs Co-Authored-By: Claude Opus 4.6 (1M context) --- scrapegraph-py/scrapegraph_py/async_client.py | 4 ++-- scrapegraph-py/scrapegraph_py/client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scrapegraph-py/scrapegraph_py/async_client.py b/scrapegraph-py/scrapegraph_py/async_client.py index be4c684..5f4d0be 100644 --- a/scrapegraph-py/scrapegraph_py/async_client.py +++ b/scrapegraph-py/scrapegraph_py/async_client.py @@ -177,14 +177,14 @@ def __init__( warnings.warn( "scrapegraph-py v1.x is deprecated and will be removed in a future release. " "Please upgrade to scrapegraph-py v2.x for the new API surface. " - "See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82", + "See migration guide: https://docs.scrapegraphai.com/transition-from-v1-to-v2", DeprecationWarning, stacklevel=2, ) logger.warning( "scrapegraph-py v1.x is deprecated and will be removed in a future release. " "Please upgrade to scrapegraph-py v2.x for the new API surface. " - "Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82" + "Migration guide: https://docs.scrapegraphai.com/transition-from-v1-to-v2" ) # Try to get API key from environment if not provided diff --git a/scrapegraph-py/scrapegraph_py/client.py b/scrapegraph-py/scrapegraph_py/client.py index 02c767c..7d809a7 100644 --- a/scrapegraph-py/scrapegraph_py/client.py +++ b/scrapegraph-py/scrapegraph_py/client.py @@ -182,14 +182,14 @@ def __init__( warnings.warn( "scrapegraph-py v1.x is deprecated and will be removed in a future release. " "Please upgrade to scrapegraph-py v2.x for the new API surface. " - "See migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82", + "See migration guide: https://docs.scrapegraphai.com/transition-from-v1-to-v2", DeprecationWarning, stacklevel=2, ) logger.warning( "scrapegraph-py v1.x is deprecated and will be removed in a future release. " "Please upgrade to scrapegraph-py v2.x for the new API surface. " - "Migration guide: https://github.com/ScrapeGraphAI/scrapegraph-py/pull/82" + "Migration guide: https://docs.scrapegraphai.com/transition-from-v1-to-v2" ) # Try to get API key from environment if not provided