quantdb-sdk 0.1.0__tar.gz → 0.1.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantdb-sdk
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: QuantDB 量化数据平台官方 Python SDK
5
5
  Author: QuantDB Team
6
6
  License: MIT
@@ -25,6 +25,7 @@ Requires-Dist: requests>=2.25.0
25
25
  Requires-Dist: pandas>=1.3.0
26
26
  Requires-Dist: httpx>=0.24.0
27
27
  Requires-Dist: duckdb>=0.8.0
28
+ Requires-Dist: pyarrow>=10.0.0
28
29
  Provides-Extra: dev
29
30
  Requires-Dist: pytest>=7.0.0; extra == "dev"
30
31
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
@@ -1,60 +1,60 @@
1
- # QuantDB Python SDK
2
-
3
- QuantDB 量化数据平台官方 Python SDK,提供同步与异步两种客户端,封装了全部 API 端点。
4
-
5
- ## 安装
6
-
7
- ```bash
8
- pip install quantdb-sdk
9
- ```
10
-
11
- 开发依赖:
12
-
13
- ```bash
14
- pip install -e ".[dev]"
15
- ```
16
-
17
- ## 快速开始
18
-
19
- ### API Key 鉴权(推荐)
20
-
21
- ```python
22
- from quantdb_sdk import QuantDBClient
23
-
24
- client = QuantDBClient(api_key="qdb_xxx...")
25
-
26
- # 查询用量
27
- usage = client.get_usage()
28
- print(f"已用: {usage['used_gb']:.2f} GB, 剩余: {usage['remaining_gb']:.2f} GB")
29
-
30
- # K 线查询(免费)
31
- df = client.query_kline(
32
- "600519.SH",
33
- adj_type="forward",
34
- start_date="2026-01-01",
35
- end_date="2026-07-22",
36
- )
37
- print(df.head())
38
- ```
39
-
40
- ### 用户名密码鉴权
41
-
42
- ```python
43
- client = QuantDBClient(username="admin", password="admin123")
44
- ```
45
-
46
- ## 核心功能
47
-
48
- - **数据查询**:K 线、Tick 通过下载 Parquet 切片后客户端解析(消耗流量);股票列表、交易日历、元数据走网关 JSON(不计流量)。
49
- - **数据下载**:Parquet 文件下载或直读 DataFrame,计入订阅流量。
50
- - **本地分析**:基于 DuckDB 对本地 Parquet 执行 SQL。
51
- - **账户管理**:查询用户信息、用量、API Key、订阅与订单。
52
- - **异步客户端**:基于 httpx,适用于 asyncio 量化框架。
53
-
54
- ## 流量说明
55
-
56
- 每月前 30 GB 下载流量免费,超出部分按 ¥1/GB 计费;账户余额不足时,下载会被限流,充值后即可恢复。
57
-
58
- ## 文档
59
-
60
- 完整文档请访问:https://www.quantmindai.cn/docs/sdk.html
1
+ # QuantDB Python SDK
2
+
3
+ QuantDB 量化数据平台官方 Python SDK,提供同步与异步两种客户端,封装了全部 API 端点。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pip install quantdb-sdk
9
+ ```
10
+
11
+ 开发依赖:
12
+
13
+ ```bash
14
+ pip install -e ".[dev]"
15
+ ```
16
+
17
+ ## 快速开始
18
+
19
+ ### API Key 鉴权(推荐)
20
+
21
+ ```python
22
+ from quantdb_sdk import QuantDBClient
23
+
24
+ client = QuantDBClient(api_key="qdb_xxx...")
25
+
26
+ # 查询用量
27
+ usage = client.get_usage()
28
+ print(f"已用: {usage['used_gb']:.2f} GB, 剩余: {usage['remaining_gb']:.2f} GB")
29
+
30
+ # K 线查询(免费)
31
+ df = client.query_kline(
32
+ "600519.SH",
33
+ adj_type="forward",
34
+ start_date="2026-01-01",
35
+ end_date="2026-07-22",
36
+ )
37
+ print(df.head())
38
+ ```
39
+
40
+ ### 用户名密码鉴权
41
+
42
+ ```python
43
+ client = QuantDBClient(username="admin", password="admin123")
44
+ ```
45
+
46
+ ## 核心功能
47
+
48
+ - **数据查询**:K 线、Tick 通过下载 Parquet 切片后客户端解析(消耗流量);股票列表、交易日历、元数据走网关 JSON(不计流量)。
49
+ - **数据下载**:Parquet 文件下载或直读 DataFrame,计入订阅流量。
50
+ - **本地分析**:基于 DuckDB 对本地 Parquet 执行 SQL。
51
+ - **账户管理**:查询用户信息、用量、API Key、订阅与订单。
52
+ - **异步客户端**:基于 httpx,适用于 asyncio 量化框架。
53
+
54
+ ## 流量说明
55
+
56
+ 每月前 30 GB 下载流量免费,超出部分按 ¥1/GB 计费;账户余额不足时,下载会被限流,充值后即可恢复。
57
+
58
+ ## 文档
59
+
60
+ 完整文档请访问:https://www.quantmindai.cn/docs/sdk.html
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "quantdb-sdk"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "QuantDB 量化数据平台官方 Python SDK"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -31,6 +31,10 @@ dependencies = [
31
31
  "pandas>=1.3.0",
32
32
  "httpx>=0.24.0",
33
33
  "duckdb>=0.8.0",
34
+ # 0.1.1 修复:pyarrow 是 pd.read_parquet 的硬依赖(client.py:482, async_client.py:413),
35
+ # 但 0.1.0 漏声明,导致 pip install 后首次 K线/Tick 查询会抛 ImportError。
36
+ # 锁定到 >=10.0.0 以获得 Python 3.10+ 完整支持(pyarrow 14+ 更好)。
37
+ "pyarrow>=10.0.0",
34
38
  ]
35
39
 
36
40
  [project.optional-dependencies]
@@ -51,7 +51,9 @@ class QuantDBClient:
51
51
  raise ValueError("必须提供 api_key 或 username+password")
52
52
 
53
53
  self.session = requests.Session()
54
- self.session.headers.update({"User-Agent": "QuantDB-Python-SDK/0.1.0"})
54
+ # User-Agent 中的版本与 pyproject.toml 同步,用于服务端日志归因
55
+ # 维护提示:每次版本号变化必须同步改这里(init 里的 __version__ 走 metadata 自动同步)
56
+ self.session.headers.update({"User-Agent": "QuantDB-Python-SDK/0.1.1"})
55
57
  if self.headers:
56
58
  self.session.headers.update(self.headers)
57
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantdb-sdk
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: QuantDB 量化数据平台官方 Python SDK
5
5
  Author: QuantDB Team
6
6
  License: MIT
@@ -25,6 +25,7 @@ Requires-Dist: requests>=2.25.0
25
25
  Requires-Dist: pandas>=1.3.0
26
26
  Requires-Dist: httpx>=0.24.0
27
27
  Requires-Dist: duckdb>=0.8.0
28
+ Requires-Dist: pyarrow>=10.0.0
28
29
  Provides-Extra: dev
29
30
  Requires-Dist: pytest>=7.0.0; extra == "dev"
30
31
  Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
@@ -2,6 +2,7 @@ requests>=2.25.0
2
2
  pandas>=1.3.0
3
3
  httpx>=0.24.0
4
4
  duckdb>=0.8.0
5
+ pyarrow>=10.0.0
5
6
 
6
7
  [dev]
7
8
  pytest>=7.0.0
File without changes
File without changes