Skip to content

Commit e613e2e

Browse files
committed
feat: refactoring of the folders
1 parent cd5e797 commit e613e2e

14 files changed

+28
-35
lines changed

β€Žexamples/credits_example.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import os
77
from dotenv import load_dotenv
8-
from scrapegraphaiapisdk.credits import credits
8+
from scrapegraph_py.credits import credits
99

1010
# Load environment variables from a .env file
1111
load_dotenv()

β€Žexamples/feedback_example.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from dotenv import load_dotenv
3-
from scrapegraphaiapisdk.credits import status
4-
from scrapegraphaiapisdk.feedback import feedback
3+
from scrapegraph_py.credits import status
4+
from scrapegraph_py.feedback import feedback
55

66
# Load environment variables from .env file
77
load_dotenv()

β€Žexamples/scrape_example.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from scrapegraphaiapisdk.scrape import scrape
1+
from scrapegraph_py.scrape import scrape
22
from dotenv import load_dotenv # Import load_dotenv
33
import os # Import os to access environment variables
44
import json # Import json for beautifying output
Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from pydantic import BaseModel
2-
from scrapegraphaiapisdk.scrape import scrape
1+
from pydantic import BaseModel, Field
2+
from scrapegraph_py.scrape import scrape
33
from dotenv import load_dotenv
44
import os
55

@@ -8,23 +8,16 @@
88

99
# Define a Pydantic schema
1010
class CompanyInfoSchema(BaseModel):
11-
company_name: str
12-
description: str
13-
main_products: list[str]
11+
company_name: str = Field(description="The name of the company")
12+
description: str = Field(description="A description of the company")
13+
main_products: list[str] = Field(description="The main products of the company")
1414

1515
# Example usage
1616
api_key = os.getenv("SCRAPEGRAPH_API_KEY")
1717
url = "https://scrapegraphai.com/"
1818
prompt = "What does the company do?"
1919

20-
# Create an instance of the schema with initial values
21-
schema = CompanyInfoSchema(
22-
company_name="Example Company",
23-
description="An example company description.",
24-
main_products=["Product1", "Product2"]
25-
)
26-
2720
# Call the scrape function with the schema
28-
result = scrape(api_key=api_key, url=url, prompt=prompt, schema=schema)
21+
result = scrape(api_key=api_key, url=url, prompt=prompt, schema=CompanyInfoSchema)
2922

3023
print(result)

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "scrapegraphaiapisdk"
2+
name = "scrapegraph_py"
33
version = "0.0.1"
44
description = "library for extracting reference from documents"
55
authors = [

β€Žrequirements-dev.lockβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ docutils==0.19
2929
exceptiongroup==1.2.2
3030
# via pytest
3131
furo==2024.5.6
32-
# via scrapegraphaiapisdk
32+
# via scrapegraph-py
3333
idna==3.10
3434
# via requests
3535
imagesize==1.4.1
@@ -54,7 +54,7 @@ platformdirs==4.3.6
5454
pluggy==1.5.0
5555
# via pytest
5656
pydantic==2.9.2
57-
# via scrapegraphaiapisdk
57+
# via scrapegraph-py
5858
pydantic-core==2.23.4
5959
# via pydantic
6060
pygments==2.18.0
@@ -65,17 +65,17 @@ pytest==8.0.0
6565
# via pytest-mock
6666
pytest-mock==3.14.0
6767
python-dotenv==1.0.1
68-
# via scrapegraphaiapisdk
68+
# via scrapegraph-py
6969
requests==2.32.3
70-
# via scrapegraphaiapisdk
70+
# via scrapegraph-py
7171
# via sphinx
7272
snowballstemmer==2.2.0
7373
# via sphinx
7474
soupsieve==2.6
7575
# via beautifulsoup4
7676
sphinx==6.0.0
7777
# via furo
78-
# via scrapegraphaiapisdk
78+
# via scrapegraph-py
7979
# via sphinx-basic-ng
8080
sphinx-basic-ng==1.0.0b2
8181
# via furo

β€Žrequirements.lockβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ charset-normalizer==3.4.0
1717
idna==3.10
1818
# via requests
1919
pydantic==2.9.2
20-
# via scrapegraphaiapisdk
20+
# via scrapegraph-py
2121
pydantic-core==2.23.4
2222
# via pydantic
2323
python-dotenv==1.0.1
24-
# via scrapegraphaiapisdk
24+
# via scrapegraph-py
2525
requests==2.32.3
26-
# via scrapegraphaiapisdk
26+
# via scrapegraph-py
2727
typing-extensions==4.12.2
2828
# via pydantic
2929
# via pydantic-core
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)