quantdb-sdk 0.1.1__tar.gz → 0.1.3__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 (25) hide show
  1. quantdb_sdk-0.1.3/CHANGELOG.md +40 -0
  2. quantdb_sdk-0.1.3/LICENSE +21 -0
  3. quantdb_sdk-0.1.3/MANIFEST.in +5 -0
  4. {quantdb_sdk-0.1.1/quantdb_sdk.egg-info → quantdb_sdk-0.1.3}/PKG-INFO +4 -1
  5. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/pyproject.toml +13 -1
  6. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/async_client.py +1 -1
  7. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/client.py +612 -612
  8. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3/quantdb_sdk.egg-info}/PKG-INFO +4 -1
  9. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk.egg-info/SOURCES.txt +7 -2
  10. quantdb_sdk-0.1.3/quantdb_sdk.egg-info/entry_points.txt +2 -0
  11. quantdb_sdk-0.1.3/tests/test_async_client.py +134 -0
  12. quantdb_sdk-0.1.3/tests/test_client.py +152 -0
  13. quantdb_sdk-0.1.3/tests/test_technical_indicators.py +237 -0
  14. quantdb_sdk-0.1.1/MANIFEST.in +0 -22
  15. quantdb_sdk-0.1.1/requirements.txt +0 -4
  16. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/README.md +0 -0
  17. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/__init__.py +0 -0
  18. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/__main__.py +0 -0
  19. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/_utils.py +0 -0
  20. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/errors.py +0 -0
  21. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk/py.typed +0 -0
  22. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk.egg-info/dependency_links.txt +0 -0
  23. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk.egg-info/requires.txt +0 -0
  24. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/quantdb_sdk.egg-info/top_level.txt +0 -0
  25. {quantdb_sdk-0.1.1 → quantdb_sdk-0.1.3}/setup.cfg +0 -0
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ 所有 notable 变更都会记录在此文件。格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
4
+ 版本号遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)。
5
+
6
+ ## [0.1.3] - 2026-07-25
7
+
8
+ ### Changed
9
+ - **User-Agent 统一规范**:同步同步客户端 (`client.py`) 与异步客户端 (`async_client.py`) 的 `User-Agent` 标头为 `QuantDB-Python-SDK/0.1.3`,提升服务端请求追踪与日志分流精度。
10
+ - **服务端 Redis 集中式缓存兼容**:完全兼容服务端网关新上线的 Redis 集中缓存层(自动接收 `X-Cache-Hit` 响应标头)。
11
+
12
+ ## [0.1.2] - 2026-07-25
13
+
14
+ ### Added
15
+ - **CLI 入口**:`[project.scripts]` 注册 `quantdb` 命令,装包后可直接 `quantdb --help` / `quantdb check <key>`,等价于 `python -m quantdb_sdk`。修复了 0.1.0/0.1.1 README 中 `python -m quantdb`(用连字符)会报 `No module named quantdb` 的问题。
16
+ - `CHANGELOG.md` 与 `LICENSE`(MIT)文本随仓库发布。
17
+ - `pyproject.toml` 新增 `Changelog` 项目 URL。
18
+
19
+ ### Notes
20
+ - 0.1.2 严格向后兼容 0.1.1,仅元数据层面的修补,不改任何运行时行为。
21
+ - 若 0.1.1 已经在生产环境运行,可选升级;不升级也不受影响。
22
+
23
+ ## [0.1.1] - 2026-07-25
24
+
25
+ ### Fixed
26
+ - **关键 packaging bug**:`pyarrow` 未声明在 `pyproject.toml` 的运行时依赖,但 `client.py:482` 与 `async_client.py:413` 调用了 `pd.read_parquet(io.BytesIO(...))`。
27
+ - **影响**:任何 `pip install quantdb-sdk==0.1.0` 的用户,在首次调用 `query_kline` / `query_tick` / `query_financial` 等下载类接口时会抛 `ImportError: Missing optional dependency 'pyarrow'`。只有 `get_usage` / `query_stock_list` 等非 parquet 接口 OOTB 可用。
28
+ - **修复**:在 `dependencies` 加入 `pyarrow>=10.0.0`。
29
+ - **服务端 User-Agent** 同步从 `0.1.0` 升级到 `0.1.1`,便于服务端按版本做调用归因与问题分流。
30
+
31
+ ## [0.1.0] - 2026-07-22
32
+
33
+ ### Added
34
+ - 初版发布。
35
+ - `QuantDBClient` 同步客户端(基于 `requests`)。
36
+ - `AsyncQuantDBClient` 异步客户端(基于 `httpx`)。
37
+ - `DuckDBWarehouse` 本地仓库管理:自动下载 Parquet → 注册 DuckDB 视图 → 跨表 SQL 查询。
38
+ - 异常体系:`QuantDBError` / `AuthError` / `RateLimitError` / `InsufficientTrafficError` / `NotFoundError` / `ServerError` / `ValidationError`。
39
+ - 覆盖接口:流量查询、用户信息、API Key 管理、订阅与订单、股票列表、交易日历、K 线、Tick、财务、按日分片分钟线。
40
+ - `py.typed` 标记(PEP 561),第三方库可获得完整类型信息。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QuantDB Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include pyproject.toml
5
+ recursive-include quantdb_sdk *.py *.typed
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantdb-sdk
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: QuantDB 量化数据平台官方 Python SDK
5
5
  Author: QuantDB Team
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://www.quantmindai.cn
8
8
  Project-URL: Documentation, https://www.quantmindai.cn/docs/sdk.html
9
9
  Project-URL: Repository, https://github.com/quantdb/quantdb
10
+ Project-URL: Changelog, https://github.com/quantdb/quantdb/blob/main/CHANGELOG.md
10
11
  Keywords: quant,finance,data,a-share,parquet
11
12
  Classifier: Development Status :: 3 - Alpha
12
13
  Classifier: Intended Audience :: Developers
@@ -21,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Topic :: Office/Business :: Financial
22
23
  Requires-Python: >=3.8
23
24
  Description-Content-Type: text/markdown
25
+ License-File: LICENSE
24
26
  Requires-Dist: requests>=2.25.0
25
27
  Requires-Dist: pandas>=1.3.0
26
28
  Requires-Dist: httpx>=0.24.0
@@ -31,6 +33,7 @@ Requires-Dist: pytest>=7.0.0; extra == "dev"
31
33
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
32
34
  Requires-Dist: responses>=0.23.0; extra == "dev"
33
35
  Requires-Dist: respx>=0.20.0; extra == "dev"
36
+ Dynamic: license-file
34
37
 
35
38
  # QuantDB Python SDK
36
39
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantdb-sdk"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "QuantDB 量化数据平台官方 Python SDK"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -37,6 +37,13 @@ dependencies = [
37
37
  "pyarrow>=10.0.0",
38
38
  ]
39
39
 
40
+ # 0.1.2 新增:装包后提供 `quantdb` shell 命令,等价于 `python -m quantdb_sdk`。
41
+ # 0.1.0/0.1.1 README 写的是 `python -m quantdb`(用了 PyPI 名带连字符),
42
+ # 但 Python 模块名是下划线,安装后 `python -m quantdb` 会报 No module named quantdb。
43
+ # 加这个 entry point 后两个名字都能用,README 不需要再改。
44
+ [project.scripts]
45
+ quantdb = "quantdb_sdk.__main__:main"
46
+
40
47
  [project.optional-dependencies]
41
48
  dev = [
42
49
  "pytest>=7.0.0",
@@ -49,7 +56,12 @@ dev = [
49
56
  Homepage = "https://www.quantmindai.cn"
50
57
  Documentation = "https://www.quantmindai.cn/docs/sdk.html"
51
58
  Repository = "https://github.com/quantdb/quantdb"
59
+ Changelog = "https://github.com/quantdb/quantdb/blob/main/CHANGELOG.md"
52
60
 
53
61
  [tool.setuptools.packages.find]
54
62
  where = ["."]
55
63
  include = ["quantdb_sdk*"]
64
+
65
+ # 0.1.2 新增:让 wheel 包含 LICENSE 和 CHANGELOG.md
66
+ [tool.setuptools.package-data]
67
+ quantdb_sdk = ["py.typed"]
@@ -35,7 +35,7 @@ class AsyncQuantDBClient:
35
35
  ):
36
36
  self.api_host = api_host.rstrip("/")
37
37
  self.timeout = timeout
38
- headers = {"User-Agent": "QuantDB-Python-SDK/0.1.0"}
38
+ headers = {"User-Agent": "QuantDB-Python-SDK/0.1.3"}
39
39
  if api_key:
40
40
  headers["X-API-Key"] = api_key
41
41
  elif token: