Python scraper based on AI
Python ai-crawlerai-scrapingai-searchcrawlerdata-extractionfirecrawl-alternativelarge-language-modelllmmarkdownragscrapingscraping-pythonweb-crawlerweb-crawlersweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
add: setup.py for deployment
PeriniMa9beecde8f01
diff --git a/.gitignore b/.gitignoreindex b954eb8c..2cd267db 100644--- a/.gitignore+++ b/.gitignore@@ -1,7 +1,20 @@.DS_Store.DS_Store?._*++# Byte-compiled / optimized / DLL files**/__pycache__/+*.py[cod]+*$py.class++# Distribution / packaging+.Python+build/+dist/+*.egg-info/+*.egg+MANIFEST+docs/build/docs/source/_templates/.envdiff --git a/MANIFEST.in b/MANIFEST.innew file mode 100644index 00000000..c269e040--- /dev/null+++ b/MANIFEST.in@@ -0,0 +1,34 @@+# Include the license file+include LICENSE++# Include the readme and other markdown files+include README.md+include CONTRIBUTING.md++# Include the requirements file+include requirements.txt++# Include the setup configuration+include setup.py++# Include the documentation files+recursive-include docs *.md+recursive-include docs *.rst++# Include the YAML configuration for Read the Docs+include readthedocs.yml++# Include Python source files from the project's subpackages+recursive-include utils *.py+recursive-include examples *.py+recursive-include tests *.py++# If you want to exclude specific files or patterns, use the 'global-exclude' directive+# global-exclude *.pyc+# global-exclude __pycache__/*++# Exclude all bytecode compiled files+global-exclude *.py[cod]++# Exclude OS generated files like .DS_Store+global-exclude .DS_Store\ No newline at end of filediff --git a/classes/__init__.py b/classes/__init__.pydeleted file mode 100644index e69de29b..00000000diff --git a/examples/html_scraping.py b/examples/html_scraping.pyindex bd08f6b5..3cbd764b 100644--- a/examples/html_scraping.py+++ b/examples/html_scraping.py@@ -1,5 +1,5 @@import sys-from classes.class_generator import Generator+from utils.class_generator import Generatorvalues = [{diff --git a/examples/values_scraping.py b/examples/values_scraping.pyindex 831bb2be..281d2231 100644--- a/examples/values_scraping.py+++ b/examples/values_scraping.py@@ -1,4 +1,4 @@-from classes.class_generator import Generator+from utils.class_generator import Generatorfrom utils.getter import get_function, scraperdiff --git a/readthedocs.yaml b/readthedocs.ymlsimilarity index 100%rename from readthedocs.yamlrename to readthedocs.ymldiff --git a/requirements.txt b/requirements.txtindex 66413914..2cfaf270 100644--- a/requirements.txt+++ b/requirements.txt@@ -4,4 +4,4 @@ langchain_core==0.1.16langchain_openai==0.0.5python-dotenv==1.0.1Requests==2.31.0-pytest==8.0.0+pytest==8.0.0\ No newline at end of filediff --git a/setup.py b/setup.pynew file mode 100644index 00000000..8b549fea--- /dev/null+++ b/setup.py@@ -0,0 +1,24 @@+from setuptools import setup, find_packages++# Read in the requirements.txt file+with open('requirements.txt') as f:+ requirements = f.read().splitlines()++setup(+ name='amazscraper',+ version='1.0.0', # MAJOR.MINOR.PATCH+ description='A web scraping library using langchain',+ author='Marco Vinciguerra',+ author_email='[email protected]',+ packages=find_packages(),+ install_requires=requirements,+ # Include package data files from MANIFEST.in+ include_package_data=True,+ license='Apache 2.0',+ # Additional classifiers to help users find the package+ classifiers=[+ 'Programming Language :: Python :: 3',+ 'License :: OSI Approved :: Apache Software License',+ 'Operating System :: OS Independent',+ ],+)diff --git a/tests/test_amaz_scraper.py b/tests/test_amaz_scraper.pyindex 9158b7a3..a6f21675 100644--- a/tests/test_amaz_scraper.py+++ b/tests/test_amaz_scraper.py@@ -1,5 +1,5 @@import pytest-from classes.pydantic_class import _Response+from utils.pydantic_class import _Responsefrom utils.class_creator import create_classfrom langchain_openai import ChatOpenAIdiff --git a/utils/class_creator.py b/utils/class_creator.pyindex 36228120..d1b1dd3f 100644--- a/utils/class_creator.py+++ b/utils/class_creator.py@@ -10,5 +10,5 @@ def create_class(data_dict: dict):global base_scriptbase_script = base_script + f" {elem['title']}: {elem['type']} = Field(description='{elem['description']}')\n"- with open("classes/pydantic_class.py", "w") as f:+ with open("./pydantic_class.py", "w") as f:f.write(base_script)diff --git a/classes/class_generator.py b/utils/class_generator.pysimilarity index 95%rename from classes/class_generator.pyrename to utils/class_generator.pyindex 7144f509..92363e3a 100644--- a/classes/class_generator.py+++ b/utils/class_generator.py@@ -1,7 +1,7 @@import osfrom dotenv import load_dotenv-from classes.pydantic_class import _Response-from utils.class_creator import create_class+from .pydantic_class import _Response+from .class_creator import create_classfrom langchain_openai import ChatOpenAIfrom langchain.prompts import PromptTemplatefrom langchain_core.pydantic_v1 import Fielddiff --git a/classes/pydantic_class.py b/utils/pydantic_class.pysimilarity index 100%rename from classes/pydantic_class.pyrename to utils/pydantic_class.py