{"id":20320084,"url":"https://github.com/jedore/openctp-ctp-channels","last_synced_at":"2025-06-23T16:03:12.900Z","repository":{"id":237661817,"uuid":"794988145","full_name":"Jedore/openctp-ctp-channels","owner":"Jedore","description":"openctp-ctp 切换多通道柜台利器","archived":false,"fork":false,"pushed_at":"2024-10-26T12:18:09.000Z","size":6115,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T06:09:19.707Z","etag":null,"topics":["ctp","ctpapi","openctp","python","python3"],"latest_commit_sha":null,"homepage":"https://jedore.top","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jedore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-02T11:10:36.000Z","updated_at":"2025-06-14T06:02:53.000Z","dependencies_parsed_at":"2025-04-11T18:22:27.496Z","dependency_job_id":null,"html_url":"https://github.com/Jedore/openctp-ctp-channels","commit_stats":null,"previous_names":["jedore/openctp-ctp.tools","jedore/openctp-ctp.channels","jedore/openctp-ctp-channels"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Jedore/openctp-ctp-channels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jedore%2Fopenctp-ctp-channels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jedore%2Fopenctp-ctp-channels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jedore%2Fopenctp-ctp-channels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jedore%2Fopenctp-ctp-channels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jedore","download_url":"https://codeload.github.com/Jedore/openctp-ctp-channels/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jedore%2Fopenctp-ctp-channels/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259930123,"owners_count":22933540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ctp","ctpapi","openctp","python","python3"],"created_at":"2024-11-14T18:48:58.803Z","updated_at":"2025-06-23T16:03:12.823Z","avatar_url":"https://github.com/Jedore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eopenctp-ctp-channels \u003c/h1\u003e\n\n\u003cdiv\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"https://flat.badgen.net/badge/os/windows-x86/cyan?icon=windows\" /\u003e\u003c/a\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"https://flat.badgen.net/badge/os/windows-x86_64/cyan?icon=windows\" /\u003e\u003c/a\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-linux_x86_64-white?style=flat-square\u0026logo=linux\u0026logoColor=white\u0026color=rgb(35%2C189%2C204)\" /\u003e\u003c/a\u003e\n    \u003ca href=\"#\"\u003e\u003cimg src=\"https://flat.badgen.net/badge/python/\u003e=3.7/blue\" /\u003e\u003c/a\u003e\n    \u003ca href=\"#\" \u003e\u003cimg src=\"https://flat.badgen.net/badge/license/BSD-3/blue?\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/openctp-ctp-channels/\" \u003e\n      \u003cimg src=\"https://flat.badgen.net/badge/pypi/v0.1.7/blue?\" /\u003e\n    \u003c/a\u003e\n\n\u003c/div\u003e\n\u003cbr\u003e\n\n[openctp](https://github.com/openctp/openctp)\n提供了兼容各大柜台的统一 CTPAPI 兼容接口库，[openctp-ctp](https://github.com/openctp/openctp-ctp-python) 也继承了这个能力。\n\n**openctp-ctp-channels** 简化了替换兼容接口库的过程，可以快速上手体验，连接不同的柜台环境。\n\n## 快速使用\n\n- 安装\n\n  ```shell\n  pip install openctp-ctp-channels -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host=pypi.tuna.tsinghua.edu.cn\n  ```\n- 展示所有通道\n  ```shell\n  $ openctp-channels show\n  Support channels:\n        ctp - 上期技术CTP柜台\n        tts - openctp TTS柜台 7x24环境\n        tts-s - openctp TTS柜台 仿真环境(接实盘行情)\n        emt - 东方财富EMT柜台\n        xtp - 中泰证券XTP柜台\n        tora - 华鑫证券奇点股票柜台\n        qq - 腾讯财经(只有行情)\n        sina - 新浪财经(只有行情)\n  ```\n- 展示当前通道\n  ```shell\n  $ openctp-channels check\n  Current channel: ctp\n  ```\n- 切换通道\n  ```shell\n  $ openctp-channels switch tts\n  Switch to tts channel.\n  \n  $ openctp-channels check\n  Current channel: tts\n  ```\n  切换通道 **tts** 成功后，即可使用 openctp-ctp\n  库连接 [TTS 7x24环境](http://openctp.cn/report/openctp%A3%A8TTS%A3%A97x24%BB%B7%BE%B3process%BD%BB%D2%D7.html)\n\n**更多示例参见 [ctp.examples](https://github.com/Jedore/ctp.examples)**\n\n## 支持通道\n\n- [x] openctp TTS(tts/tts-s)\n\n  [详情跳转1](https://github.com/openctp/openctp?tab=readme-ov-file#openctp%E6%A8%A1%E6%8B%9F%E7%8E%AF%E5%A2%83)\n  [详情跳转2](https://github.com/openctp/openctp/tree/master/ctp2TTS)\n\n  TTS仿真环境没有提供行情服务，需要连接实盘行情(连接实盘行情不需要替换dll/so), 因此多了一个 `tts-s` 通道\n\n  `tts` 通道用于连接 TTS 7x24 环境； `tts-s` 通道用于连接 TTS 仿真环境\n\n  | version | win x86            | win x64            | linux x64          | \n  |---------|--------------------|--------------------|--------------------|\n  | 6.3.15  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.3.19  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.5.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.9   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.0   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.2   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n- [x] 华鑫证券奇点股票(tora)\n\n  [详情跳转](https://github.com/openctp/openctp/tree/master/ctp2STP)\n\n  | version | win x86            | win x64            | linux x64          | \n  |---------|--------------------|--------------------|--------------------|\n  | 6.3.15  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.3.19  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.5.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.9   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n- [x] 东方财富EMT(emt)\n\n  [详情跳转](https://github.com/openctp/openctp/tree/master/ctp2EMT)\n\n  | version | win x64            | linux x64 | \n  |---------|--------------------|-----------|\n  | 6.3.15  | :heavy_check_mark: | :x:       |\n  | 6.3.19  | :heavy_check_mark: | :x:       |\n  | 6.5.1   | :heavy_check_mark: | :x:       |\n  | 6.6.1   | :heavy_check_mark: | :x:       |\n  | 6.6.7   | :heavy_check_mark: | :x:       |\n\n- [x] 中泰证券XTP(xtp)\n\n  [详情跳转](https://github.com/openctp/openctp/tree/master/ctp2XTP)\n\n  | version | win x86 | win x64            | linux x64 | \n  |---------|---------|--------------------|-----------|\n  | 6.6.1   | :x:     | :heavy_check_mark: | :x:       |\n\n- [x] 新浪财经(sina)  \n  只能查询行情，不可以交易，[详情跳转](https://github.com/openctp/openctp/blob/master/ctp2Sina/readme.md) [构建仓库](https://github.com/Jedore/ctp2sina)\n\n  | version | win x86            | win x64            | linux x64          | \n  |---------|--------------------|--------------------|--------------------|\n  | 6.3.15  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.3.19  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.5.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.9   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.0   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.2   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n- [x] 腾讯财经(qq)  \n  只能查询行情，不可以交易，[详情跳转](https://github.com/openctp/openctp/blob/master/ctp2QQ/readme.md) [构建仓库](https://github.com/Jedore/ctp2qq)\n\n  | version | win x86            | win x64            | linux x64          | \n  |---------|--------------------|--------------------|--------------------|\n  | 6.3.15  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.3.19  | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.5.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.6.9   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.0   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.1   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.2   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n  | 6.7.7   | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n\n- [ ] 易盛\n- [ ] 易达\n- [ ] 量投QDP\n\n## 代码示例\n\ntodo...\n\n## 注意\n\n- openctp-ctp 在被使用中时，无法切换通道\n- 如果开启了网络代理，切换通道可能失败，关闭代理重试\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedore%2Fopenctp-ctp-channels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjedore%2Fopenctp-ctp-channels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjedore%2Fopenctp-ctp-channels/lists"}