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.
Files changed (32) hide show
  1. {thordata_sdk-1.0.0/src/thordata_sdk.egg-info → thordata_sdk-1.0.1}/PKG-INFO +1 -1
  2. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/pyproject.toml +1 -1
  3. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/__init__.py +1 -1
  4. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/_utils.py +16 -13
  5. thordata_sdk-1.0.1/src/thordata/client.py +980 -0
  6. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1/src/thordata_sdk.egg-info}/PKG-INFO +1 -1
  7. thordata_sdk-1.0.0/src/thordata/client.py +0 -2012
  8. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/LICENSE +0 -0
  9. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/README.md +0 -0
  10. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/setup.cfg +0 -0
  11. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/_example_utils.py +0 -0
  12. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/async_client.py +0 -0
  13. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/demo.py +0 -0
  14. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/enums.py +0 -0
  15. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/exceptions.py +0 -0
  16. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/models.py +0 -0
  17. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata/retry.py +0 -0
  18. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/SOURCES.txt +0 -0
  19. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/dependency_links.txt +0 -0
  20. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/requires.txt +0 -0
  21. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/src/thordata_sdk.egg-info/top_level.txt +0 -0
  22. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_async_client.py +0 -0
  23. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_async_client_errors.py +0 -0
  24. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_client.py +0 -0
  25. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_client_errors.py +0 -0
  26. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_enums.py +0 -0
  27. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_examples.py +0 -0
  28. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_exceptions.py +0 -0
  29. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_models.py +0 -0
  30. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_spec_parity.py +0 -0
  31. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_task_status_and_wait.py +0 -0
  32. {thordata_sdk-1.0.0 → thordata_sdk-1.0.1}/tests/test_user_agent.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thordata-sdk
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network.
5
5
  Author-email: Thordata Developer Team <support@thordata.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "thordata-sdk"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  description = "The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -35,7 +35,7 @@ Async Usage:
35
35
  >>> asyncio.run(main())
36
36
  """
37
37
 
38
- __version__ = "1.0.0"
38
+ __version__ = "1.0.1"
39
39
  __author__ = "Thordata Developer Team"
40
40
  __email__ = "support@thordata.com"
41
41
 
@@ -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 default User-Agent for the SDK.
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
- import platform
184
-
185
- py = platform.python_version()
186
- system = platform.system()
187
- return f"thordata-python-sdk/{sdk_version} (python {py}; {system}; {http_client})"
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
+ )