Optimized Trading API for China Future - Based on ctpbee_api with GIL optimization
Project description
ctpbee_opt_api
基于 ctpbee_api 的优化版本,感谢原作者 somewheve 的贡献。
优化内容
合约查询批量模式 (Instrument Batch Mode)
解决全量查询合约时 GIL 争抢导致 UI 界面卡顿的问题。
- 问题背景: 查询全量合约时,CTP 回调会逐条触发 Python 回调,每次都需要获取 GIL,导致界面卡死。
- 解决方案: 新增批量模式,在 C++ 层缓存所有合约数据,仅在最后一条数据到达时一次性回调 Python。
新增 API
- setInstrumentBatchMode(enable): 设置合约查询批量模式
- getInstrumentBatchMode(): 获取当前批量模式状态
- onRspQryInstrumentBatch(instruments): 批量模式下的合约查询回调
安装
pip install ctpbee_opt_api
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
Built Distributions
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 ctpbee_opt_api-0.1.2.tar.gz.
File metadata
- Download URL: ctpbee_opt_api-0.1.2.tar.gz
- Upload date:
- Size: 36.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f3d58851d8815964b34a0ff3f5bf056feec158d5b3541e6be3a49f3fd4be310
|
|
| MD5 |
dd5f6b4ed8142622ddbf4e9c70dc9ca9
|
|
| BLAKE2b-256 |
15e46327fcfe3efca7157e06b14fdd37abfbfc6b31d1bfd4f0bb571b8abcc076
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2.tar.gz:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2.tar.gz -
Subject digest:
2f3d58851d8815964b34a0ff3f5bf056feec158d5b3541e6be3a49f3fd4be310 - Sigstore transparency entry: 910926003
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 37.9 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98a0d7ca9b1186c0600e1e8836276527d904503d10b1809639b2c188667232f3
|
|
| MD5 |
fc03ee5491ae7255e485a34491a4a10d
|
|
| BLAKE2b-256 |
d50e1f7602605207cf7ab95b745e706475fb14697a77ccb3743f466337a4335d
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp313-cp313-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp313-cp313-win_amd64.whl -
Subject digest:
98a0d7ca9b1186c0600e1e8836276527d904503d10b1809639b2c188667232f3 - Sigstore transparency entry: 910926088
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 37.9 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11702bf2da4af8ba77c6c12cfed9fb938f60cac962ef681c06d6eedd4938c1c1
|
|
| MD5 |
eb8cf19150594ee361fdc0e36d771f84
|
|
| BLAKE2b-256 |
f12b544b52e116c05b7060e78d38154e87665690d26c4c6260438f3b0604df76
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp312-cp312-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp312-cp312-win_amd64.whl -
Subject digest:
11702bf2da4af8ba77c6c12cfed9fb938f60cac962ef681c06d6eedd4938c1c1 - Sigstore transparency entry: 910926150
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 37.9 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc72c34d58f8f585b03e245e1b7502c6e839f3814349edb66a642531b4f36a4e
|
|
| MD5 |
c9cf3edba03ab7a63e6eaaae9b26cf83
|
|
| BLAKE2b-256 |
ff2d66e08b6d6b73dbb19ad24cff005b83721234f00eafa945f0906167496b7b
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp311-cp311-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp311-cp311-win_amd64.whl -
Subject digest:
cc72c34d58f8f585b03e245e1b7502c6e839f3814349edb66a642531b4f36a4e - Sigstore transparency entry: 910926036
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 37.8 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ade97d92f9dd1764a4d2ad8eb37deb373abfb5d5d0e0a47f016e3accaf31ba1
|
|
| MD5 |
425de1c9ae8e1aa5794e61553d6f6f3f
|
|
| BLAKE2b-256 |
634addc87963d22d06de34f1bb1a9e553fd7c99332cbe4dc06cbf9154ee0aee2
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp310-cp310-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp310-cp310-win_amd64.whl -
Subject digest:
6ade97d92f9dd1764a4d2ad8eb37deb373abfb5d5d0e0a47f016e3accaf31ba1 - Sigstore transparency entry: 910926057
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 37.8 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffee75073f79d8b2e1b2979fef6a752b5879576ac8b35ba59c01818b380ae6f0
|
|
| MD5 |
e7089e481375dbc196a93004c71db88b
|
|
| BLAKE2b-256 |
ac6a90c2350d4935532f7188c1a1f4f8242257b39bad9b3e5cd7ba92c3b2c130
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp39-cp39-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp39-cp39-win_amd64.whl -
Subject digest:
ffee75073f79d8b2e1b2979fef6a752b5879576ac8b35ba59c01818b380ae6f0 - Sigstore transparency entry: 910926105
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ctpbee_opt_api-0.1.2-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: ctpbee_opt_api-0.1.2-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 37.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8817cfe015a6d745e6713be9128fa9ab8e8542af944de52e26af8b65a14436e
|
|
| MD5 |
fba8a57d3967e5f51c826b6e2e2cb22e
|
|
| BLAKE2b-256 |
14982c8a7e001199ec25f95c29c8dccf18b71af370e83dd616d37daf6cfddcf5
|
Provenance
The following attestation bundles were made for ctpbee_opt_api-0.1.2-cp38-cp38-win_amd64.whl:
Publisher:
python-publish.yml on fangdejia/ctpbee_api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ctpbee_opt_api-0.1.2-cp38-cp38-win_amd64.whl -
Subject digest:
e8817cfe015a6d745e6713be9128fa9ab8e8542af944de52e26af8b65a14436e - Sigstore transparency entry: 910926126
- Sigstore integration time:
-
Permalink:
fangdejia/ctpbee_api@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/fangdejia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c4b04414fa0902a53fbc132070dd56191aafcda5 -
Trigger Event:
push
-
Statement type: