thordata-sdk 1.0.1__py3-none-any.whl → 1.1.0__py3-none-any.whl
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.
- thordata/__init__.py +1 -1
- thordata/_example_utils.py +3 -2
- thordata/_utils.py +4 -4
- thordata/async_client.py +80 -79
- thordata/client.py +69 -72
- thordata/demo.py +1 -3
- thordata/exceptions.py +12 -12
- thordata/models.py +67 -70
- thordata/retry.py +13 -13
- thordata_sdk-1.1.0.dist-info/METADATA +271 -0
- thordata_sdk-1.1.0.dist-info/RECORD +15 -0
- thordata_sdk-1.0.1.dist-info/METADATA +0 -208
- thordata_sdk-1.0.1.dist-info/RECORD +0 -15
- {thordata_sdk-1.0.1.dist-info → thordata_sdk-1.1.0.dist-info}/WHEEL +0 -0
- {thordata_sdk-1.0.1.dist-info → thordata_sdk-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {thordata_sdk-1.0.1.dist-info → thordata_sdk-1.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
thordata/__init__.py,sha256=j0neEPELLoPxwYdfHBgQDf-7z0mpMtrmOXWDZZW7Tq0,3195
|
|
2
|
+
thordata/_example_utils.py,sha256=T9QtVq9BHhubOShgtGp2GSusYYd-ZFUJFJAw7ubIsa4,2199
|
|
3
|
+
thordata/_utils.py,sha256=Acr_6sHgdZXU7SQozd6FEYTZV6iHw__nlhpBTDwb66U,4917
|
|
4
|
+
thordata/async_client.py,sha256=MOPW4ZZegd9kI2z7YWxweqM1FzU4KrxOg53xDDRlzdM,55155
|
|
5
|
+
thordata/client.py,sha256=yZeRwncYDVIHMZK-IB9CVOj0Mk289bD6ZMYP2axoCmo,33949
|
|
6
|
+
thordata/demo.py,sha256=HQzgaUM33bWD7mBQ6HEkK5K6zqFnSAHLvaam6BwPgFA,3762
|
|
7
|
+
thordata/enums.py,sha256=MpZnS9_8sg2vtcFqM6UicB94cKZm5R1t83L3ejNSbLs,8502
|
|
8
|
+
thordata/exceptions.py,sha256=P9czrxkFhT439DxW3LE5W-koS595ObH4-mAQOfaDM18,9976
|
|
9
|
+
thordata/models.py,sha256=et-DiHe9m_MCx2l6JL30XVA845b5pxbW-HsZSDL3RDw,37486
|
|
10
|
+
thordata/retry.py,sha256=5kRwULl3X68Nx8PlSzr9benfyCL0nRSpVQXrwjWr45M,11456
|
|
11
|
+
thordata_sdk-1.1.0.dist-info/licenses/LICENSE,sha256=bAxpWgQIzb-5jl3nhLdOwOJ_vlbHLtSG7yev2B7vioY,1088
|
|
12
|
+
thordata_sdk-1.1.0.dist-info/METADATA,sha256=qkK2XguzZh49ZDelJaLf3BkNzY3ldd_3nPow2_JO1WU,7339
|
|
13
|
+
thordata_sdk-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
thordata_sdk-1.1.0.dist-info/top_level.txt,sha256=Z8R_07m0lXCCSb1hapL9_nxMtyO3rf_9wOvq4n9u2Hg,9
|
|
15
|
+
thordata_sdk-1.1.0.dist-info/RECORD,,
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: thordata-sdk
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network.
|
|
5
|
-
Author-email: Thordata Developer Team <support@thordata.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://www.thordata.com
|
|
8
|
-
Project-URL: Documentation, https://github.com/Thordata/thordata-python-sdk#readme
|
|
9
|
-
Project-URL: Source, https://github.com/Thordata/thordata-python-sdk
|
|
10
|
-
Project-URL: Tracker, https://github.com/Thordata/thordata-python-sdk/issues
|
|
11
|
-
Project-URL: Changelog, https://github.com/Thordata/thordata-python-sdk/blob/main/CHANGELOG.md
|
|
12
|
-
Keywords: web scraping,proxy,residential proxy,datacenter proxy,ai,llm,data-mining,serp,thordata,web scraper,anti-bot bypass
|
|
13
|
-
Classifier: Development Status :: 4 - Beta
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
-
Classifier: Topic :: Internet :: WWW/HTTP
|
|
17
|
-
Classifier: Topic :: Internet :: Proxy Servers
|
|
18
|
-
Classifier: Programming Language :: Python :: 3
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
24
|
-
Classifier: Operating System :: OS Independent
|
|
25
|
-
Classifier: Typing :: Typed
|
|
26
|
-
Requires-Python: >=3.9
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
License-File: LICENSE
|
|
29
|
-
Requires-Dist: requests>=2.25.0
|
|
30
|
-
Requires-Dist: aiohttp>=3.9.0
|
|
31
|
-
Provides-Extra: dev
|
|
32
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
33
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
34
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
35
|
-
Requires-Dist: pytest-httpserver>=1.0.0; extra == "dev"
|
|
36
|
-
Requires-Dist: python-dotenv>=1.0.0; extra == "dev"
|
|
37
|
-
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
38
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
39
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
40
|
-
Requires-Dist: types-requests>=2.28.0; extra == "dev"
|
|
41
|
-
Requires-Dist: aioresponses>=0.7.6; extra == "dev"
|
|
42
|
-
Dynamic: license-file
|
|
43
|
-
|
|
44
|
-
# Thordata Python SDK
|
|
45
|
-
|
|
46
|
-
<div align="center">
|
|
47
|
-
|
|
48
|
-
**Official Python client for Thordata's Proxy Network, SERP API, Web Unlocker, and Web Scraper API.**
|
|
49
|
-
|
|
50
|
-
*Async-ready, type-safe, built for AI agents and large-scale data collection.*
|
|
51
|
-
|
|
52
|
-
[](https://pypi.org/project/thordata-sdk/)
|
|
53
|
-
[](https://python.org)
|
|
54
|
-
[](LICENSE)
|
|
55
|
-
|
|
56
|
-
[Documentation](https://doc.thordata.com) • [Dashboard](https://www.thordata.com) • [Examples](examples/)
|
|
57
|
-
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## ✨ Features
|
|
63
|
-
|
|
64
|
-
- 🌐 **Proxy Network**: Residential, Mobile, Datacenter, ISP proxies with geo-targeting
|
|
65
|
-
- 🔍 **SERP API**: Google, Bing, Yandex, DuckDuckGo search results
|
|
66
|
-
- 🔓 **Web Unlocker**: Bypass Cloudflare, CAPTCHAs, anti-bot systems
|
|
67
|
-
- 🕷️ **Web Scraper API**: Async task-based scraping (Text & Video/Audio)
|
|
68
|
-
- 📊 **Account Management**: Usage stats, sub-users, IP whitelist
|
|
69
|
-
- ⚡ **Async Support**: Full async/await support with aiohttp
|
|
70
|
-
- 🔄 **Auto Retry**: Configurable retry with exponential backoff
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 📦 Installation
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
pip install thordata-sdk
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## 🔐 Configuration
|
|
83
|
-
|
|
84
|
-
Set environment variables:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
# Required for Scraper APIs (SERP, Universal, Tasks)
|
|
88
|
-
export THORDATA_SCRAPER_TOKEN=your_token
|
|
89
|
-
|
|
90
|
-
# Public/Location APIs (Dashboard -> My account -> API)
|
|
91
|
-
export THORDATA_PUBLIC_TOKEN=your_public_token
|
|
92
|
-
export THORDATA_PUBLIC_KEY=your_public_key
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## 🚀 Quick Start
|
|
99
|
-
|
|
100
|
-
```python
|
|
101
|
-
from thordata import ThordataClient, Engine
|
|
102
|
-
|
|
103
|
-
# Initialize (reads from env vars)
|
|
104
|
-
client = ThordataClient(
|
|
105
|
-
scraper_token="your_token",
|
|
106
|
-
public_token="pub_token",
|
|
107
|
-
public_key="pub_key"
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
# SERP Search
|
|
111
|
-
results = client.serp_search("python tutorial", engine=Engine.GOOGLE)
|
|
112
|
-
print(f"Found {len(results.get('organic', []))} results")
|
|
113
|
-
|
|
114
|
-
# Universal Scrape
|
|
115
|
-
html = client.universal_scrape("https://httpbin.org/html")
|
|
116
|
-
print(html[:100])
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 📖 Feature Guide
|
|
122
|
-
|
|
123
|
-
### SERP API
|
|
124
|
-
|
|
125
|
-
```python
|
|
126
|
-
from thordata import SerpRequest
|
|
127
|
-
|
|
128
|
-
# Advanced search
|
|
129
|
-
results = client.serp_search_advanced(SerpRequest(
|
|
130
|
-
query="pizza",
|
|
131
|
-
engine="google_local",
|
|
132
|
-
country="us",
|
|
133
|
-
location="New York",
|
|
134
|
-
num=10
|
|
135
|
-
))
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Web Scraper API (Async Tasks)
|
|
139
|
-
|
|
140
|
-
**Create Task:**
|
|
141
|
-
```python
|
|
142
|
-
task_id = client.create_scraper_task(
|
|
143
|
-
file_name="my_task",
|
|
144
|
-
spider_id="universal",
|
|
145
|
-
spider_name="universal",
|
|
146
|
-
parameters={"url": "https://example.com"}
|
|
147
|
-
)
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
**Video Download (New):**
|
|
151
|
-
```python
|
|
152
|
-
from thordata import CommonSettings
|
|
153
|
-
|
|
154
|
-
task_id = client.create_video_task(
|
|
155
|
-
file_name="{{VideoID}}",
|
|
156
|
-
spider_id="youtube_video_by-url",
|
|
157
|
-
spider_name="youtube.com",
|
|
158
|
-
parameters={"url": "https://youtube.com/watch?v=..."},
|
|
159
|
-
common_settings=CommonSettings(resolution="1080p")
|
|
160
|
-
)
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
**Wait & Download:**
|
|
164
|
-
```python
|
|
165
|
-
status = client.wait_for_task(task_id)
|
|
166
|
-
if status == "ready":
|
|
167
|
-
url = client.get_task_result(task_id)
|
|
168
|
-
print(url)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Account Management
|
|
172
|
-
|
|
173
|
-
```python
|
|
174
|
-
# Usage Statistics
|
|
175
|
-
stats = client.get_usage_statistics("2024-01-01", "2024-01-31")
|
|
176
|
-
print(f"Balance: {stats.balance_gb():.2f} GB")
|
|
177
|
-
|
|
178
|
-
# Proxy Users
|
|
179
|
-
users = client.list_proxy_users()
|
|
180
|
-
print(f"Sub-users: {users.user_count}")
|
|
181
|
-
|
|
182
|
-
# Whitelist IP
|
|
183
|
-
client.add_whitelist_ip("1.2.3.4")
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Proxy Network
|
|
187
|
-
|
|
188
|
-
```python
|
|
189
|
-
from thordata import ProxyConfig
|
|
190
|
-
|
|
191
|
-
# Generate Proxy URL
|
|
192
|
-
proxy_url = client.build_proxy_url(
|
|
193
|
-
username="proxy_user",
|
|
194
|
-
password="proxy_pass",
|
|
195
|
-
country="us",
|
|
196
|
-
city="ny"
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
# Use with requests
|
|
200
|
-
import requests
|
|
201
|
-
requests.get("https://httpbin.org/ip", proxies={"http": proxy_url, "https": proxy_url})
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## 📄 License
|
|
207
|
-
|
|
208
|
-
MIT License
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
thordata/__init__.py,sha256=H63yitagEugWNGvHO3ctitO4xIAT9OR0gnLgTqhrp6Q,3195
|
|
2
|
-
thordata/_example_utils.py,sha256=a7hSQwxS9OqOatvRYm2NkZRakSJ186tNWbHpJ7WskFc,2185
|
|
3
|
-
thordata/_utils.py,sha256=VlvrDm91t0NLQ4Xis7gXOyoFWn1Rxkl7lMvpXHatdqI,4923
|
|
4
|
-
thordata/async_client.py,sha256=XSsT3ariDWSvP32ny_aqf5dTN56T7yMTraaJOgeDi-g,55416
|
|
5
|
-
thordata/client.py,sha256=W5_zvVJ82lKfzc-a3Vscv9bZOEMMtCTLnYeQ3ozim6Q,34224
|
|
6
|
-
thordata/demo.py,sha256=zmG4I4cHXnbmQfbr063SeRK7_9IXrfof9QFoGqGTVm8,3806
|
|
7
|
-
thordata/enums.py,sha256=MpZnS9_8sg2vtcFqM6UicB94cKZm5R1t83L3ejNSbLs,8502
|
|
8
|
-
thordata/exceptions.py,sha256=IgMsFuh49cPxU5YofsKP1UhP5A_snhtuN6xD1yZWLiI,10018
|
|
9
|
-
thordata/models.py,sha256=X7wxS6kk18OGX-OLvCdxl0rhpQrAAM3WYLRnjzrWcOM,37690
|
|
10
|
-
thordata/retry.py,sha256=vb05YexCHjiiZTSm8_eK-_3BsCecplGpFjQ3XBwQ8FY,11505
|
|
11
|
-
thordata_sdk-1.0.1.dist-info/licenses/LICENSE,sha256=bAxpWgQIzb-5jl3nhLdOwOJ_vlbHLtSG7yev2B7vioY,1088
|
|
12
|
-
thordata_sdk-1.0.1.dist-info/METADATA,sha256=nwhbmpsWu65_q0d6Fqpwc1sBjkaTfgUW5vxukBZZaK4,5667
|
|
13
|
-
thordata_sdk-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
-
thordata_sdk-1.0.1.dist-info/top_level.txt,sha256=Z8R_07m0lXCCSb1hapL9_nxMtyO3rf_9wOvq4n9u2Hg,9
|
|
15
|
-
thordata_sdk-1.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|