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..5f4d0be 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://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://docs.scrapegraphai.com/transition-from-v1-to-v2" + ) + # 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..7d809a7 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://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://docs.scrapegraphai.com/transition-from-v1-to-v2" + ) + # Try to get API key from environment if not provided if api_key is None: from os import getenv