Skip to main content

Dataify Python SDK

Python 客户端库,直接调用 Dataify 上游 REST 接口(不走 MCP 协议),用于网页采集与搜索引擎抓取。

功能

  • 🔍 搜索引擎 — Google(17 种)、Bing(6 种)、Yandex、DuckDuckGo,走 POST /request
  • 🛒 平台抓取器 — Amazon、YouTube、TikTok、Facebook、Instagram、Reddit、Twitter/X、LinkedIn、Glassdoor、Indeed、Walmart、Zillow、Airbnb、Booking、Crunchbase、eBay、GitHub 等 45 个采集器,走 POST /builder?platform=1
  • 📖 参数全暴露 — 每个工具函数把上游请求参数、类型、是否必填、中文描述都写在签名与 docstring 里;另见 docs/api_reference.md
  • 🐍 零依赖 — 仅用标准库 urllib,同步 API

安装

pip install dataify-sdk

要求 Python >= 3.10。

快速开始

from dataify_sdk import DataifyClient
from dataify_sdk.tools.amazonproduct import amazon_product_by_asin
from dataify_sdk.tools.googlesearch import google_search

# token 也可通过环境变量 DATAIFY_TOKEN 提供
client = DataifyClient(token="YOUR_TOKEN")

# 采集类:直接提交 Builder 任务
result = amazon_product_by_asin(asin="B0BZYCJK89", client=client)

# 搜索类:直接打搜索引擎接口
result = google_search(q="pizza", client=client)

也可以不传 client,使用默认 client(读取 DATAIFY_TOKEN 环境变量):

from dataify_sdk.tools.googlesearch import google_search

result = google_search(q="pizza")

API 设计

  • 每个 spider_id = 一个独立函数(采集类),例如 amazon_product_by_asin()amazon_product_by_url()amazon_product_by_keywords()
  • 搜索类每个引擎一个函数,例如 google_search()bing_search()yandex_search()
  • 所有函数签名与 docstring 完整暴露上游参数及其描述;docs/api_reference.md 为离线参数手册。
  • 函数返回解析后的 JSON dict(即上游原始响应)。

错误处理

from dataify_sdk import DataifyClient, DataifyAPIError, DataifyConnectionError

client = DataifyClient(token="YOUR_TOKEN")
try:
    result = google_search(q="pizza", client=client)
except DataifyAPIError as e:
    print(f"上游返回错误 HTTP {e.status_code}: {e.body}")
except DataifyConnectionError:
    print("无法连接 Dataify 上游")

开发

# 安装开发依赖
pip install -e ".[dev]"

# 运行测试
pytest

# 从 Go 参考项目重新生成工具函数与参数手册
python scripts/codegen.py

许可

MIT License

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataify_sdk-1.0.0.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataify_sdk-1.0.0-py3-none-any.whl (128.6 kB view details)

Uploaded Python 3

File details

Details for the file dataify_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: dataify_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.12

File hashes

Hashes for dataify_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aaaebea2d43d7f118045990f7d8a266b7ff0e03a211d3aaeb6e521dc6ea75b60
MD5 415b01aadd014b5f6632a2cb77bb198b
BLAKE2b-256 e42396385df560de587d9f0a1bf9267d89ee76c59c948edabd031e2ab6891733

See more details on using hashes here.

File details

Details for the file dataify_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dataify_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 128.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.12

File hashes

Hashes for dataify_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f28eca47e85df479c6e4af95593b24daaa2dc933e9102e5ba657bb078565577
MD5 daea3f3c1b79ec8901fcc2bb594fb99c
BLAKE2b-256 286d37d4430908658e81b41e3726922dd9e8953778576fe38419278f6bebc0ae

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page