天勤量化 Web UI 增强版 — 替换 tqsdk 默认 Web 界面,无需修改官方 SDK
Project description
tqwebhelper2
天勤量化 Web UI 增强版。通过 monkey-patch 替换 tqsdk 默认的 Web 界面,无需修改官方 SDK。
Preview
实盘
回测
安装
pip install tqwebhelper2
使用
import tqwebhelper2
tqwebhelper2.patch() # 必须在 TqApi 之前调用
from tqsdk import TqApi, TqAuth
api = TqApi(auth=TqAuth("user", "pass"), web_gui=True)
浏览器打开控制台输出的地址即可看到新版 Web 界面。
原理
- 继承原版
TqWebHelper,只替换_web_dir指向本包内的编译产物 - 通过
patch()同时替换tqsdk.tqwebhelper和tqsdk.api中的引用 - WebSocket 数据通道、路由逻辑完全复用原版,零侵入
unpatch()可恢复原版
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tqwebhelper2-0.1.3.tar.gz
(89.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tqwebhelper2-0.1.3.tar.gz.
File metadata
- Download URL: tqwebhelper2-0.1.3.tar.gz
- Upload date:
- Size: 89.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
554ccc5a1f73d433943c8ecd86ad20d9db07e368e834d8e4063a7ac40237c58c
|
|
| MD5 |
0aadf7bdd2645cb6e72639be130bdafd
|
|
| BLAKE2b-256 |
4f6de5c5096d5f6f1e77fa012e2ebab7e272cb065e930661536f3e6baec9abce
|
File details
Details for the file tqwebhelper2-0.1.3-py3-none-any.whl.
File metadata
- Download URL: tqwebhelper2-0.1.3-py3-none-any.whl
- Upload date:
- Size: 89.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
795b775e1f5f3a79ce500bb576f7f13be08aa1180e1787e20c3e9629bab1a7c6
|
|
| MD5 |
b0f33ca0de70b889ff651e4673a1ed36
|
|
| BLAKE2b-256 |
0a5d6e4dc5d722d7ad39e33de4a8ae22500724c14bb45a1e76b3b231f581cca8
|