Python scraper based on AI
Python ai-crawlerai-scrapingai-searchcrawlerdata-extractionfirecrawl-alternativelarge-language-modelllmmarkdownragscrapingscraping-pythonweb-crawlerweb-crawlersweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
refactoring of the code changing the name
VinciGit002a234f2e4df5
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.ymlindex 59ae5c3e..ac818511 100644--- a/.github/workflows/pylint.yml+++ b/.github/workflows/pylint.yml@@ -21,4 +21,4 @@ jobs:pip install -r requirements.txt- name: Analysing the code with pylintrun: |- pylint --disable=C0114,C0115,C0116 --exit-zero yosoai/*.py yosoai/graphs/*.py yosoai/nodes/*.py examples/*.py tests/*.py+ pylint --disable=C0114,C0115,C0116 --exit-zero scrapegraphai/*.py scrapegraphai/graphs/*.py scrapegraphai/nodes/*.py examples/*.py tests/*.pydiff --git a/README.md b/README.mdindex c8feece7..a07461ff 100644--- a/README.md+++ b/README.md@@ -62,7 +62,7 @@ python -m yoso-ai.examples.html_scraping```pythonimport osfrom dotenv import load_dotenv-from yosoai import _get_function, send_request+from scrapegraphai import _get_function, send_requestload_dotenv()@@ -104,7 +104,7 @@ if __name__ == "__main__":```pythonimport osfrom dotenv import load_dotenv-from yosoai import send_request+from scrapegraphai import send_requestload_dotenv()@@ -195,7 +195,7 @@ The oputput format is a dict and its the following:# CreditsThanks to:-- [nicolapiazzalunga](https://github.com/nicolapiazzalunga): for inspiring yosoai/convert_to_csv.py and yosoai/convert_to_json.py functions+- [nicolapiazzalunga](https://github.com/nicolapiazzalunga): for inspiring scrapegraphai/convert_to_csv.py and scrapegraphai/convert_to_json.py functions# Developed bydiff --git a/docs/source/conf.py b/docs/source/conf.pyindex 0a96fc06..8c46d4c2 100644--- a/docs/source/conf.py+++ b/docs/source/conf.py@@ -8,12 +8,13 @@# -- Path setup ---------------------------------------------------------------import os, sys+import os+import sys# import all the modulessys.path.insert(0, os.path.abspath('../../'))-project = 'yosoai'+project = 'scrapegraphai'copyright = '2024, Marco Vinciguerra'author = 'Marco Vinciguerra'@@ -29,4 +30,4 @@ exclude_patterns = []# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-outputhtml_theme = 'sphinx_rtd_theme'-html_static_path = ['_static']\ No newline at end of file+html_static_path = ['_static']diff --git a/docs/source/modules/modules.rst b/docs/source/modules/modules.rstindex f8c06ef8..51204a86 100644--- a/docs/source/modules/modules.rst+++ b/docs/source/modules/modules.rst@@ -1,7 +1,7 @@-yosoai+scrapegraphai======.. toctree:::maxdepth: 4- yosoai+ scrapegraphaidiff --git a/docs/source/modules/yosoai.graphs.rst b/docs/source/modules/yosoai.graphs.rstindex 2ea044de..5d096474 100644--- a/docs/source/modules/yosoai.graphs.rst+++ b/docs/source/modules/yosoai.graphs.rst@@ -1,21 +1,21 @@-yosoai.graphs package+scrapegraphai.graphs package=====================Submodules-----------yosoai.graphs.base\_graph module+scrapegraphai.graphs.base\_graph module---------------------------------.. automodule:: yosoai.graphs.base_graph+.. automodule:: scrapegraphai.graphs.base_graph:members::undoc-members::show-inheritance:-yosoai.graphs.smart\_scraper\_graph module+scrapegraphai.graphs.smart\_scraper\_graph module-------------------------------------------.. automodule:: yosoai.graphs.smart_scraper_graph+.. automodule:: scrapegraphai.graphs.smart_scraper_graph:members::undoc-members::show-inheritance:@@ -23,7 +23,7 @@ yosoai.graphs.smart\_scraper\_graph moduleModule contents----------------.. automodule:: yosoai.graphs+.. automodule:: scrapegraphai.graphs:members::undoc-members::show-inheritance:diff --git a/docs/source/modules/yosoai.nodes.rst b/docs/source/modules/yosoai.nodes.rstindex 925f19ca..167f83fa 100644--- a/docs/source/modules/yosoai.nodes.rst+++ b/docs/source/modules/yosoai.nodes.rst@@ -1,53 +1,53 @@-yosoai.nodes package+scrapegraphai.nodes package====================Submodules-----------yosoai.nodes.base\_node module+scrapegraphai.nodes.base\_node module-------------------------------.. automodule:: yosoai.nodes.base_node+.. automodule:: scrapegraphai.nodes.base_node:members::undoc-members::show-inheritance:-yosoai.nodes.conditional\_node module+scrapegraphai.nodes.conditional\_node module--------------------------------------.. automodule:: yosoai.nodes.conditional_node+.. automodule:: scrapegraphai.nodes.conditional_node:members::undoc-members::show-inheritance:-yosoai.nodes.fetch\_html\_node module+scrapegraphai.nodes.fetch\_html\_node module--------------------------------------.. automodule:: yosoai.nodes.fetch_html_node+.. automodule:: scrapegraphai.nodes.fetch_html_node:members::undoc-members::show-inheritance:-yosoai.nodes.generate\_answer\_node module+scrapegraphai.nodes.generate\_answer\_node module-------------------------------------------.. automodule:: yosoai.nodes.generate_answer_node+.. automodule:: scrapegraphai.nodes.generate_answer_node:members::undoc-members::show-inheritance:-yosoai.nodes.get\_probable\_tags\_node module+scrapegraphai.nodes.get\_probable\_tags\_node module----------------------------------------------.. automodule:: yosoai.nodes.get_probable_tags_node+.. automodule:: scrapegraphai.nodes.get_probable_tags_node:members::undoc-members::show-inheritance:-yosoai.nodes.parse\_html\_node module+scrapegraphai.nodes.parse\_html\_node module--------------------------------------.. automodule:: yosoai.nodes.parse_html_node+.. automodule:: scrapegraphai.nodes.parse_html_node:members::undoc-members::show-inheritance:@@ -55,7 +55,7 @@ yosoai.nodes.parse\_html\_node moduleModule contents----------------.. automodule:: yosoai.nodes+.. automodule:: scrapegraphai.nodes:members::undoc-members::show-inheritance:diff --git a/docs/source/modules/yosoai.rst b/docs/source/modules/yosoai.rstindex 3556224d..43251cb3 100644--- a/docs/source/modules/yosoai.rst+++ b/docs/source/modules/yosoai.rst@@ -1,4 +1,4 @@-yosoai package+scrapegraphai package==============Subpackages@@ -7,96 +7,96 @@ Subpackages.. toctree:::maxdepth: 4- yosoai.graphs- yosoai.nodes+ scrapegraphai.graphs+ scrapegraphai.nodesSubmodules-----------yosoai.class\_creator module+scrapegraphai.class\_creator module-----------------------------.. automodule:: yosoai.class_creator+.. automodule:: scrapegraphai.class_creator:members::undoc-members::show-inheritance:-yosoai.class\_generator module+scrapegraphai.class\_generator module-------------------------------.. automodule:: yosoai.class_generator+.. automodule:: scrapegraphai.class_generator:members::undoc-members::show-inheritance:-yosoai.convert\_to\_csv module+scrapegraphai.convert\_to\_csv module-------------------------------.. automodule:: yosoai.convert_to_csv+.. automodule:: scrapegraphai.convert_to_csv:members::undoc-members::show-inheritance:-yosoai.convert\_to\_json module+scrapegraphai.convert\_to\_json module--------------------------------.. automodule:: yosoai.convert_to_json+.. automodule:: scrapegraphai.convert_to_json:members::undoc-members::show-inheritance:-yosoai.dictionaries module+scrapegraphai.dictionaries module---------------------------.. automodule:: yosoai.dictionaries+.. automodule:: scrapegraphai.dictionaries:members::undoc-members::show-inheritance:-yosoai.getter module+scrapegraphai.getter module---------------------.. automodule:: yosoai.getter+.. automodule:: scrapegraphai.getter:members::undoc-members::show-inheritance:-yosoai.json\_getter module+scrapegraphai.json\_getter module---------------------------.. automodule:: yosoai.json_getter+.. automodule:: scrapegraphai.json_getter:members::undoc-members::show-inheritance:-yosoai.pydantic\_class module+scrapegraphai.pydantic\_class module------------------------------.. automodule:: yosoai.pydantic_class+.. automodule:: scrapegraphai.pydantic_class:members::undoc-members::show-inheritance:-yosoai.remover module+scrapegraphai.remover module----------------------.. automodule:: yosoai.remover+.. automodule:: scrapegraphai.remover:members::undoc-members::show-inheritance:-yosoai.request module+scrapegraphai.request module----------------------.. automodule:: yosoai.request+.. automodule:: scrapegraphai.request:members::undoc-members::show-inheritance:-yosoai.token\_calculator module+scrapegraphai.token\_calculator module--------------------------------.. automodule:: yosoai.token_calculator+.. automodule:: scrapegraphai.token_calculator:members::undoc-members::show-inheritance:@@ -104,7 +104,7 @@ yosoai.token\_calculator moduleModule contents----------------.. automodule:: yosoai+.. automodule:: scrapegraphai:members::undoc-members::show-inheritance:diff --git a/examples/graph_example.py b/examples/graph_example.pyindex b275a1fb..16ab3a97 100644--- a/examples/graph_example.py+++ b/examples/graph_example.py@@ -3,7 +3,7 @@ Basic example for creating the node"""import osfrom dotenv import load_dotenv-from yosoai.graphs import SmartScraper+from scrapegraphai.graphs import SmartScraperload_dotenv()diff --git a/examples/html_scraping.py b/examples/html_scraping.pyindex 834e6347..b3cb658e 100644--- a/examples/html_scraping.py+++ b/examples/html_scraping.py@@ -3,7 +3,7 @@ Exmaple of scraper using just the HTML code"""import osfrom dotenv import load_dotenv-from yosoai import send_request+from scrapegraphai import send_requestload_dotenv()diff --git a/examples/value_scraping.py b/examples/value_scraping.pyindex 9ff00a8e..a670ce6e 100644--- a/examples/value_scraping.py+++ b/examples/value_scraping.py@@ -3,7 +3,7 @@ Example of scraping using just a link"""import osfrom dotenv import load_dotenv-from yosoai import _get_function, send_request+from scrapegraphai import _get_function, send_requestload_dotenv()diff --git a/yosoai/__init__.py b/scrapegraphai/__init__.pysimilarity index 81%rename from yosoai/__init__.pyrename to scrapegraphai/__init__.pyindex 794b4c65..16e539e0 100644--- a/yosoai/__init__.py+++ b/scrapegraphai/__init__.py@@ -1,5 +1,5 @@"""- __init__.py file for yosoai folder+ __init__.py file for scrapegraphai folder"""from .class_creator import create_classfrom .class_generator import Generatordiff --git a/yosoai/class_creator.py b/scrapegraphai/class_creator.pysimilarity index 91%rename from yosoai/class_creator.pyrename to scrapegraphai/class_creator.pyindex 1760b7c9..7cc546b0 100644--- a/yosoai/class_creator.py+++ b/scrapegraphai/class_creator.py@@ -28,5 +28,5 @@ class _Response(BaseModel):base_script = base_script + \f" {elem['title']}: {elem['type']} = Field(description='{elem['description']}')\n"- with open("./yosoai/pydantic_class.py", "w", encoding="utf-8") as f:+ with open("./scrapegraphai/pydantic_class.py", "w", encoding="utf-8") as f:f.write(base_script)diff --git a/yosoai/class_generator.py b/scrapegraphai/class_generator.pysimilarity index 100%rename from yosoai/class_generator.pyrename to scrapegraphai/class_generator.pydiff --git a/yosoai/convert_to_csv.py b/scrapegraphai/convert_to_csv.pysimilarity index 100%rename from yosoai/convert_to_csv.pyrename to scrapegraphai/convert_to_csv.pydiff --git a/yosoai/convert_to_json.py b/scrapegraphai/convert_to_json.pysimilarity index 100%rename from yosoai/convert_to_json.pyrename to scrapegraphai/convert_to_json.pydiff --git a/yosoai/dictionaries.py b/scrapegraphai/dictionaries.pysimilarity index 100%rename from yosoai/dictionaries.pyrename to scrapegraphai/dictionaries.pydiff --git a/yosoai/getter.py b/scrapegraphai/getter.pysimilarity index 100%rename from yosoai/getter.pyrename to scrapegraphai/getter.pydiff --git a/yosoai/graphs/__init__.py b/scrapegraphai/graphs/__init__.pysimilarity index 100%rename from yosoai/graphs/__init__.pyrename to scrapegraphai/graphs/__init__.pydiff --git a/yosoai/graphs/base_graph.py b/scrapegraphai/graphs/base_graph.pysimilarity index 100%rename from yosoai/graphs/base_graph.pyrename to scrapegraphai/graphs/base_graph.pydiff --git a/yosoai/graphs/smart_scraper_graph.py b/scrapegraphai/graphs/smart_scraper_graph.pysimilarity index 100%rename from yosoai/graphs/smart_scraper_graph.pyrename to scrapegraphai/graphs/smart_scraper_graph.pydiff --git a/yosoai/json_getter.py b/scrapegraphai/json_getter.pysimilarity index 100%rename from yosoai/json_getter.pyrename to scrapegraphai/json_getter.pydiff --git a/yosoai/nodes/__init__.py b/scrapegraphai/nodes/__init__.pysimilarity index 100%rename from yosoai/nodes/__init__.pyrename to scrapegraphai/nodes/__init__.pydiff --git a/yosoai/nodes/base_node.py b/scrapegraphai/nodes/base_node.pysimilarity index 100%rename from yosoai/nodes/base_node.pyrename to scrapegraphai/nodes/base_node.pydiff --git a/yosoai/nodes/conditional_node.py b/scrapegraphai/nodes/conditional_node.pysimilarity index 100%rename from yosoai/nodes/conditional_node.pyrename to scrapegraphai/nodes/conditional_node.pydiff --git a/yosoai/nodes/fetch_html_node.py b/scrapegraphai/nodes/fetch_html_node.pysimilarity index 100%rename from yosoai/nodes/fetch_html_node.pyrename to scrapegraphai/nodes/fetch_html_node.pydiff --git a/yosoai/nodes/generate_answer_node.py b/scrapegraphai/nodes/generate_answer_node.pysimilarity index 100%rename from yosoai/nodes/generate_answer_node.pyrename to scrapegraphai/nodes/generate_answer_node.pydiff --git a/yosoai/nodes/get_probable_tags_node.py b/scrapegraphai/nodes/get_probable_tags_node.pysimilarity index 100%rename from yosoai/nodes/get_probable_tags_node.pyrename to scrapegraphai/nodes/get_probable_tags_node.pydiff --git a/yosoai/nodes/parse_html_node.py b/scrapegraphai/nodes/parse_html_node.pysimilarity index 100%rename from yosoai/nodes/parse_html_node.pyrename to scrapegraphai/nodes/parse_html_node.pydiff --git a/yosoai/pydantic_class.py b/scrapegraphai/pydantic_class.pysimilarity index 100%rename from yosoai/pydantic_class.pyrename to scrapegraphai/pydantic_class.pydiff --git a/yosoai/remover.py b/scrapegraphai/remover.pysimilarity index 100%rename from yosoai/remover.pyrename to scrapegraphai/remover.pydiff --git a/yosoai/request.py b/scrapegraphai/request.pysimilarity index 100%rename from yosoai/request.pyrename to scrapegraphai/request.pydiff --git a/yosoai/token_calculator.py b/scrapegraphai/token_calculator.pysimilarity index 100%rename from yosoai/token_calculator.pyrename to scrapegraphai/token_calculator.pydiff --git a/setup.py b/setup.pyindex 98588cd6..79dd4a21 100644--- a/setup.py+++ b/setup.py@@ -2,23 +2,26 @@from setuptools import setup, find_packages# Function to read the contents of a requirements file++def load_requirements(filename):with open(filename, 'r', encoding='utf-8') as file:return file.read().splitlines()+prod_requirements = load_requirements('requirements.txt')dev_requirements = load_requirements('requirements-dev.txt')setup(- name='yosoai',- version='0.1.0', # MAJOR.MINOR.PATCH+ name='scrapegraphai',+ version='0.1.0', # MAJOR.MINOR.PATCHdescription='A web scraping library using langchain',long_description=open('README.md', encoding='utf-8').read(),long_description_content_type='text/markdown',url='https://yoso-ai.readthedocs.io/',author='Marco Vinciguerra',author_email='[email protected]',- license='Apache 2.0',+ license='Apache 2.0',keywords='langchain, ai, artificial intelligence, gpt, machine learning, ml, nlp, natural language processing, openai, scraping, web scraping, web scraping library, web scraping tool, webscraping',classifiers=['Intended Audience :: Developers',@@ -31,7 +34,7 @@ setup('Programming Language :: Python :: 3.12','Operating System :: OS Independent',],- packages = find_packages(),+ packages=find_packages(),python_requires='>=3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*, !=3.8.*',include_package_data=True,# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/diff --git a/tests/test_convert_to_csv.py b/tests/test_convert_to_csv.pyindex 2735c668..b3e26ead 100644--- a/tests/test_convert_to_csv.py+++ b/tests/test_convert_to_csv.py@@ -1,16 +1,16 @@-"""Module for testing convert_to_json inside the folder yosoai/convert_to_json.py"""+"""Module for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""import unittest-from yosoai.convert_to_csv import convert_to_csv+from scrapegraphai.convert_to_csv import convert_to_csvclass TestConvertToCsvFunction(unittest.TestCase):"""- class for testing convert_to_json inside the folder yosoai/convert_to_json.py+ class for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""def test_get_json(self):"""- function for testing convert_to_json inside the folder yosoai/convert_to_json.py+ function for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""example = {"trial": [1, 2, 3]}filename = "result"diff --git a/tests/test_convert_to_json.py b/tests/test_convert_to_json.pyindex 8728fcad..b19afd8b 100644--- a/tests/test_convert_to_json.py+++ b/tests/test_convert_to_json.py@@ -1,18 +1,18 @@"""-Module for testing convert_to_json inside the folder yosoai/convert_to_json.py+Module for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""import unittest-from yosoai.convert_to_json import convert_to_json+from scrapegraphai.convert_to_json import convert_to_jsonclass TestConvertToJSonFunction(unittest.TestCase):"""- class for testing convert_to_json inside the folder yosoai/convert_to_json.py+ class for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""def test_get_json(self):"""- function for testing convert_to_json inside the folder yosoai/convert_to_json.py+ function for testing convert_to_json inside the folder scrapegraphai/convert_to_json.py"""example = {"trial": [1, 2, 3]}filename = "result"