|
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