Skip to content

Commit bfc7246

Browse files
committed
feat: update init
1 parent 7b1a839 commit bfc7246

2 files changed

Lines changed: 151 additions & 151 deletions

File tree

scrapegraph-py/Makefile

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
# Makefile for Project Automation
2-
3-
.PHONY: install lint type-check test docs serve-docs build all clean
4-
5-
# Variables
6-
PACKAGE_NAME = scrapegraph_py
7-
TEST_DIR = tests
8-
9-
# Default target
10-
all: lint type-check test docs
11-
12-
# Install project dependencies
13-
install:
14-
uv sync
15-
16-
# Linting and Formatting Checks
17-
lint:
18-
uv run ruff check $(PACKAGE_NAME) $(TEST_DIR)
19-
uv run black --check $(PACKAGE_NAME) $(TEST_DIR)
20-
uv run isort --check-only $(PACKAGE_NAME) $(TEST_DIR)
21-
22-
# Type Checking with MyPy
23-
type-check:
24-
uv run mypy $(PACKAGE_NAME) $(TEST_DIR)
25-
26-
# Run Tests with Coverage
27-
test:
28-
uv run pytest --cov=$(PACKAGE_NAME) --cov-report=xml $(TEST_DIR)/
29-
30-
# Build Documentation using MkDocs
31-
docs:
32-
uv run mkdocs build
33-
34-
# Serve Documentation Locally
35-
serve-docs:
36-
uv run mkdocs serve
37-
38-
# Run Pre-Commit Hooks
39-
pre-commit:
40-
uv run pre-commit run --all-files
41-
42-
# Clean Up Generated Files
43-
clean:
44-
rm -rf dist/
45-
rm -rf build/
46-
rm -rf *.egg-info
47-
rm -rf htmlcov/
48-
rm -rf .mypy_cache/
49-
rm -rf .pytest_cache/
50-
rm -rf .ruff_cache/
51-
rm -rf site/
52-
53-
# Build the Package
54-
build:
1+
# Makefile for Project Automation
2+
3+
.PHONY: install lint type-check test docs serve-docs build all clean
4+
5+
# Variables
6+
PACKAGE_NAME = scrapegraph_py
7+
TEST_DIR = tests
8+
9+
# Default target
10+
all: lint type-check test docs
11+
12+
# Install project dependencies
13+
install:
14+
uv sync
15+
16+
# Linting and Formatting Checks
17+
lint:
18+
uv run ruff check $(PACKAGE_NAME) $(TEST_DIR)
19+
uv run black --check $(PACKAGE_NAME) $(TEST_DIR)
20+
uv run isort --check-only $(PACKAGE_NAME) $(TEST_DIR)
21+
22+
# Type Checking with MyPy
23+
type-check:
24+
uv run mypy $(PACKAGE_NAME) $(TEST_DIR)
25+
26+
# Run Tests with Coverage
27+
test:
28+
uv run pytest --cov=$(PACKAGE_NAME) --cov-report=xml $(TEST_DIR)/
29+
30+
# Build Documentation using MkDocs
31+
docs:
32+
uv run mkdocs build
33+
34+
# Serve Documentation Locally
35+
serve-docs:
36+
uv run mkdocs serve
37+
38+
# Run Pre-Commit Hooks
39+
pre-commit:
40+
uv run pre-commit run --all-files
41+
42+
# Clean Up Generated Files
43+
clean:
44+
rm -rf dist/
45+
rm -rf build/
46+
rm -rf *.egg-info
47+
rm -rf htmlcov/
48+
rm -rf .mypy_cache/
49+
rm -rf .pytest_cache/
50+
rm -rf .ruff_cache/
51+
rm -rf site/
52+
53+
# Build the Package
54+
build:
5555
uv build

scrapegraph-py/src/__init__.py

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,97 @@
1-
"""
2-
ScrapeGraphAI Python SDK
3-
4-
A comprehensive Python SDK for the ScrapeGraphAI API, providing both synchronous
5-
and asynchronous clients for all API endpoints.
6-
7-
Main Features:
8-
- SmartScraper: AI-powered web scraping with structured data extraction
9-
- SearchScraper: Web research across multiple sources
10-
- Agentic Scraper: Automated browser interactions and form filling
11-
- Crawl: Website crawling with AI extraction or markdown conversion
12-
- Markdownify: Convert web pages to clean markdown
13-
- Schema Generation: AI-assisted schema creation for data extraction
14-
- Scheduled Jobs: Automate recurring scraping tasks
15-
16-
Quick Start:
17-
>>> from scrapegraph_py import Client
18-
>>>
19-
>>> # Initialize client from environment variables
20-
>>> client = Client.from_env()
21-
>>>
22-
>>> # Basic scraping
23-
>>> result = client.smartscraper(
24-
... website_url="https://example.com",
25-
... user_prompt="Extract all product information"
26-
... )
27-
>>>
28-
>>> # With context manager
29-
>>> with Client.from_env() as client:
30-
... result = client.scrape(website_url="https://example.com")
31-
32-
Async Usage:
33-
>>> import asyncio
34-
>>> from scrapegraph_py import AsyncClient
35-
>>>
36-
>>> async def main():
37-
... async with AsyncClient.from_env() as client:
38-
... result = await client.smartscraper(
39-
... website_url="https://example.com",
40-
... user_prompt="Extract products"
41-
... )
42-
>>>
43-
>>> asyncio.run(main())
44-
45-
For more information visit: https://scrapegraphai.com
46-
Documentation: https://docs.scrapegraphai.com
47-
"""
48-
49-
from .async_client import AsyncClient
50-
from .client import Client
51-
52-
# Scrape Models
53-
from .models.scrape import (
54-
ScrapeRequest,
55-
GetScrapeRequest,
56-
)
57-
58-
# Scheduled Jobs Models
59-
from .models.scheduled_jobs import (
60-
GetJobExecutionsRequest,
61-
GetScheduledJobRequest,
62-
GetScheduledJobsRequest,
63-
JobActionRequest,
64-
JobActionResponse,
65-
JobExecutionListResponse,
66-
JobExecutionResponse,
67-
JobTriggerResponse,
68-
ScheduledJobCreate,
69-
ScheduledJobListResponse,
70-
ScheduledJobResponse,
71-
ScheduledJobUpdate,
72-
ServiceType,
73-
TriggerJobRequest,
74-
)
75-
76-
__all__ = [
77-
"Client",
78-
"AsyncClient",
79-
# Scrape Models
80-
"ScrapeRequest",
81-
"GetScrapeRequest",
82-
# Scheduled Jobs Models
83-
"ServiceType",
84-
"ScheduledJobCreate",
85-
"ScheduledJobUpdate",
86-
"ScheduledJobResponse",
87-
"ScheduledJobListResponse",
88-
"JobExecutionResponse",
89-
"JobExecutionListResponse",
90-
"JobTriggerResponse",
91-
"JobActionResponse",
92-
"GetScheduledJobsRequest",
93-
"GetScheduledJobRequest",
94-
"GetJobExecutionsRequest",
95-
"TriggerJobRequest",
96-
"JobActionRequest",
97-
]
1+
"""
2+
ScrapeGraphAI Python SDK
3+
4+
A comprehensive Python SDK for the ScrapeGraphAI API, providing both synchronous
5+
and asynchronous clients for all API endpoints.
6+
7+
Main Features:
8+
- SmartScraper: AI-powered web scraping with structured data extraction
9+
- SearchScraper: Web research across multiple sources
10+
- Agentic Scraper: Automated browser interactions and form filling
11+
- Crawl: Website crawling with AI extraction or markdown conversion
12+
- Markdownify: Convert web pages to clean markdown
13+
- Schema Generation: AI-assisted schema creation for data extraction
14+
- Scheduled Jobs: Automate recurring scraping tasks
15+
16+
Quick Start:
17+
>>> from scrapegraph_py import Client
18+
>>>
19+
>>> # Initialize client from environment variables
20+
>>> client = Client.from_env()
21+
>>>
22+
>>> # Basic scraping
23+
>>> result = client.smartscraper(
24+
... website_url="https://example.com",
25+
... user_prompt="Extract all product information"
26+
... )
27+
>>>
28+
>>> # With context manager
29+
>>> with Client.from_env() as client:
30+
... result = client.scrape(website_url="https://example.com")
31+
32+
Async Usage:
33+
>>> import asyncio
34+
>>> from scrapegraph_py import AsyncClient
35+
>>>
36+
>>> async def main():
37+
... async with AsyncClient.from_env() as client:
38+
... result = await client.smartscraper(
39+
... website_url="https://example.com",
40+
... user_prompt="Extract products"
41+
... )
42+
>>>
43+
>>> asyncio.run(main())
44+
45+
For more information visit: https://scrapegraphai.com
46+
Documentation: https://docs.scrapegraphai.com
47+
"""
48+
49+
from .async_client import AsyncClient
50+
from .client import Client
51+
52+
# Scrape Models
53+
from .models.scrape import (
54+
ScrapeRequest,
55+
GetScrapeRequest,
56+
)
57+
58+
# Scheduled Jobs Models
59+
from .models.scheduled_jobs import (
60+
GetJobExecutionsRequest,
61+
GetScheduledJobRequest,
62+
GetScheduledJobsRequest,
63+
JobActionRequest,
64+
JobActionResponse,
65+
JobExecutionListResponse,
66+
JobExecutionResponse,
67+
JobTriggerResponse,
68+
ScheduledJobCreate,
69+
ScheduledJobListResponse,
70+
ScheduledJobResponse,
71+
ScheduledJobUpdate,
72+
ServiceType,
73+
TriggerJobRequest,
74+
)
75+
76+
__all__ = [
77+
"Client",
78+
"AsyncClient",
79+
# Scrape Models
80+
"ScrapeRequest",
81+
"GetScrapeRequest",
82+
# Scheduled Jobs Models
83+
"ServiceType",
84+
"ScheduledJobCreate",
85+
"ScheduledJobUpdate",
86+
"ScheduledJobResponse",
87+
"ScheduledJobListResponse",
88+
"JobExecutionResponse",
89+
"JobExecutionListResponse",
90+
"JobTriggerResponse",
91+
"JobActionResponse",
92+
"GetScheduledJobsRequest",
93+
"GetScheduledJobRequest",
94+
"GetJobExecutionsRequest",
95+
"TriggerJobRequest",
96+
"JobActionRequest",
97+
]

0 commit comments

Comments
 (0)