mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 19:14:19 +08:00
feat: 完善实时行情字段并增加大文件拉取功能
1. 行情增强:解析 SecurityQuote 中的 limit_up (涨停价) 和 limit_down (跌停价)。 2. 新增命令:实现 GetReportFileCmd (0x06B9),支持从服务器拉取 base_info.zip 等大文件。 3. 客户端 API:TdxClient/AsyncTdxClient 增加 get_report_file 方法,支持自动分片。 4. 验证脚本:增加 verify_limits.py 和 verify_report_file.py 实测脚本。 5. 文档更新:README.md 同步 API 变更及数据模型更新。
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""测试 get_report_file 拉取板块文件。"""
|
||||
import sys
|
||||
import pathlib
|
||||
|
||||
# 添加 src 到 path
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent / "src"))
|
||||
|
||||
from xmtdx import TdxClient
|
||||
|
||||
def main():
|
||||
print("正在拉取 block_gn.dat (使用 get_report_file) ...")
|
||||
with TdxClient.from_best_host() as c:
|
||||
data = c.get_report_file("block_gn.dat")
|
||||
print(f"成功拉取 {len(data)} 字节。")
|
||||
if data:
|
||||
print(f"前 16 字节 hex: {data[:16].hex()}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user