From 9e611f4ca2b9927eaa0a06a4edeb06cb8fe8c7d5 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 4 Dec 2023 21:52:08 -0800 Subject: [PATCH 1/3] fix api_key reference issue --- src/webtranspose/search.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/webtranspose/search.py b/src/webtranspose/search.py index aea0af9..aa56a10 100644 --- a/src/webtranspose/search.py +++ b/src/webtranspose/search.py @@ -3,8 +3,17 @@ from .webt_api import run_webt_api +def search(query, api_key=None) -> dict: + """ + Search for a query using the Web Transpose API. -def search(query): + Args: + query (str): The query to search for. + api_key (str, optional): The API key to use for authentication. Defaults to None. + + Returns: + dict: The search results. + """ if api_key is None: api_key = os.environ.get("WEBTRANSPOSE_API_KEY") @@ -21,7 +30,17 @@ def search(query): raise ValueError("Must provide api_key or set WEBTRANSPOSE_API_KEY in environment variables.") -def search_filter(query): +def search_filter(query, api_key=None) -> dict: + """ + Search for a query using the Web Transpose API with filtering. + + Args: + query (str): The query to search for. + api_key (str, optional): The API key to use for authentication. Defaults to None. + + Returns: + dict: The filtered search results. + """ if api_key is None: api_key = os.environ.get("WEBTRANSPOSE_API_KEY") From b51790ba5116cdc9010b043aed342ba6a6a91139 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 4 Dec 2023 21:53:23 -0800 Subject: [PATCH 2/3] bump version --- pyproject.toml | 4 ++-- src/webtranspose/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6e934c..e5e352f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.poetry] name = "webtranspose" -version = "0.3.0" -description = "APIs for the internet" +version = "0.3.1" +description = "Reliable APIs for the website data" authors = ["Mike Gee "] readme = "README.md" diff --git a/src/webtranspose/__init__.py b/src/webtranspose/__init__.py index e4f2fa5..5a9fe5c 100644 --- a/src/webtranspose/__init__.py +++ b/src/webtranspose/__init__.py @@ -2,7 +2,7 @@ __author__ = """Mike Gee""" __email__ = "mike@webtranspose.com" -__version__ = "0.3.0" +__version__ = "0.3.1" from .chat import * from .crawl import * From 463d5d8900b9e6eb2955965c418b1356b055333c Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 4 Dec 2023 21:54:00 -0800 Subject: [PATCH 3/3] language --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4be80fe..1abed59 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ scraper = webt.Scraper( out_json = scraper.scrape("https://www.example.com") ``` -## Web Search (SERP API) +## Web Search (AI SERP API) ```python import webtranspose as webt