thordata-sdk 1.0.0__tar.gz → 1.0.1__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-1.0.0/src/thordata_sdk.egg-info → thordata_sdk-1.0.1}/PKG-INFO +1 -1
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/pyproject.toml +1 -1
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/__init__.py +1 -1
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/_utils.py +16 -13
- thordata_sdk-1.0.1/src/thordata/client.py +980 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1/src/thordata_sdk.egg-info}/PKG-INFO +1 -1
- thordata_sdk-1.0.0/src/thordata/client.py +0 -2012
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/LICENSE +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/README.md +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/setup.cfg +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/_example_utils.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/async_client.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/demo.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/enums.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/exceptions.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/models.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/retry.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/SOURCES.txt +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/dependency_links.txt +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/requires.txt +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/top_level.txt +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_async_client.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_async_client_errors.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_client.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_client_errors.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_enums.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_examples.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_exceptions.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_models.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_spec_parity.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_task_status_and_wait.py +0 -0
- {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_user_agent.py +0 -0
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
import base64
|
|
10
10
|
import json
|
|
11
11
|
import logging
|
|
12
|
+
import platform
|
|
12
13
|
from typing import Any, Dict
|
|
13
14
|
|
|
14
15
|
logger = logging.getLogger(__name__)
|
|
@@ -171,17 +172,19 @@ def extract_error_message(payload: Any) -> str:
|
|
|
171
172
|
|
|
172
173
|
def build_user_agent(sdk_version: str, http_client: str) -> str:
|
|
173
174
|
"""
|
|
174
|
-
Build a
|
|
175
|
-
|
|
176
|
-
Args:
|
|
177
|
-
sdk_version: SDK version string.
|
|
178
|
-
http_client: "requests" or "aiohttp" (or any identifier).
|
|
179
|
-
|
|
180
|
-
Returns:
|
|
181
|
-
A User-Agent string.
|
|
175
|
+
Build a standardized User-Agent for the SDK.
|
|
176
|
+
Format: thordata-python-sdk/{version} python/{py_ver} ({system}/{release}; {machine})
|
|
182
177
|
"""
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
178
|
+
py_ver = platform.python_version()
|
|
179
|
+
system = platform.system() or "unknown"
|
|
180
|
+
release = platform.release() or "unknown"
|
|
181
|
+
machine = platform.machine() or "unknown"
|
|
182
|
+
|
|
183
|
+
# Clean up strings to avoid UA parsing issues (remove newlines, etc)
|
|
184
|
+
system = system.replace(";", "").strip()
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
f"thordata-python-sdk/{sdk_version} "
|
|
188
|
+
f"python/{py_ver} "
|
|
189
|
+
f"({system}/{release}; {machine}; {http_client})"
|
|
190
|
+
)
|