thordata-sdk 0.6.0__tar.gz → 0.7.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.
- {thordata_sdk-0.6.0/src/thordata_sdk.egg-info → thordata_sdk-0.7.0}/PKG-INFO +1 -1
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/pyproject.toml +1 -1
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/__init__.py +3 -1
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/enums.py +82 -13
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0/src/thordata_sdk.egg-info}/PKG-INFO +1 -1
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/LICENSE +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/README.md +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/setup.cfg +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/_utils.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/async_client.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/client.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/demo.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/exceptions.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/models.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/parameters.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata/retry.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata_sdk.egg-info/SOURCES.txt +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata_sdk.egg-info/dependency_links.txt +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata_sdk.egg-info/requires.txt +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/src/thordata_sdk.egg-info/top_level.txt +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_async_client.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_async_client_errors.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_client.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_client_errors.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_demo_entrypoint.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_enums.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_examples_async_high_concurrency.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_examples_demo_serp_api.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_examples_demo_universal.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_examples_demo_web_scraper_api.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_exceptions.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_models.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_task_status_and_wait.py +0 -0
- {thordata_sdk-0.6.0 → thordata_sdk-0.7.0}/tests/test_user_agent.py +0 -0
|
@@ -35,7 +35,7 @@ Async Usage:
|
|
|
35
35
|
>>> asyncio.run(main())
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
-
__version__ = "0.
|
|
38
|
+
__version__ = "0.7.0"
|
|
39
39
|
__author__ = "Thordata Developer Team"
|
|
40
40
|
__email__ = "support@thordata.com"
|
|
41
41
|
|
|
@@ -52,6 +52,7 @@ from .enums import (
|
|
|
52
52
|
Device,
|
|
53
53
|
Engine,
|
|
54
54
|
GoogleSearchType,
|
|
55
|
+
GoogleTbm,
|
|
55
56
|
OutputFormat,
|
|
56
57
|
ProxyHost,
|
|
57
58
|
ProxyPort,
|
|
@@ -112,6 +113,7 @@ __all__ = [
|
|
|
112
113
|
"TimeRange",
|
|
113
114
|
"ProxyHost",
|
|
114
115
|
"ProxyPort",
|
|
116
|
+
"GoogleTbm",
|
|
115
117
|
# Models
|
|
116
118
|
"ProxyConfig",
|
|
117
119
|
"ProxyProduct",
|
|
@@ -62,33 +62,90 @@ class ProxyPort(IntEnum):
|
|
|
62
62
|
class Engine(str, Enum):
|
|
63
63
|
"""
|
|
64
64
|
Supported search engines for SERP API.
|
|
65
|
+
|
|
66
|
+
Engine naming convention:
|
|
67
|
+
- Base search: {engine} for basic web search (google, bing, yandex, duckduckgo)
|
|
68
|
+
- Verticals: {engine}_{vertical} (e.g., google_news, bing_images)
|
|
69
|
+
- Sub-verticals: {engine}_{vertical}_{sub} (e.g., google_scholar_cite)
|
|
65
70
|
"""
|
|
66
71
|
|
|
72
|
+
# ===================
|
|
73
|
+
# Google
|
|
74
|
+
# ===================
|
|
67
75
|
GOOGLE = "google"
|
|
76
|
+
GOOGLE_SEARCH = "google_search"
|
|
77
|
+
GOOGLE_AI_MODE = "google_ai_mode"
|
|
78
|
+
GOOGLE_WEB = "google_web"
|
|
79
|
+
GOOGLE_SHOPPING = "google_shopping"
|
|
80
|
+
GOOGLE_LOCAL = "google_local"
|
|
81
|
+
GOOGLE_VIDEOS = "google_videos"
|
|
82
|
+
GOOGLE_NEWS = "google_news"
|
|
83
|
+
GOOGLE_FLIGHTS = "google_flights"
|
|
84
|
+
GOOGLE_IMAGES = "google_images"
|
|
85
|
+
GOOGLE_LENS = "google_lens"
|
|
86
|
+
GOOGLE_TRENDS = "google_trends"
|
|
87
|
+
GOOGLE_HOTELS = "google_hotels"
|
|
88
|
+
GOOGLE_PLAY = "google_play"
|
|
89
|
+
GOOGLE_JOBS = "google_jobs"
|
|
90
|
+
GOOGLE_SCHOLAR = "google_scholar"
|
|
91
|
+
GOOGLE_SCHOLAR_CITE = "google_scholar_cite"
|
|
92
|
+
GOOGLE_SCHOLAR_AUTHOR = "google_scholar_author"
|
|
93
|
+
GOOGLE_MAPS = "google_maps"
|
|
94
|
+
GOOGLE_FINANCE = "google_finance"
|
|
95
|
+
GOOGLE_FINANCE_MARKETS = "google_finance_markets"
|
|
96
|
+
GOOGLE_PATENTS = "google_patents"
|
|
97
|
+
GOOGLE_PATENTS_DETAILS = "google_patents_details"
|
|
98
|
+
|
|
99
|
+
# ===================
|
|
100
|
+
# Bing
|
|
101
|
+
# ===================
|
|
68
102
|
BING = "bing"
|
|
103
|
+
BING_SEARCH = "bing_search"
|
|
104
|
+
BING_IMAGES = "bing_images"
|
|
105
|
+
BING_VIDEOS = "bing_videos"
|
|
106
|
+
BING_NEWS = "bing_news"
|
|
107
|
+
BING_MAPS = "bing_maps"
|
|
108
|
+
BING_SHOPPING = "bing_shopping"
|
|
109
|
+
|
|
110
|
+
# ===================
|
|
111
|
+
# Yandex
|
|
112
|
+
# ===================
|
|
69
113
|
YANDEX = "yandex"
|
|
114
|
+
YANDEX_SEARCH = "yandex_search"
|
|
115
|
+
|
|
116
|
+
# ===================
|
|
117
|
+
# DuckDuckGo
|
|
118
|
+
# ===================
|
|
70
119
|
DUCKDUCKGO = "duckduckgo"
|
|
71
|
-
|
|
72
|
-
YAHOO = "yahoo"
|
|
73
|
-
NAVER = "naver"
|
|
120
|
+
DUCKDUCKGO_SEARCH = "duckduckgo_search"
|
|
74
121
|
|
|
75
122
|
|
|
76
123
|
class GoogleSearchType(str, Enum):
|
|
77
124
|
"""
|
|
78
125
|
Search types specific to Google.
|
|
126
|
+
|
|
127
|
+
These map to the second part of Google engine names.
|
|
128
|
+
For example, GOOGLE + NEWS = google_news
|
|
79
129
|
"""
|
|
80
130
|
|
|
81
131
|
SEARCH = "search"
|
|
82
|
-
|
|
132
|
+
AI_MODE = "ai_mode"
|
|
133
|
+
WEB = "web"
|
|
83
134
|
SHOPPING = "shopping"
|
|
135
|
+
LOCAL = "local"
|
|
136
|
+
VIDEOS = "videos"
|
|
84
137
|
NEWS = "news"
|
|
138
|
+
FLIGHTS = "flights"
|
|
85
139
|
IMAGES = "images"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
140
|
+
LENS = "lens"
|
|
141
|
+
TRENDS = "trends"
|
|
142
|
+
HOTELS = "hotels"
|
|
143
|
+
PLAY = "play"
|
|
89
144
|
JOBS = "jobs"
|
|
90
|
-
|
|
145
|
+
SCHOLAR = "scholar"
|
|
146
|
+
MAPS = "maps"
|
|
91
147
|
FINANCE = "finance"
|
|
148
|
+
PATENTS = "patents"
|
|
92
149
|
|
|
93
150
|
|
|
94
151
|
class BingSearchType(str, Enum):
|
|
@@ -101,6 +158,20 @@ class BingSearchType(str, Enum):
|
|
|
101
158
|
VIDEOS = "videos"
|
|
102
159
|
NEWS = "news"
|
|
103
160
|
MAPS = "maps"
|
|
161
|
+
SHOPPING = "shopping"
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class GoogleTbm(str, Enum):
|
|
165
|
+
"""
|
|
166
|
+
Google tbm (to be matched) parameter values.
|
|
167
|
+
|
|
168
|
+
Only available when using specific Google engines that support tbm.
|
|
169
|
+
"""
|
|
170
|
+
|
|
171
|
+
NEWS = "nws"
|
|
172
|
+
SHOPPING = "shop"
|
|
173
|
+
IMAGES = "isch"
|
|
174
|
+
VIDEOS = "vid"
|
|
104
175
|
|
|
105
176
|
|
|
106
177
|
class Device(str, Enum):
|
|
@@ -159,13 +230,12 @@ class SessionType(str, Enum):
|
|
|
159
230
|
class OutputFormat(str, Enum):
|
|
160
231
|
"""
|
|
161
232
|
Output formats for Universal Scraping API.
|
|
233
|
+
|
|
234
|
+
Currently supported: html, png
|
|
162
235
|
"""
|
|
163
236
|
|
|
164
237
|
HTML = "html"
|
|
165
238
|
PNG = "png"
|
|
166
|
-
PDF = "pdf"
|
|
167
|
-
MARKDOWN = "markdown"
|
|
168
|
-
TEXT = "text"
|
|
169
239
|
|
|
170
240
|
|
|
171
241
|
class DataFormat(str, Enum):
|
|
@@ -222,7 +292,7 @@ class TaskStatus(str, Enum):
|
|
|
222
292
|
|
|
223
293
|
|
|
224
294
|
# =============================================================================
|
|
225
|
-
# Country Enum (
|
|
295
|
+
# Country Enum (Common Countries)
|
|
226
296
|
# =============================================================================
|
|
227
297
|
|
|
228
298
|
|
|
@@ -306,7 +376,6 @@ def normalize_enum_value(value: object, enum_class: type) -> str:
|
|
|
306
376
|
Safely convert an enum or string to its string value.
|
|
307
377
|
"""
|
|
308
378
|
if isinstance(value, enum_class):
|
|
309
|
-
# value is an enum member, get its .value
|
|
310
379
|
return str(getattr(value, "value", value)).lower()
|
|
311
380
|
if isinstance(value, str):
|
|
312
381
|
return value.lower()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|