Skip to content

Commit 958a957

Browse files
committed
Merge branch 'feat_future_depth' into 'master'
Feat future depth See merge request server/openapi/openapi-python-sdk!251
2 parents 3efde7a + 191b500 commit 958a957

File tree

21 files changed

+1949
-299
lines changed

21 files changed

+1949
-299
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 3.4.5 (2025-08-22)
2+
### New
3+
- `QuoteClient.get_future_depth` 获取期货深度行情
4+
- QuoteClient 的 `get_depth_quote`, `get_trade_ticks`, `get_timeline`, `get_timeline_history`, `get_bars` 支持 `trade_session` 指定查询夜盘数据
5+
- MCP Server beta version pre-release
6+
17
## 3.4.4 (2025-07-31)
28
### New
39
选股器支持分页 cursor_id 参数

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pyasn1
77
rsa
88
stomp.py
99
getmac
10-
cryptography
10+
cryptography~=44.0.3
1111
backoff
1212
jproperties
1313
protobuf

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
long_description_content_type='text/markdown',
2222
packages=find_packages(exclude=["tests"]),
2323
author='TigerBrokers',
24-
author_email='openapi@tigerbrokers.com',
24+
author_email='openapi@itiger.com',
2525
license='Apache License v2',
2626
package_data={'': ['*.*']},
2727
url='https://github.com/tigerbrokers/openapi-python-sdk',
@@ -37,5 +37,7 @@
3737
'Programming Language :: Python :: 3.9',
3838
'Programming Language :: Python :: 3.10',
3939
'Programming Language :: Python :: 3.11',
40+
'Programming Language :: Python :: 3.12',
41+
'Programming Language :: Python :: 3.13',
4042
],
4143
)

tests/test_quote_client.py

Lines changed: 113 additions & 162 deletions
Large diffs are not rendered by default.

tests/test_trade_client.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class TestTradeClient(unittest.TestCase):
2525

2626
def setUp(self):
27-
self.is_mock = False
27+
self.is_mock = True
2828
current_dir = os.path.dirname(__file__)
2929
self.client_config = TigerOpenClientConfig(
3030
props_path=os.path.join(current_dir, ".config/prod_20150899/"))
@@ -625,16 +625,6 @@ def test_cancel_order(self):
625625
self.assertIsNotNone(mock_result_with_account)
626626
self.assertEqual(mock_result_with_account, 40132638459956224)
627627

628-
# Verify the correct parameters were passed to the API request
629-
self.assertEqual(web_utils.do_request.call_count, 3)
630-
631-
# For the following assertions, we verify that the CancelOrderParams was correctly populated
632-
# in each of the test cases by examining the payload sent to do_request
633-
last_call_args = web_utils.do_request.call_args_list[2][0][
634-
1] # Get payload from third call
635-
self.assertIn('"account":"123123"', last_call_args)
636-
self.assertIn('"id":40132638459956224', last_call_args)
637-
638628
else:
639629
result = self.client.cancel_order(id=40132638459956224)
640630
logger.debug(f"Cancel Order Result: {result}")

tigeropen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
55
@author: gaoan
66
"""
7-
__VERSION__ = '3.4.4'
7+
__VERSION__ = '3.4.5'

tigeropen/common/consts/params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@
2020
COMMON_PARAM_KEYS = {P_TIGER_ID, P_METHOD, P_CHARSET, P_SIGN_TYPE, P_SIGN, P_TIMESTAMP, P_VERSION, P_NOTIFY_URL,
2121
P_DEVICE_ID}
2222
P_BIZ_CONTENT = "biz_content"
23+
TIGER_ID = "tiger_id"
24+
ACCOUNT = "account"
25+
SECRET_KEY = "secret_key"
26+
LICENSE = "license"
27+
PRIVATE_KEY = "private_key"
28+
TOKEN = "token"
29+
ENV = "env"
30+
DATA = "data"

tigeropen/common/consts/service_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
FUTURE_REAL_TIME_QUOTE = "future_real_time_quote"
101101
FUTURE_TICK = "future_tick"
102102
FUTURE_TRADING_DATE = "future_trading_date"
103+
FUTURE_DEPTH = "future_depth"
103104

104105
# 基金行情
105106
FUND_ALL_SYMBOLS = "fund_all_symbols"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.md
2+
recursive-include tigermcp *
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Tiger MCP Server
2+
3+
Tiger MCP Server
4+
5+
## Quickstart
6+
7+
### Install
8+
```shell
9+
mkdir demo
10+
cd demo
11+
12+
# Create virtual environment and activate it
13+
python -m venv .venv
14+
source .venv/bin/activate
15+
# or windows
16+
# .venv\Scripts\activate
17+
18+
pip install tigermcp
19+
```
20+
21+
### Configure TigerOpen API credentials environment variables
22+
23+
Method 1: Specify the configuration file
24+
```bash
25+
export TIGEROPEN_PROPS_PATH="path/to/your/tiger_openapi_config.properties"
26+
```
27+
28+
Method 2: Specify tiger_id/private_key/account directly
29+
```bash
30+
export TIGEROPEN_TIGER_ID="your Tiger ID"
31+
export TIGEROPEN_PRIVATE_KEY="your private key"
32+
export TIGEROPEN_ACCOUNT="your trading account"
33+
```
34+
35+
Set `TIGERMCP_READONLY` to true if you want to run the server in read-only mode (no trading actions allowed).
36+
37+
38+
39+
### Run
40+
```shell
41+
tigermcp
42+
```
43+
44+
### Run with Cursor/Claude/Trae
45+
46+
47+
```json
48+
{
49+
"mcpServers": {
50+
"tigermcp": {
51+
"command": "/path/to/tigermcp",
52+
"env": {
53+
"TIGEROPEN_PROPS_PATH": "/path/to/your/tiger_openapi_config.properties"
54+
}
55+
}
56+
}
57+
}
58+
```
59+
60+

0 commit comments

Comments
 (0)