From 4caed545e5030460b2d5e46f9ad90546ce36f0ee Mon Sep 17 00:00:00 2001 From: Marco Vinciguerra Date: Wed, 31 Jul 2024 19:49:59 +0200 Subject: [PATCH 1/2] feat: intregration of firebase --- pyproject.toml | 1 + scrapegraphai/docloaders/__init__.py | 1 + scrapegraphai/docloaders/broswer_base.py | 46 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 scrapegraphai/docloaders/broswer_base.py diff --git a/pyproject.toml b/pyproject.toml index 77d48e36..2738bfd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dependencies = [ "langchain-fireworks>=0.1.3", "langchain-community>=0.2.9", "langchain-huggingface>=0.0.3", + "browserbase==0.3.0" ] license = "MIT" diff --git a/scrapegraphai/docloaders/__init__.py b/scrapegraphai/docloaders/__init__.py index a9e45407..0efdc879 100644 --- a/scrapegraphai/docloaders/__init__.py +++ b/scrapegraphai/docloaders/__init__.py @@ -1,3 +1,4 @@ """__init__.py file for docloaders folder""" from .chromium import ChromiumLoader +from .broswer_base import browser_base_fetch \ No newline at end of file diff --git a/scrapegraphai/docloaders/broswer_base.py b/scrapegraphai/docloaders/broswer_base.py new file mode 100644 index 00000000..6127c097 --- /dev/null +++ b/scrapegraphai/docloaders/broswer_base.py @@ -0,0 +1,46 @@ +""" +browserbase integration module +""" +from browserbase import Browserbase + +def browser_base_fetch(api_key: str, project_id: str, link: str) -> object: + """ + BrowserBase Fetch + + This module provides an interface to the BrowserBase API. + + The `browser_base_fetch` function takes three arguments: + - `api_key`: The API key provided by BrowserBase. + - `project_id`: The ID of the project on BrowserBase where you want to fetch data from. + - `link`: The URL or link that you want to fetch data from. + + It initializes a Browserbase object with the given API key and project ID, + then uses this object to load the specified link. It returns the result of the loading operation. + + Example usage: + + ``` + from browser_base_fetch import browser_base_fetch + + result = browser_base_fetch(api_key="your_api_key", + project_id="your_project_id", link="https://example.com") + print(result) + ``` + + Please note that you need to replace "your_api_key" and "your_project_id" + with your actual BrowserBase API key and project ID. + + Args: + api_key (str): The API key provided by BrowserBase. + project_id (str): The ID of the project on BrowserBase where you want to fetch data from. + link (str): The URL or link that you want to fetch data from. + + Returns: + object: The result of the loading operation. + """ + + browserbase = Browserbase(api_key=api_key, project_id=project_id) + + result = browserbase.load(link) + + return result From 74ed8d06c5db4f9734521c2f84f4379b18b7308f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 31 Jul 2024 17:51:22 +0000 Subject: [PATCH 2/2] ci(release): 1.11.0-beta.6 [skip ci] ## [1.11.0-beta.6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.11.0-beta.5...v1.11.0-beta.6) (2024-07-31) ### Features * intregration of firebase ([4caed54](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/4caed545e5030460b2d5e46f9ad90546ce36f0ee)) --- CHANGELOG.md | 7 +++++++ pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d7b4c62..53e36c8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.11.0-beta.6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.11.0-beta.5...v1.11.0-beta.6) (2024-07-31) + + +### Features + +* intregration of firebase ([4caed54](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/4caed545e5030460b2d5e46f9ad90546ce36f0ee)) + ## [1.11.0-beta.5](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.11.0-beta.4...v1.11.0-beta.5) (2024-07-30) diff --git a/pyproject.toml b/pyproject.toml index 2738bfd6..4a7fe29f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "scrapegraphai" -version = "1.11.0b5" +version = "1.11.0b6" description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines." authors = [