Booker show with 52 points, whoever has the most games over 50
+The Suns' No. 1 dominated the match won in New Orleans, scoring 52 points. It's about...
+
+
+
+
+
+
+
-
-
-
-
-
-6. Open the .env file inside main and paste the API key
+7. Create a .env file inside the main and paste the API key
```config
API_KEY="your openai.com api key"
```
-7. You are ready to go! 🚀
-
+8. You are ready to go! 🚀
+9. Try running the examples using:
+ ```bash
+ python -m examples.html_scraping
+ ```
+ or
+ ```bash
+ python -m AmazScraper.examples.html_scraping
+ ```
+
# Practical use
## Using AmazScraper as a library
```python
-from AmazScraper.class_generator import Generator
+from AmazScraper.classes.class_generator import Generator
-from AmazScraper.getter import get_function, scraper
+from AmazScraper.utils.getter import get_function, scraper
values = [
{
@@ -66,7 +81,7 @@ if __name__ == "__main__":
```python
import sys
-from AmazScraper.class_generator import Generator
+from AmazScraper.classes.class_generator import Generator
values = [
{
diff --git a/__init__.py b/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/classes/__init__.py b/classes/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/class_generator.py b/classes/class_generator.py
similarity index 94%
rename from class_generator.py
rename to classes/class_generator.py
index 858c4081..7144f509 100644
--- a/class_generator.py
+++ b/classes/class_generator.py
@@ -1,7 +1,7 @@
import os
from dotenv import load_dotenv
-from AmazScraper.pydantic_class import _Response
-from AmazScraper.class_creator import create_class
+from classes.pydantic_class import _Response
+from utils.class_creator import create_class
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain_core.pydantic_v1 import Field
diff --git a/pydantic_class.py b/classes/pydantic_class.py
similarity index 60%
rename from pydantic_class.py
rename to classes/pydantic_class.py
index e9b554d1..40076518 100644
--- a/pydantic_class.py
+++ b/classes/pydantic_class.py
@@ -2,4 +2,4 @@
from langchain_core.pydantic_v1 import BaseModel, Field
class _Response(BaseModel):
- title: str = Field(description='Title of the news')
+ title: str = Field(description='Title of the items')
diff --git a/examples/html_scraping.py b/examples/html_scraping.py
new file mode 100644
index 00000000..bd08f6b5
--- /dev/null
+++ b/examples/html_scraping.py
@@ -0,0 +1,54 @@
+import sys
+from classes.class_generator import Generator
+
+values = [
+ {
+ "title": "title",
+ "type": "str",
+ "description": "Title of the news"
+ }
+]
+
+# Example using a HTML code
+query_info = '''
+ Given this code extract all the information in a json format about the news.
+ The Suns' No. 1 dominated the match won in New Orleans, scoring 52 points. It's about...
+