Skip to content

Python scraper based on AI

refactoring of the code changing the name

VinciGit002a234f2e4df5
diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml
index 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 pylint
run: |
- 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/*.py
diff --git a/README.md b/README.md
index c8feece7..a07461ff 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ python -m yoso-ai.examples.html_scraping
```python
import os
from dotenv import load_dotenv
-from yosoai import _get_function, send_request
+from scrapegraphai import _get_function, send_request
load_dotenv()
@@ -104,7 +104,7 @@ if __name__ == "__main__":
```python
import os
from dotenv import load_dotenv
-from yosoai import send_request
+from scrapegraphai import send_request
load_dotenv()
@@ -195,7 +195,7 @@ The oputput format is a dict and its the following:
# Credits
Thanks 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 by
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 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 modules
sys.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-output
html_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.rst
index 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
+ scrapegraphai
diff --git a/docs/source/modules/yosoai.graphs.rst b/docs/source/modules/yosoai.graphs.rst
index 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 module
Module 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.rst
index 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 module
Module 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.rst
index 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.nodes
Submodules
----------
-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 module
Module contents
---------------
-.. automodule:: yosoai
+.. automodule:: scrapegraphai
:members:
:undoc-members:
:show-inheritance:
diff --git a/examples/graph_example.py b/examples/graph_example.py
index b275a1fb..16ab3a97 100644
--- a/examples/graph_example.py
+++ b/examples/graph_example.py
@@ -3,7 +3,7 @@ Basic example for creating the node
"""
import os
from dotenv import load_dotenv
-from yosoai.graphs import SmartScraper
+from scrapegraphai.graphs import SmartScraper
load_dotenv()
diff --git a/examples/html_scraping.py b/examples/html_scraping.py
index 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 os
from dotenv import load_dotenv
-from yosoai import send_request
+from scrapegraphai import send_request
load_dotenv()
diff --git a/examples/value_scraping.py b/examples/value_scraping.py
index 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 os
from dotenv import load_dotenv
-from yosoai import _get_function, send_request
+from scrapegraphai import _get_function, send_request
load_dotenv()
diff --git a/yosoai/__init__.py b/scrapegraphai/__init__.py
similarity index 81%
rename from yosoai/__init__.py
rename to scrapegraphai/__init__.py
index 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_class
from .class_generator import Generator
diff --git a/yosoai/class_creator.py b/scrapegraphai/class_creator.py
similarity index 91%
rename from yosoai/class_creator.py
rename to scrapegraphai/class_creator.py
index 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.py
similarity index 100%
rename from yosoai/class_generator.py
rename to scrapegraphai/class_generator.py
diff --git a/yosoai/convert_to_csv.py b/scrapegraphai/convert_to_csv.py
similarity index 100%
rename from yosoai/convert_to_csv.py
rename to scrapegraphai/convert_to_csv.py
diff --git a/yosoai/convert_to_json.py b/scrapegraphai/convert_to_json.py
similarity index 100%
rename from yosoai/convert_to_json.py
rename to scrapegraphai/convert_to_json.py
diff --git a/yosoai/dictionaries.py b/scrapegraphai/dictionaries.py
similarity index 100%
rename from yosoai/dictionaries.py
rename to scrapegraphai/dictionaries.py
diff --git a/yosoai/getter.py b/scrapegraphai/getter.py
similarity index 100%
rename from yosoai/getter.py
rename to scrapegraphai/getter.py
diff --git a/yosoai/graphs/__init__.py b/scrapegraphai/graphs/__init__.py
similarity index 100%
rename from yosoai/graphs/__init__.py
rename to scrapegraphai/graphs/__init__.py
diff --git a/yosoai/graphs/base_graph.py b/scrapegraphai/graphs/base_graph.py
similarity index 100%
rename from yosoai/graphs/base_graph.py
rename to scrapegraphai/graphs/base_graph.py
diff --git a/yosoai/graphs/smart_scraper_graph.py b/scrapegraphai/graphs/smart_scraper_graph.py
similarity index 100%
rename from yosoai/graphs/smart_scraper_graph.py
rename to scrapegraphai/graphs/smart_scraper_graph.py
diff --git a/yosoai/json_getter.py b/scrapegraphai/json_getter.py
similarity index 100%
rename from yosoai/json_getter.py
rename to scrapegraphai/json_getter.py
diff --git a/yosoai/nodes/__init__.py b/scrapegraphai/nodes/__init__.py
similarity index 100%
rename from yosoai/nodes/__init__.py
rename to scrapegraphai/nodes/__init__.py
diff --git a/yosoai/nodes/base_node.py b/scrapegraphai/nodes/base_node.py
similarity index 100%
rename from yosoai/nodes/base_node.py
rename to scrapegraphai/nodes/base_node.py
diff --git a/yosoai/nodes/conditional_node.py b/scrapegraphai/nodes/conditional_node.py
similarity index 100%
rename from yosoai/nodes/conditional_node.py
rename to scrapegraphai/nodes/conditional_node.py
diff --git a/yosoai/nodes/fetch_html_node.py b/scrapegraphai/nodes/fetch_html_node.py
similarity index 100%
rename from yosoai/nodes/fetch_html_node.py
rename to scrapegraphai/nodes/fetch_html_node.py
diff --git a/yosoai/nodes/generate_answer_node.py b/scrapegraphai/nodes/generate_answer_node.py
similarity index 100%
rename from yosoai/nodes/generate_answer_node.py
rename to scrapegraphai/nodes/generate_answer_node.py
diff --git a/yosoai/nodes/get_probable_tags_node.py b/scrapegraphai/nodes/get_probable_tags_node.py
similarity index 100%
rename from yosoai/nodes/get_probable_tags_node.py
rename to scrapegraphai/nodes/get_probable_tags_node.py
diff --git a/yosoai/nodes/parse_html_node.py b/scrapegraphai/nodes/parse_html_node.py
similarity index 100%
rename from yosoai/nodes/parse_html_node.py
rename to scrapegraphai/nodes/parse_html_node.py
diff --git a/yosoai/pydantic_class.py b/scrapegraphai/pydantic_class.py
similarity index 100%
rename from yosoai/pydantic_class.py
rename to scrapegraphai/pydantic_class.py
diff --git a/yosoai/remover.py b/scrapegraphai/remover.py
similarity index 100%
rename from yosoai/remover.py
rename to scrapegraphai/remover.py
diff --git a/yosoai/request.py b/scrapegraphai/request.py
similarity index 100%
rename from yosoai/request.py
rename to scrapegraphai/request.py
diff --git a/yosoai/token_calculator.py b/scrapegraphai/token_calculator.py
similarity index 100%
rename from yosoai/token_calculator.py
rename to scrapegraphai/token_calculator.py
diff --git a/setup.py b/setup.py
index 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.PATCH
description='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.py
index 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_csv
class 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.py
index 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_json
class 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"