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()可恢复原版
Metadata
Release files for tqwebhelper2 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tqwebhelper2-0.1.4.tar.gz | 89.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tqwebhelper2-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.4 kB
Release files / tqwebhelper2-0.1.4.tar.gz
| Download URL | tqwebhelper2-0.1.4.tar.gz |
|---|---|
| Size | 89.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f85c5a9edbd96d3ba660e40caf05e729518bcfb0af724f860560a9b866b69740
|
|
BLAKE2b-256 checksum How to use checksums |
20d64ad1428d47f474a38002507814d6dcb8af3ebc7b38f1d1704b57099c062b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.11
|
Release files / tqwebhelper2-0.1.4-py3-none-any.whl
| Download URL | tqwebhelper2-0.1.4-py3-none-any.whl |
|---|---|
| Size | 89.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e6ff6110d2597f8b9ff14e8c71153e36d3c26ebc7f4c2007488aba9f1c9ab36
|
|
BLAKE2b-256 checksum How to use checksums |
597e6e401cbb6b7a9675074ef7a79e3f8496645238afb4dbf89652a7619792ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.11
|