dataify-sdk 0.1.0__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dataify_sdk-0.1.0 → dataify_sdk-1.1.0}/.gitignore +33 -32
- {dataify_sdk-0.1.0 → dataify_sdk-1.1.0}/LICENSE +21 -21
- dataify_sdk-1.1.0/PKG-INFO +119 -0
- dataify_sdk-1.1.0/PYPI_RELEASE.md +136 -0
- dataify_sdk-1.1.0/README.md +94 -0
- {dataify_sdk-0.1.0 → dataify_sdk-1.1.0}/pyproject.toml +48 -66
- dataify_sdk-1.1.0/scripts/codegen.py +28 -0
- dataify_sdk-1.1.0/src/dataify_sdk/__init__.py +47 -0
- dataify_sdk-1.1.0/src/dataify_sdk/_codegen/__init__.py +5 -0
- dataify_sdk-1.1.0/src/dataify_sdk/_codegen/generate.py +785 -0
- dataify_sdk-1.1.0/src/dataify_sdk/client.py +296 -0
- dataify_sdk-1.1.0/src/dataify_sdk/errors.py +43 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/__init__.py +190 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/airbnbproduct.py +43 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/amazoncomment.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/amazonglobalproduct.py +134 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/amazonproduct.py +157 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/amazonproductlist.py +45 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/amazonseller.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingimages.py +59 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingmaps.py +47 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingnews.py +49 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingsearch.py +53 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingshopping.py +45 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bingvideos.py +55 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/bookinghotellist.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/crunchbasecompany.py +66 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/duckduckgosearch.py +49 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/ebayinfo.py +122 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/facebookcomment.py +47 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/facebookevent.py +66 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/facebookpost.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/facebookprofile.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/githubrepository.py +95 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/glassdoorcompany.py +124 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/glassdoorjoblistings.py +95 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleaimode.py +45 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlefinance.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleflights.py +95 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlehotels.py +85 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleimages.py +87 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlejobs.py +57 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlelens.py +47 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlelocal.py +53 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlemapcomment.py +43 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlemapdetails.py +124 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlemaps.py +67 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlenews.py +53 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlepatents.py +69 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleplay.py +55 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleplaystoreinformation.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleplaystorereviews.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlescholar.py +65 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlesearch.py +67 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleshopping.py +63 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googleshoppinginfo.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googletrends.py +57 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/googlevideos.py +59 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/indeedcompaniesinfo.py +118 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/indeedjoblistings.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/instagramcomment.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/instagramprofiles.py +66 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/instagramreel.py +87 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/linkedincompanyinformation.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/linkedinjoblistingsinformation.py +93 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/redditcomment.py +45 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/redditposts.py +99 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/tiktokcomment.py +43 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/tiktokposts.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/tiktokprofiles.py +72 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/tiktokshop.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/twitterpost.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/twitterprofile.py +66 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/walmartproduct.py +130 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/yandexsearch.py +51 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubeaudio.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubecomment.py +47 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubeproduct.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubeprofiles.py +68 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubetranscript.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubevideo.py +41 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/youtubevideopost.py +190 -0
- dataify_sdk-1.1.0/src/dataify_sdk/tools/zillowproduct.py +49 -0
- dataify_sdk-1.1.0/tests/conftest.py +59 -0
- dataify_sdk-1.1.0/tests/test_client/test_http_client.py +130 -0
- dataify_sdk-1.1.0/tests/test_tools/test_codegen.py +44 -0
- dataify_sdk-1.1.0/tests/test_tools/test_tool_modules.py +70 -0
- dataify_sdk-0.1.0/PKG-INFO +0 -154
- dataify_sdk-0.1.0/README.md +0 -121
- dataify_sdk-0.1.0/docs/examples/basic_usage.py +0 -97
- dataify_sdk-0.1.0/scripts/codegen.py +0 -121
- dataify_sdk-0.1.0/src/dataify_mcp/__init__.py +0 -37
- dataify_sdk-0.1.0/src/dataify_mcp/_codegen/__init__.py +0 -14
- dataify_sdk-0.1.0/src/dataify_mcp/_codegen/_generate.py +0 -353
- dataify_sdk-0.1.0/src/dataify_mcp/_codegen/_introspect.py +0 -112
- dataify_sdk-0.1.0/src/dataify_mcp/_version.py +0 -3
- dataify_sdk-0.1.0/src/dataify_mcp/client/__init__.py +0 -7
- dataify_sdk-0.1.0/src/dataify_mcp/client/_base.py +0 -223
- dataify_sdk-0.1.0/src/dataify_mcp/client/_http.py +0 -205
- dataify_sdk-0.1.0/src/dataify_mcp/client/_protocol.py +0 -204
- dataify_sdk-0.1.0/src/dataify_mcp/client/_sse.py +0 -319
- dataify_sdk-0.1.0/src/dataify_mcp/tools/__init__.py +0 -90
- dataify_sdk-0.1.0/src/dataify_mcp/tools/amazon.py +0 -137
- dataify_sdk-0.1.0/src/dataify_mcp/tools/bing.py +0 -141
- dataify_sdk-0.1.0/src/dataify_mcp/tools/facebook.py +0 -63
- dataify_sdk-0.1.0/src/dataify_mcp/tools/glassdoor.py +0 -41
- dataify_sdk-0.1.0/src/dataify_mcp/tools/google_scraper.py +0 -121
- dataify_sdk-0.1.0/src/dataify_mcp/tools/google_serp.py +0 -320
- dataify_sdk-0.1.0/src/dataify_mcp/tools/indeed.py +0 -41
- dataify_sdk-0.1.0/src/dataify_mcp/tools/instagram.py +0 -52
- dataify_sdk-0.1.0/src/dataify_mcp/tools/linkedin.py +0 -41
- dataify_sdk-0.1.0/src/dataify_mcp/tools/other_scrapers.py +0 -137
- dataify_sdk-0.1.0/src/dataify_mcp/tools/other_search.py +0 -90
- dataify_sdk-0.1.0/src/dataify_mcp/tools/reddit.py +0 -41
- dataify_sdk-0.1.0/src/dataify_mcp/tools/task_status.py +0 -188
- dataify_sdk-0.1.0/src/dataify_mcp/tools/tiktok.py +0 -81
- dataify_sdk-0.1.0/src/dataify_mcp/tools/twitter.py +0 -41
- dataify_sdk-0.1.0/src/dataify_mcp/tools/user.py +0 -79
- dataify_sdk-0.1.0/src/dataify_mcp/tools/web_unlocker.py +0 -53
- dataify_sdk-0.1.0/src/dataify_mcp/tools/youtube.py +0 -163
- dataify_sdk-0.1.0/src/dataify_mcp/types/__init__.py +0 -39
- dataify_sdk-0.1.0/src/dataify_mcp/types/_enums.py +0 -220
- dataify_sdk-0.1.0/src/dataify_mcp/types/_errors.py +0 -73
- dataify_sdk-0.1.0/src/dataify_mcp/types/_mcp.py +0 -89
- dataify_sdk-0.1.0/tests/conftest.py +0 -123
- dataify_sdk-0.1.0/tests/test_client/test_http_client.py +0 -136
- dataify_sdk-0.1.0/tests/test_tools/__init__.py +0 -0
- dataify_sdk-0.1.0/tests/test_tools/test_codegen.py +0 -174
- dataify_sdk-0.1.0/tests/test_tools/test_tool_modules.py +0 -203
- {dataify_sdk-0.1.0/src/dataify_mcp/_codegen/_templates → dataify_sdk-1.1.0/tests}/__init__.py +0 -0
- {dataify_sdk-0.1.0/tests → dataify_sdk-1.1.0/tests/test_client}/__init__.py +0 -0
- {dataify_sdk-0.1.0/tests/test_client → dataify_sdk-1.1.0/tests/test_tools}/__init__.py +0 -0
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
# Python
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*.egg-info/
|
|
5
|
-
dist/
|
|
6
|
-
build/
|
|
7
|
-
*.egg
|
|
8
|
-
|
|
9
|
-
# Virtual environments
|
|
10
|
-
.venv/
|
|
11
|
-
venv/
|
|
12
|
-
|
|
13
|
-
# IDE
|
|
14
|
-
.idea/
|
|
15
|
-
.vscode/
|
|
16
|
-
*.swp
|
|
17
|
-
*.swo
|
|
18
|
-
|
|
19
|
-
# Testing
|
|
20
|
-
.pytest_cache/
|
|
21
|
-
.coverage
|
|
22
|
-
htmlcov/
|
|
23
|
-
|
|
24
|
-
# Mypy
|
|
25
|
-
.mypy_cache/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
*.egg
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv/
|
|
11
|
+
venv/
|
|
12
|
+
|
|
13
|
+
# IDE
|
|
14
|
+
.idea/
|
|
15
|
+
.vscode/
|
|
16
|
+
*.swp
|
|
17
|
+
*.swo
|
|
18
|
+
|
|
19
|
+
# Testing
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.coverage
|
|
22
|
+
htmlcov/
|
|
23
|
+
|
|
24
|
+
# Mypy
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.workbuddy/
|
|
27
|
+
docs/
|
|
28
|
+
# OS
|
|
29
|
+
.DS_Store
|
|
30
|
+
Thumbs.db
|
|
31
|
+
|
|
32
|
+
# Code generation artifacts
|
|
33
|
+
tool_manifest.json
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dataify
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: dataify-sdk
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Python SDK that calls the Dataify upstream REST API directly (no MCP layer) — web scrapers and search engines.
|
|
5
|
+
Project-URL: Homepage, https://dashboard.dataify.com
|
|
6
|
+
Project-URL: Repository, https://github.com/dataify/dataify-sdk
|
|
7
|
+
Author-email: Dataify <support@dataify.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: amazon,dataify,google-search,scraper,serp,tiktok,web-scraper
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Dataify Python SDK
|
|
27
|
+
|
|
28
|
+
Python 客户端库,**直接调用** [Dataify](https://dashboard.dataify.com) 上游 REST 接口(**不走 MCP 协议**),用于网页采集与搜索引擎抓取。
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## 功能
|
|
32
|
+
|
|
33
|
+
- 🔍 **搜索引擎** — Google(17 种)、Bing(6 种)、Yandex、DuckDuckGo,走 `POST /request`
|
|
34
|
+
- 🛒 **平台抓取器** — Amazon、YouTube、TikTok、Facebook、Instagram、Reddit、Twitter/X、LinkedIn、Glassdoor、Indeed、Walmart、Zillow、Airbnb、Booking、Crunchbase、eBay、GitHub 等 45 个采集器,先走 `POST /builder?platform=1`,再可查询任务状态并下载结果
|
|
35
|
+
- 📖 **参数全暴露** — 每个工具函数把上游请求参数、类型、是否必填、中文描述都写在签名与 docstring 里;另见 `docs/api_reference.md`
|
|
36
|
+
- 🐍 **零依赖** — 仅用标准库 `urllib`,同步 API
|
|
37
|
+
|
|
38
|
+
## 安装
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install dataify-sdk
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
要求 Python >= 3.10。
|
|
45
|
+
|
|
46
|
+
## 快速开始
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from dataify_sdk import DataifyClient
|
|
50
|
+
from dataify_sdk.tools.amazonproduct import amazon_product_by_asin
|
|
51
|
+
from dataify_sdk.tools.googlesearch import google_search
|
|
52
|
+
|
|
53
|
+
# token 也可通过环境变量 DATAIFY_API_TOKEN 提供(兼容旧版 DATAIFY_TOKEN)
|
|
54
|
+
client = DataifyClient(token="YOUR_TOKEN")
|
|
55
|
+
|
|
56
|
+
# 采集类:先提交 Builder 任务
|
|
57
|
+
task = amazon_product_by_asin(asin="B0BZYCJK89", client=client)
|
|
58
|
+
task_id = task["data"]["task_id"]
|
|
59
|
+
|
|
60
|
+
# 再查询任务状态
|
|
61
|
+
status = client.query_scraper_task_status(task_id)
|
|
62
|
+
if status["data"]["status"] == "成功":
|
|
63
|
+
result = client.download_scraper_task_result(task_id, result_type="json")
|
|
64
|
+
|
|
65
|
+
# 搜索类:直接打搜索引擎接口
|
|
66
|
+
result = google_search(q="pizza", client=client)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
也可以不传 `client`,使用默认 client(优先读取 `DATAIFY_API_TOKEN`,兼容 `DATAIFY_TOKEN`):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
export DATAIFY_API_TOKEN="..."
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from dataify_sdk.tools.googlesearch import google_search
|
|
77
|
+
|
|
78
|
+
result = google_search(q="pizza")
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`client.query_scraper_task_status(...)` 会返回任务状态 JSON,`data.status` 常见值为 `处理中`、`成功`、`失败`。任务成功后可用 `client.download_scraper_task_result(task_id, result_type="json")` 下载最终结果;`result_type` 支持 `json`、`csv`、`xlsx`。
|
|
82
|
+
|
|
83
|
+
## API 设计
|
|
84
|
+
|
|
85
|
+
- **每个 `spider_id` = 一个独立函数**(采集类),例如 `amazon_product_by_asin()`、`amazon_product_by_url()`、`amazon_product_by_keywords()`。
|
|
86
|
+
- **搜索类每个引擎一个函数**,例如 `google_search()`、`bing_search()`、`yandex_search()`。
|
|
87
|
+
- 所有函数签名与 docstring 完整暴露上游参数及其描述;`docs/api_reference.md` 为离线参数手册。
|
|
88
|
+
- 函数返回解析后的 JSON `dict`(即上游原始响应)。
|
|
89
|
+
|
|
90
|
+
## 错误处理
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from dataify_sdk import DataifyClient, DataifyAPIError, DataifyConnectionError
|
|
94
|
+
|
|
95
|
+
client = DataifyClient(token="YOUR_TOKEN")
|
|
96
|
+
try:
|
|
97
|
+
result = google_search(q="pizza", client=client)
|
|
98
|
+
except DataifyAPIError as e:
|
|
99
|
+
print(f"上游返回错误 HTTP {e.status_code}: {e.body}")
|
|
100
|
+
except DataifyConnectionError:
|
|
101
|
+
print("无法连接 Dataify 上游")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 开发
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 安装开发依赖
|
|
108
|
+
pip install -e ".[dev]"
|
|
109
|
+
|
|
110
|
+
# 运行测试
|
|
111
|
+
pytest
|
|
112
|
+
|
|
113
|
+
# 从 Go 参考项目重新生成工具函数与参数手册
|
|
114
|
+
python scripts/codegen.py
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 许可
|
|
118
|
+
|
|
119
|
+
MIT License
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Dataify Python SDK 更新发布步骤
|
|
2
|
+
|
|
3
|
+
适用于把当前 `dataify-sdk` 新版本发布到 PyPI。
|
|
4
|
+
|
|
5
|
+
## 1. 更新版本号
|
|
6
|
+
|
|
7
|
+
修改两个位置,版本号必须一致:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
pyproject.toml
|
|
11
|
+
src/dataify_sdk/__init__.py
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
例如本次新增公开方法,建议改为:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
1.1.0
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 2. 检查代码状态
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
git status --short
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
确认只包含本次要发布的改动。
|
|
27
|
+
|
|
28
|
+
## 3. 安装开发依赖
|
|
29
|
+
|
|
30
|
+
```powershell
|
|
31
|
+
python -m pip install -e ".[dev]"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 4. 运行测试
|
|
35
|
+
|
|
36
|
+
```powershell
|
|
37
|
+
python -m pytest
|
|
38
|
+
python -m compileall src tests
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
测试通过后再继续。
|
|
42
|
+
|
|
43
|
+
## 5. 安装发布工具
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
python -m pip install --upgrade build twine
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 6. 清理旧构建产物
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
Remove-Item -LiteralPath .\dist -Recurse -Force -ErrorAction SilentlyContinue
|
|
53
|
+
Remove-Item -LiteralPath .\build -Recurse -Force -ErrorAction SilentlyContinue
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 7. 构建新版本
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
python -m build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
构建后检查 `dist/` 下是否生成:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
*.tar.gz
|
|
66
|
+
*.whl
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 8. 检查发布包
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
python -m twine check --strict dist/*
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
必须通过。
|
|
76
|
+
|
|
77
|
+
## 9. 先发到 TestPyPI
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
python -m twine upload --repository testpypi dist/*
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
登录时:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
username: __token__
|
|
87
|
+
password: TestPyPI token
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 10. 从 TestPyPI 安装验证
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
python -m venv .venv-testpypi-check
|
|
94
|
+
.\.venv-testpypi-check\Scripts\python -m pip install --upgrade pip
|
|
95
|
+
.\.venv-testpypi-check\Scripts\python -m pip install --index-url https://test.pypi.org/simple/ --no-deps dataify-sdk==<版本号>
|
|
96
|
+
.\.venv-testpypi-check\Scripts\python -c "import dataify_sdk; print(dataify_sdk.__version__)"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
确认输出版本号正确。
|
|
100
|
+
|
|
101
|
+
## 11. 发布到正式 PyPI
|
|
102
|
+
|
|
103
|
+
```powershell
|
|
104
|
+
python -m twine upload dist/*
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
登录时:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
username: __token__
|
|
111
|
+
password: PyPI token
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 12. 从正式 PyPI 安装验证
|
|
115
|
+
|
|
116
|
+
```powershell
|
|
117
|
+
python -m venv .venv-pypi-check
|
|
118
|
+
.\.venv-pypi-check\Scripts\python -m pip install --upgrade pip
|
|
119
|
+
.\.venv-pypi-check\Scripts\python -m pip install --no-cache-dir dataify-sdk==<版本号>
|
|
120
|
+
.\.venv-pypi-check\Scripts\python -c "import dataify_sdk; print(dataify_sdk.__version__)"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
确认输出版本号正确。
|
|
124
|
+
|
|
125
|
+
## 13. 打 Git Tag
|
|
126
|
+
|
|
127
|
+
```powershell
|
|
128
|
+
git tag v<版本号>
|
|
129
|
+
git push origin v<版本号>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 注意
|
|
133
|
+
|
|
134
|
+
- PyPI 已发布的同版本不能覆盖上传。
|
|
135
|
+
- token 不要写进代码、README 或提交记录。
|
|
136
|
+
- 如果发布后发现问题,直接修复后发下一个版本。
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Dataify Python SDK
|
|
2
|
+
|
|
3
|
+
Python 客户端库,**直接调用** [Dataify](https://dashboard.dataify.com) 上游 REST 接口(**不走 MCP 协议**),用于网页采集与搜索引擎抓取。
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## 功能
|
|
7
|
+
|
|
8
|
+
- 🔍 **搜索引擎** — Google(17 种)、Bing(6 种)、Yandex、DuckDuckGo,走 `POST /request`
|
|
9
|
+
- 🛒 **平台抓取器** — Amazon、YouTube、TikTok、Facebook、Instagram、Reddit、Twitter/X、LinkedIn、Glassdoor、Indeed、Walmart、Zillow、Airbnb、Booking、Crunchbase、eBay、GitHub 等 45 个采集器,先走 `POST /builder?platform=1`,再可查询任务状态并下载结果
|
|
10
|
+
- 📖 **参数全暴露** — 每个工具函数把上游请求参数、类型、是否必填、中文描述都写在签名与 docstring 里;另见 `docs/api_reference.md`
|
|
11
|
+
- 🐍 **零依赖** — 仅用标准库 `urllib`,同步 API
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install dataify-sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
要求 Python >= 3.10。
|
|
20
|
+
|
|
21
|
+
## 快速开始
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from dataify_sdk import DataifyClient
|
|
25
|
+
from dataify_sdk.tools.amazonproduct import amazon_product_by_asin
|
|
26
|
+
from dataify_sdk.tools.googlesearch import google_search
|
|
27
|
+
|
|
28
|
+
# token 也可通过环境变量 DATAIFY_API_TOKEN 提供(兼容旧版 DATAIFY_TOKEN)
|
|
29
|
+
client = DataifyClient(token="YOUR_TOKEN")
|
|
30
|
+
|
|
31
|
+
# 采集类:先提交 Builder 任务
|
|
32
|
+
task = amazon_product_by_asin(asin="B0BZYCJK89", client=client)
|
|
33
|
+
task_id = task["data"]["task_id"]
|
|
34
|
+
|
|
35
|
+
# 再查询任务状态
|
|
36
|
+
status = client.query_scraper_task_status(task_id)
|
|
37
|
+
if status["data"]["status"] == "成功":
|
|
38
|
+
result = client.download_scraper_task_result(task_id, result_type="json")
|
|
39
|
+
|
|
40
|
+
# 搜索类:直接打搜索引擎接口
|
|
41
|
+
result = google_search(q="pizza", client=client)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
也可以不传 `client`,使用默认 client(优先读取 `DATAIFY_API_TOKEN`,兼容 `DATAIFY_TOKEN`):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export DATAIFY_API_TOKEN="..."
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from dataify_sdk.tools.googlesearch import google_search
|
|
52
|
+
|
|
53
|
+
result = google_search(q="pizza")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`client.query_scraper_task_status(...)` 会返回任务状态 JSON,`data.status` 常见值为 `处理中`、`成功`、`失败`。任务成功后可用 `client.download_scraper_task_result(task_id, result_type="json")` 下载最终结果;`result_type` 支持 `json`、`csv`、`xlsx`。
|
|
57
|
+
|
|
58
|
+
## API 设计
|
|
59
|
+
|
|
60
|
+
- **每个 `spider_id` = 一个独立函数**(采集类),例如 `amazon_product_by_asin()`、`amazon_product_by_url()`、`amazon_product_by_keywords()`。
|
|
61
|
+
- **搜索类每个引擎一个函数**,例如 `google_search()`、`bing_search()`、`yandex_search()`。
|
|
62
|
+
- 所有函数签名与 docstring 完整暴露上游参数及其描述;`docs/api_reference.md` 为离线参数手册。
|
|
63
|
+
- 函数返回解析后的 JSON `dict`(即上游原始响应)。
|
|
64
|
+
|
|
65
|
+
## 错误处理
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from dataify_sdk import DataifyClient, DataifyAPIError, DataifyConnectionError
|
|
69
|
+
|
|
70
|
+
client = DataifyClient(token="YOUR_TOKEN")
|
|
71
|
+
try:
|
|
72
|
+
result = google_search(q="pizza", client=client)
|
|
73
|
+
except DataifyAPIError as e:
|
|
74
|
+
print(f"上游返回错误 HTTP {e.status_code}: {e.body}")
|
|
75
|
+
except DataifyConnectionError:
|
|
76
|
+
print("无法连接 Dataify 上游")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 开发
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# 安装开发依赖
|
|
83
|
+
pip install -e ".[dev]"
|
|
84
|
+
|
|
85
|
+
# 运行测试
|
|
86
|
+
pytest
|
|
87
|
+
|
|
88
|
+
# 从 Go 参考项目重新生成工具函数与参数手册
|
|
89
|
+
python scripts/codegen.py
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 许可
|
|
93
|
+
|
|
94
|
+
MIT License
|
|
@@ -1,66 +1,48 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["hatchling"]
|
|
3
|
-
build-backend = "hatchling.build"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "dataify-sdk"
|
|
7
|
-
version = "
|
|
8
|
-
description = "Python SDK
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
license = {text = "MIT"}
|
|
11
|
-
requires-python = ">=3.10"
|
|
12
|
-
authors = [{name = "Dataify", email = "support@dataify.com"}]
|
|
13
|
-
keywords = ["
|
|
14
|
-
classifiers = [
|
|
15
|
-
"Development Status :: 4 - Beta",
|
|
16
|
-
"Intended Audience :: Developers",
|
|
17
|
-
"License :: OSI Approved :: MIT License",
|
|
18
|
-
"Programming Language :: Python :: 3",
|
|
19
|
-
"Programming Language :: Python :: 3.10",
|
|
20
|
-
"Programming Language :: Python :: 3.11",
|
|
21
|
-
"Programming Language :: Python :: 3.12",
|
|
22
|
-
"Programming Language :: Python :: 3.13",
|
|
23
|
-
"Topic :: Internet :: WWW/HTTP",
|
|
24
|
-
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
25
|
-
]
|
|
26
|
-
dependencies = [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[tool.ruff]
|
|
51
|
-
line-length = 100
|
|
52
|
-
target-version = "py310"
|
|
53
|
-
|
|
54
|
-
[tool.ruff.lint]
|
|
55
|
-
select = ["E", "F", "I", "N", "W", "UP"]
|
|
56
|
-
|
|
57
|
-
[tool.mypy]
|
|
58
|
-
strict = true
|
|
59
|
-
python_version = "3.10"
|
|
60
|
-
|
|
61
|
-
[tool.pytest.ini_options]
|
|
62
|
-
asyncio_mode = "auto"
|
|
63
|
-
testpaths = ["tests"]
|
|
64
|
-
filterwarnings = [
|
|
65
|
-
"ignore:Field name.*shadows an attribute in parent.*BaseModel:UserWarning",
|
|
66
|
-
]
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "dataify-sdk"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
description = "Python SDK that calls the Dataify upstream REST API directly (no MCP layer) — web scrapers and search engines."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{name = "Dataify", email = "support@dataify.com"}]
|
|
13
|
+
keywords = ["dataify", "serp", "scraper", "google-search", "web-scraper", "amazon", "tiktok"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
24
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
25
|
+
]
|
|
26
|
+
dependencies = []
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = [
|
|
30
|
+
"pytest>=8.0.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://dashboard.dataify.com"
|
|
35
|
+
Repository = "https://github.com/dataify/dataify-sdk"
|
|
36
|
+
|
|
37
|
+
[tool.hatch.build.targets.wheel]
|
|
38
|
+
packages = ["src/dataify_sdk"]
|
|
39
|
+
|
|
40
|
+
[tool.ruff]
|
|
41
|
+
line-length = 100
|
|
42
|
+
target-version = "py310"
|
|
43
|
+
|
|
44
|
+
[tool.ruff.lint]
|
|
45
|
+
select = ["E", "F", "I", "N", "W", "UP"]
|
|
46
|
+
|
|
47
|
+
[tool.pytest.ini_options]
|
|
48
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Regenerate the Dataify SDK tool layer from the Go reference project.
|
|
3
|
+
|
|
4
|
+
The Go project at ``C:\\dataify\\dataify_mcp_api`` is the source of truth. This
|
|
5
|
+
script invokes the generator, which writes ``src/dataify_sdk/tools/*.py`` and
|
|
6
|
+
``docs/api_reference.md``.
|
|
7
|
+
|
|
8
|
+
Usage::
|
|
9
|
+
|
|
10
|
+
python scripts/codegen.py
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import sys
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
_ROOT = Path(__file__).resolve().parent.parent
|
|
19
|
+
sys.path.insert(0, str(_ROOT / "src"))
|
|
20
|
+
|
|
21
|
+
from dataify_sdk._codegen.generate import main
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == "__main__":
|
|
28
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Dataify SDK — a Python client that talks **directly** to the Dataify
|
|
2
|
+
upstream REST API (no MCP layer).
|
|
3
|
+
|
|
4
|
+
Typical usage::
|
|
5
|
+
|
|
6
|
+
from dataify_sdk import DataifyClient
|
|
7
|
+
from dataify_sdk.tools.amazonproduct import amazon_product_by_asin
|
|
8
|
+
|
|
9
|
+
client = DataifyClient(token="YOUR_TOKEN")
|
|
10
|
+
task = amazon_product_by_asin(asin="B0BZYCJK89", client=client)
|
|
11
|
+
task_id = task["data"]["task_id"]
|
|
12
|
+
status = client.query_scraper_task_status(task_id)
|
|
13
|
+
if status["data"]["status"] == "成功":
|
|
14
|
+
result = client.download_scraper_task_result(task_id, result_type="json")
|
|
15
|
+
|
|
16
|
+
or, using the default client (token from ``DATAIFY_API_TOKEN``, with
|
|
17
|
+
``DATAIFY_TOKEN`` still accepted)::
|
|
18
|
+
|
|
19
|
+
task = amazon_product_by_asin(asin="B0BZYCJK89")
|
|
20
|
+
client = DataifyClient()
|
|
21
|
+
status = client.query_scraper_task_status(task["data"]["task_id"])
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from __future__ import annotations
|
|
25
|
+
|
|
26
|
+
from dataify_sdk.client import DataifyClient, get_default_client
|
|
27
|
+
from dataify_sdk.errors import (
|
|
28
|
+
DataifyAPIError,
|
|
29
|
+
DataifyConnectionError,
|
|
30
|
+
DataifyError,
|
|
31
|
+
DataifyTimeoutError,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
__version__ = "1.1.0"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"__version__",
|
|
41
|
+
"DataifyClient",
|
|
42
|
+
"get_default_client",
|
|
43
|
+
"DataifyError",
|
|
44
|
+
"DataifyAPIError",
|
|
45
|
+
"DataifyConnectionError",
|
|
46
|
+
"DataifyTimeoutError",
|
|
47
|
+
]
|