thordata-sdk 1.4.0__py3-none-any.whl → 1.6.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 +4 -40
- thordata/async_client.py +503 -1796
- thordata/client.py +444 -1322
- thordata/core/__init__.py +23 -0
- thordata/core/async_http_client.py +91 -0
- thordata/core/http_client.py +79 -0
- thordata/core/tunnel.py +287 -0
- thordata/enums.py +41 -380
- thordata/exceptions.py +70 -19
- thordata/models.py +37 -1193
- thordata/retry.py +1 -1
- thordata/tools/__init__.py +38 -0
- thordata/tools/base.py +42 -0
- thordata/tools/code.py +39 -0
- thordata/tools/ecommerce.py +251 -0
- thordata/tools/professional.py +155 -0
- thordata/tools/search.py +115 -0
- thordata/tools/social.py +374 -0
- thordata/tools/travel.py +100 -0
- thordata/tools/video.py +154 -0
- thordata/types/__init__.py +77 -0
- thordata/types/common.py +141 -0
- thordata/types/proxy.py +340 -0
- thordata/types/serp.py +224 -0
- thordata/types/task.py +156 -0
- thordata/types/universal.py +66 -0
- thordata/unlimited.py +67 -0
- thordata_sdk-1.6.0.dist-info/METADATA +287 -0
- thordata_sdk-1.6.0.dist-info/RECORD +35 -0
- {thordata_sdk-1.4.0.dist-info → thordata_sdk-1.6.0.dist-info}/WHEEL +1 -1
- thordata/_example_utils.py +0 -77
- thordata/demo.py +0 -138
- thordata_sdk-1.4.0.dist-info/METADATA +0 -208
- thordata_sdk-1.4.0.dist-info/RECORD +0 -18
- {thordata_sdk-1.4.0.dist-info → thordata_sdk-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {thordata_sdk-1.4.0.dist-info → thordata_sdk-1.6.0.dist-info}/top_level.txt +0 -0
thordata/__init__.py
CHANGED
|
@@ -3,47 +3,17 @@ Thordata Python SDK
|
|
|
3
3
|
|
|
4
4
|
Official Python client for Thordata's Proxy Network, SERP API,
|
|
5
5
|
Universal Scraping API (Web Unlocker), and Web Scraper API.
|
|
6
|
-
|
|
7
|
-
Basic Usage:
|
|
8
|
-
>>> from thordata import ThordataClient
|
|
9
|
-
>>>
|
|
10
|
-
>>> client = ThordataClient(
|
|
11
|
-
... scraper_token="your_token",
|
|
12
|
-
... public_token="your_public_token",
|
|
13
|
-
... public_key="your_public_key"
|
|
14
|
-
... )
|
|
15
|
-
>>>
|
|
16
|
-
>>> # Proxy request
|
|
17
|
-
>>> response = client.get("https://httpbin.org/ip")
|
|
18
|
-
>>>
|
|
19
|
-
>>> # SERP search
|
|
20
|
-
>>> results = client.serp_search("python tutorial", engine="google")
|
|
21
|
-
>>>
|
|
22
|
-
>>> # Universal scrape
|
|
23
|
-
>>> html = client.universal_scrape("https://example.com", js_render=True)
|
|
24
|
-
|
|
25
|
-
Async Usage:
|
|
26
|
-
>>> from thordata import AsyncThordataClient
|
|
27
|
-
>>> import asyncio
|
|
28
|
-
>>>
|
|
29
|
-
>>> async def main():
|
|
30
|
-
... async with AsyncThordataClient(
|
|
31
|
-
... scraper_token="your_token"
|
|
32
|
-
... ) as client:
|
|
33
|
-
... response = await client.get("https://httpbin.org/ip")
|
|
34
|
-
>>>
|
|
35
|
-
>>> asyncio.run(main())
|
|
36
6
|
"""
|
|
37
7
|
|
|
38
|
-
__version__ = "1.
|
|
39
|
-
__author__ = "Thordata Developer Team"
|
|
8
|
+
__version__ = "1.6.0"
|
|
9
|
+
__author__ = "Thordata Developer Team/Kael Odin"
|
|
40
10
|
__email__ = "support@thordata.com"
|
|
41
11
|
|
|
42
12
|
# Main clients
|
|
43
13
|
from .async_client import AsyncThordataClient
|
|
44
14
|
from .client import ThordataClient
|
|
45
15
|
|
|
46
|
-
# Enums
|
|
16
|
+
# Enums (Legacy Import Path)
|
|
47
17
|
from .enums import (
|
|
48
18
|
BingSearchType,
|
|
49
19
|
Continent,
|
|
@@ -76,7 +46,7 @@ from .exceptions import (
|
|
|
76
46
|
ThordataValidationError,
|
|
77
47
|
)
|
|
78
48
|
|
|
79
|
-
# Models
|
|
49
|
+
# Models (Legacy Import Path)
|
|
80
50
|
from .models import (
|
|
81
51
|
CommonSettings,
|
|
82
52
|
ProxyConfig,
|
|
@@ -99,12 +69,9 @@ from .retry import RetryConfig
|
|
|
99
69
|
|
|
100
70
|
# Public API
|
|
101
71
|
__all__ = [
|
|
102
|
-
# Version
|
|
103
72
|
"__version__",
|
|
104
|
-
# Clients
|
|
105
73
|
"ThordataClient",
|
|
106
74
|
"AsyncThordataClient",
|
|
107
|
-
# Enums
|
|
108
75
|
"Engine",
|
|
109
76
|
"GoogleSearchType",
|
|
110
77
|
"BingSearchType",
|
|
@@ -120,7 +87,6 @@ __all__ = [
|
|
|
120
87
|
"ProxyHost",
|
|
121
88
|
"ProxyPort",
|
|
122
89
|
"GoogleTbm",
|
|
123
|
-
# Models
|
|
124
90
|
"ProxyConfig",
|
|
125
91
|
"ProxyProduct",
|
|
126
92
|
"ProxyServer",
|
|
@@ -135,7 +101,6 @@ __all__ = [
|
|
|
135
101
|
"CommonSettings",
|
|
136
102
|
"VideoTaskConfig",
|
|
137
103
|
"TaskStatusResponse",
|
|
138
|
-
# Exceptions
|
|
139
104
|
"ThordataError",
|
|
140
105
|
"ThordataConfigError",
|
|
141
106
|
"ThordataNetworkError",
|
|
@@ -146,6 +111,5 @@ __all__ = [
|
|
|
146
111
|
"ThordataServerError",
|
|
147
112
|
"ThordataValidationError",
|
|
148
113
|
"ThordataNotCollectedError",
|
|
149
|
-
# Retry
|
|
150
114
|
"RetryConfig",
|
|
151
115
|
]
|