zerone-cli 0.1.3__tar.gz → 0.1.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/PKG-INFO +3 -3
  2. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/README.md +2 -2
  3. zerone_cli-0.1.6/cli/client.py +422 -0
  4. zerone_cli-0.1.6/cli/commands/evt_company_financing.py +48 -0
  5. zerone_cli-0.1.6/cli/commands/evt_company_ipo.py +48 -0
  6. zerone_cli-0.1.6/cli/commands/evt_company_repurchase.py +48 -0
  7. zerone_cli-0.1.6/cli/commands/evt_company_secondary.py +48 -0
  8. zerone_cli-0.1.6/cli/commands/evt_listing_company_reduction.py +48 -0
  9. zerone_cli-0.1.6/cli/commands/evt_listing_company_unlock.py +48 -0
  10. zerone_cli-0.1.6/cli/commands/evt_lp_investment.py +46 -0
  11. zerone_cli-0.1.6/cli/commands/evt_ma_company_deal.py +48 -0
  12. zerone_cli-0.1.6/cli/commands/evt_s_fund_deal.py +46 -0
  13. zerone_cli-0.1.6/cli/commands/model_company_match_gp.py +36 -0
  14. zerone_cli-0.1.6/cli/main.py +49 -0
  15. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/pyproject.toml +2 -2
  16. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/PKG-INFO +3 -3
  17. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/SOURCES.txt +10 -0
  18. zerone_cli-0.1.3/cli/client.py +0 -176
  19. zerone_cli-0.1.3/cli/main.py +0 -29
  20. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/__init__.py +0 -0
  21. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/__init__.py +0 -0
  22. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/basic_info.py +0 -0
  23. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/config_cmd.py +0 -0
  24. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_exit_list.py +0 -0
  25. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_financial_list.py +0 -0
  26. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_invest_list.py +0 -0
  27. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_managed_funds_list.py +0 -0
  28. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_profile.py +0 -0
  29. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/entity_search.py +0 -0
  30. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/financing.py +0 -0
  31. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/model_financing_probability.py +0 -0
  32. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/commands/shareholders.py +0 -0
  33. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/config.py +0 -0
  34. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/utils/__init__.py +0 -0
  35. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/utils/errors.py +0 -0
  36. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/cli/utils/output.py +0 -0
  37. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/setup.cfg +0 -0
  38. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/dependency_links.txt +0 -0
  39. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/entry_points.txt +0 -0
  40. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/requires.txt +0 -0
  41. {zerone_cli-0.1.3 → zerone_cli-0.1.6}/zerone_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zerone-cli
3
- Version: 0.1.3
3
+ Version: 0.1.6
4
4
  Summary: Zerone 私募股权数据 CLI 工具
5
5
  Author-email: Zerone <tech@zerone.com.cn>
6
6
  License: MIT
@@ -67,10 +67,10 @@ zerone entity-financial-list "中国石油" --page 1 --page-size 20
67
67
  zerone entity-managed-funds-list "深创投" --page 1 --page-size 20
68
68
 
69
69
  # 查询退出列表
70
- zerone entity-exit-list "深创投" --exit-type IPO --page 1 --page-size 20
70
+ zerone entity-exit-list "深创投" --exit-type FUND --page 1 --page-size 20
71
71
 
72
72
  # 查询投资列表
73
- zerone entity-invest-list "深创投" --invest-type 直接投资 --page 1 --page-size 20
73
+ zerone entity-invest-list "深创投" --invest-type COMPANY --page 1 --page-size 20
74
74
 
75
75
  # 查询融资概率预测
76
76
  zerone model-financing-probability "字节跳动" --type COMPANY
@@ -40,10 +40,10 @@ zerone entity-financial-list "中国石油" --page 1 --page-size 20
40
40
  zerone entity-managed-funds-list "深创投" --page 1 --page-size 20
41
41
 
42
42
  # 查询退出列表
43
- zerone entity-exit-list "深创投" --exit-type IPO --page 1 --page-size 20
43
+ zerone entity-exit-list "深创投" --exit-type FUND --page 1 --page-size 20
44
44
 
45
45
  # 查询投资列表
46
- zerone entity-invest-list "深创投" --invest-type 直接投资 --page 1 --page-size 20
46
+ zerone entity-invest-list "深创投" --invest-type COMPANY --page 1 --page-size 20
47
47
 
48
48
  # 查询融资概率预测
49
49
  zerone model-financing-probability "字节跳动" --type COMPANY
@@ -0,0 +1,422 @@
1
+ from typing import Optional
2
+
3
+ import httpx
4
+
5
+ from cli.config import config_manager
6
+
7
+
8
+ class MCPClient:
9
+
10
+ def __init__(self):
11
+ self.api_key = config_manager.get_api_key()
12
+ self.server_url = config_manager.get_server_url()
13
+ self.client = httpx.Client(timeout=30.0)
14
+
15
+ def _request(
16
+ self,
17
+ method: str,
18
+ path: str,
19
+ json_data: Optional[dict] = None,
20
+ params: Optional[dict] = None,
21
+ ) -> dict:
22
+ url = f"{self.server_url}{path}"
23
+ headers = {
24
+ "Authorization": f"Bearer {self.api_key}",
25
+ "Content-Type": "application/json",
26
+ }
27
+
28
+ try:
29
+ response = self.client.request(
30
+ method=method,
31
+ url=url,
32
+ headers=headers,
33
+ json=json_data,
34
+ params=params,
35
+ )
36
+ response.raise_for_status()
37
+ data = response.json()
38
+ if not data.get("success", True):
39
+ error = data.get("error", {})
40
+ raise ValueError(f"[{error.get('code', 'UNKNOWN')}] {error.get('message', '未知错误')}")
41
+ return data
42
+ except httpx.HTTPStatusError as e:
43
+ try:
44
+ error_data = e.response.json()
45
+ detail = error_data.get("detail", "")
46
+ if detail:
47
+ raise ValueError(f"[HTTP {e.response.status_code}] {detail}")
48
+ except ValueError:
49
+ raise
50
+ except Exception:
51
+ pass
52
+ raise ValueError(f"请求失败: {e.response.status_code} - {e.response.text}")
53
+ except httpx.ConnectError:
54
+ raise ValueError(f"无法连接到 MCP Server,请检查 server_url 配置:{self.server_url}")
55
+ except httpx.TimeoutException:
56
+ raise ValueError("请求超时,请检查网络连接或稍后重试")
57
+
58
+ def entity_search(self, keyword: str) -> dict:
59
+ return self._request(
60
+ "POST",
61
+ "/rest-api/tool/entity_search",
62
+ json_data={"keyword": keyword},
63
+ )
64
+
65
+ def entity_profile(
66
+ self,
67
+ entity_name: str,
68
+ entity_type: Optional[str] = None,
69
+ ) -> dict:
70
+ return self._request(
71
+ "POST",
72
+ "/rest-api/tool/entity_profile",
73
+ json_data={
74
+ "entity_name": entity_name,
75
+ "entity_type": entity_type or "",
76
+ },
77
+ )
78
+
79
+ def entity_financial_list(
80
+ self,
81
+ entity_name: str,
82
+ entity_type: Optional[str] = None,
83
+ page: int = 1,
84
+ page_size: int = 20,
85
+ ) -> dict:
86
+ return self._request(
87
+ "POST",
88
+ "/rest-api/tool/entity_financial_list",
89
+ json_data={
90
+ "entity_name": entity_name,
91
+ "entity_type": entity_type or "",
92
+ "page": page,
93
+ "page_size": page_size,
94
+ },
95
+ )
96
+
97
+ def entity_managed_funds_list(
98
+ self,
99
+ entity_name: str,
100
+ entity_type: Optional[str] = None,
101
+ page: int = 1,
102
+ page_size: int = 20,
103
+ ) -> dict:
104
+ return self._request(
105
+ "POST",
106
+ "/rest-api/tool/entity_managed_funds_list",
107
+ json_data={
108
+ "entity_name": entity_name,
109
+ "entity_type": entity_type or "",
110
+ "page": page,
111
+ "page_size": page_size,
112
+ },
113
+ )
114
+
115
+ def entity_exit_list(
116
+ self,
117
+ entity_name: str,
118
+ entity_type: Optional[str] = None,
119
+ exit_type: Optional[str] = None,
120
+ page: int = 1,
121
+ page_size: int = 20,
122
+ ) -> dict:
123
+ return self._request(
124
+ "POST",
125
+ "/rest-api/tool/entity_exit_list",
126
+ json_data={
127
+ "entity_name": entity_name,
128
+ "entity_type": entity_type or "",
129
+ "exit_type": exit_type or "",
130
+ "page": page,
131
+ "page_size": page_size,
132
+ },
133
+ )
134
+
135
+ def entity_invest_list(
136
+ self,
137
+ entity_name: str,
138
+ entity_type: Optional[str] = None,
139
+ invest_type: Optional[str] = None,
140
+ page: int = 1,
141
+ page_size: int = 20,
142
+ ) -> dict:
143
+ return self._request(
144
+ "POST",
145
+ "/rest-api/tool/entity_invest_list",
146
+ json_data={
147
+ "entity_name": entity_name,
148
+ "entity_type": entity_type or "",
149
+ "invest_type": invest_type or "",
150
+ "page": page,
151
+ "page_size": page_size,
152
+ },
153
+ )
154
+
155
+ def model_financing_probability(
156
+ self,
157
+ entity_name: str,
158
+ entity_type: Optional[str] = None,
159
+ ) -> dict:
160
+ return self._request(
161
+ "POST",
162
+ "/rest-api/tool/model_financing_probability",
163
+ json_data={
164
+ "entity_name": entity_name,
165
+ "entity_type": entity_type or "",
166
+ },
167
+ )
168
+
169
+ def evt_company_financing(
170
+ self,
171
+ start_date: str = "",
172
+ end_date: str = "",
173
+ reg_province: str = "",
174
+ reg_city: str = "",
175
+ reg_county: str = "",
176
+ company_tag: str = "",
177
+ page: int = 1,
178
+ page_size: int = 20,
179
+ ) -> dict:
180
+ return self._request(
181
+ "POST",
182
+ "/rest-api/tool/evt_company_financing",
183
+ json_data={
184
+ "start_date": start_date,
185
+ "end_date": end_date,
186
+ "reg_province": reg_province,
187
+ "reg_city": reg_city,
188
+ "reg_county": reg_county,
189
+ "company_tag": company_tag,
190
+ "page": page,
191
+ "page_size": page_size,
192
+ },
193
+ )
194
+
195
+ def evt_lp_investment(
196
+ self,
197
+ start_date: str = "",
198
+ end_date: str = "",
199
+ reg_province: str = "",
200
+ reg_city: str = "",
201
+ reg_county: str = "",
202
+ page: int = 1,
203
+ page_size: int = 20,
204
+ ) -> dict:
205
+ return self._request(
206
+ "POST",
207
+ "/rest-api/tool/evt_lp_investment",
208
+ json_data={
209
+ "start_date": start_date,
210
+ "end_date": end_date,
211
+ "reg_province": reg_province,
212
+ "reg_city": reg_city,
213
+ "reg_county": reg_county,
214
+ "page": page,
215
+ "page_size": page_size,
216
+ },
217
+ )
218
+
219
+ def evt_company_secondary(
220
+ self,
221
+ start_date: str = "",
222
+ end_date: str = "",
223
+ reg_province: str = "",
224
+ reg_city: str = "",
225
+ reg_county: str = "",
226
+ company_tag: str = "",
227
+ page: int = 1,
228
+ page_size: int = 20,
229
+ ) -> dict:
230
+ return self._request(
231
+ "POST",
232
+ "/rest-api/tool/evt_company_secondary",
233
+ json_data={
234
+ "start_date": start_date,
235
+ "end_date": end_date,
236
+ "reg_province": reg_province,
237
+ "reg_city": reg_city,
238
+ "reg_county": reg_county,
239
+ "company_tag": company_tag,
240
+ "page": page,
241
+ "page_size": page_size,
242
+ },
243
+ )
244
+
245
+ def evt_company_repurchase(
246
+ self,
247
+ start_date: str = "",
248
+ end_date: str = "",
249
+ reg_province: str = "",
250
+ reg_city: str = "",
251
+ reg_county: str = "",
252
+ company_tag: str = "",
253
+ page: int = 1,
254
+ page_size: int = 20,
255
+ ) -> dict:
256
+ return self._request(
257
+ "POST",
258
+ "/rest-api/tool/evt_company_repurchase",
259
+ json_data={
260
+ "start_date": start_date,
261
+ "end_date": end_date,
262
+ "reg_province": reg_province,
263
+ "reg_city": reg_city,
264
+ "reg_county": reg_county,
265
+ "company_tag": company_tag,
266
+ "page": page,
267
+ "page_size": page_size,
268
+ },
269
+ )
270
+
271
+ def evt_ma_company_deal(
272
+ self,
273
+ start_date: str = "",
274
+ end_date: str = "",
275
+ reg_province: str = "",
276
+ reg_city: str = "",
277
+ reg_county: str = "",
278
+ target_company_tag: str = "",
279
+ page: int = 1,
280
+ page_size: int = 20,
281
+ ) -> dict:
282
+ return self._request(
283
+ "POST",
284
+ "/rest-api/tool/evt_ma_company_deal",
285
+ json_data={
286
+ "start_date": start_date,
287
+ "end_date": end_date,
288
+ "reg_province": reg_province,
289
+ "reg_city": reg_city,
290
+ "reg_county": reg_county,
291
+ "target_company_tag": target_company_tag,
292
+ "page": page,
293
+ "page_size": page_size,
294
+ },
295
+ )
296
+
297
+ def evt_company_ipo(
298
+ self,
299
+ start_date: str = "",
300
+ end_date: str = "",
301
+ reg_province: str = "",
302
+ reg_city: str = "",
303
+ reg_county: str = "",
304
+ company_tag: str = "",
305
+ page: int = 1,
306
+ page_size: int = 20,
307
+ ) -> dict:
308
+ return self._request(
309
+ "POST",
310
+ "/rest-api/tool/evt_company_ipo",
311
+ json_data={
312
+ "start_date": start_date,
313
+ "end_date": end_date,
314
+ "reg_province": reg_province,
315
+ "reg_city": reg_city,
316
+ "reg_county": reg_county,
317
+ "company_tag": company_tag,
318
+ "page": page,
319
+ "page_size": page_size,
320
+ },
321
+ )
322
+
323
+ def evt_listing_company_unlock(
324
+ self,
325
+ start_date: str = "",
326
+ end_date: str = "",
327
+ reg_province: str = "",
328
+ reg_city: str = "",
329
+ reg_county: str = "",
330
+ company_tag: str = "",
331
+ page: int = 1,
332
+ page_size: int = 20,
333
+ ) -> dict:
334
+ return self._request(
335
+ "POST",
336
+ "/rest-api/tool/evt_listing_company_unlock",
337
+ json_data={
338
+ "start_date": start_date,
339
+ "end_date": end_date,
340
+ "reg_province": reg_province,
341
+ "reg_city": reg_city,
342
+ "reg_county": reg_county,
343
+ "company_tag": company_tag,
344
+ "page": page,
345
+ "page_size": page_size,
346
+ },
347
+ )
348
+
349
+ def evt_listing_company_reduction(
350
+ self,
351
+ start_date: str = "",
352
+ end_date: str = "",
353
+ reg_province: str = "",
354
+ reg_city: str = "",
355
+ reg_county: str = "",
356
+ company_tag: str = "",
357
+ page: int = 1,
358
+ page_size: int = 20,
359
+ ) -> dict:
360
+ return self._request(
361
+ "POST",
362
+ "/rest-api/tool/evt_listing_company_reduction",
363
+ json_data={
364
+ "start_date": start_date,
365
+ "end_date": end_date,
366
+ "reg_province": reg_province,
367
+ "reg_city": reg_city,
368
+ "reg_county": reg_county,
369
+ "company_tag": company_tag,
370
+ "page": page,
371
+ "page_size": page_size,
372
+ },
373
+ )
374
+
375
+ def evt_s_fund_deal(
376
+ self,
377
+ start_date: str = "",
378
+ end_date: str = "",
379
+ reg_province: str = "",
380
+ reg_city: str = "",
381
+ reg_county: str = "",
382
+ page: int = 1,
383
+ page_size: int = 20,
384
+ ) -> dict:
385
+ return self._request(
386
+ "POST",
387
+ "/rest-api/tool/evt_s_fund_deal",
388
+ json_data={
389
+ "start_date": start_date,
390
+ "end_date": end_date,
391
+ "reg_province": reg_province,
392
+ "reg_city": reg_city,
393
+ "reg_county": reg_county,
394
+ "page": page,
395
+ "page_size": page_size,
396
+ },
397
+ )
398
+
399
+ def model_company_match_gp(
400
+ self,
401
+ company_name: str,
402
+ page: int = 1,
403
+ page_size: int = 5,
404
+ ) -> dict:
405
+ return self._request(
406
+ "POST",
407
+ "/rest-api/tool/model_company_match_gp",
408
+ json_data={
409
+ "company_name": company_name,
410
+ "page": page,
411
+ "page_size": page_size,
412
+ },
413
+ )
414
+
415
+ def close(self):
416
+ self.client.close()
417
+
418
+ def __enter__(self):
419
+ return self
420
+
421
+ def __exit__(self, exc_type, exc_val, exc_tb):
422
+ self.close()
@@ -0,0 +1,48 @@
1
+ from typing import Optional
2
+
3
+ import typer
4
+
5
+ from cli.client import MCPClient
6
+ from cli.utils.output import print_result
7
+
8
+
9
+ def evt_company_financing(
10
+ start_date: Optional[str] = typer.Option(None, "--start-date", help="融资日期-开始,YYYY-MM-DD"),
11
+ end_date: Optional[str] = typer.Option(None, "--end-date", help="融资日期-截止,YYYY-MM-DD"),
12
+ reg_province: Optional[str] = typer.Option(None, "--province", help="公司注册省级行政区划"),
13
+ reg_city: Optional[str] = typer.Option(None, "--city", help="公司注册地级行政区划"),
14
+ reg_county: Optional[str] = typer.Option(None, "--county", help="公司注册县级行政区划"),
15
+ company_tag: Optional[str] = typer.Option(None, "--tag", help="项目公司标签(经营业务类)"),
16
+ page: int = typer.Option(1, "--page", "-p", help="页码,从1开始"),
17
+ page_size: int = typer.Option(20, "--page-size", "-s", help="每页条数,上限20"),
18
+ output: str = typer.Option("table", "--output", "-o", help="输出格式:table/json/csv"),
19
+ ):
20
+ """
21
+ 查询市场投融资事件列表
22
+
23
+ 支持按时间范围、公司注册地区域(省/市/县)、项目公司标签筛选,
24
+ 返回符合条件的融资事件及投资方信息。
25
+
26
+ 示例:
27
+ zerone evt-company-financing --start-date 2024-01-01 --end-date 2024-12-31
28
+ zerone evt-company-financing --province 北京 --tag 人工智能
29
+ """
30
+ try:
31
+ with MCPClient() as client:
32
+ result = client.evt_company_financing(
33
+ start_date=start_date or "",
34
+ end_date=end_date or "",
35
+ reg_province=reg_province or "",
36
+ reg_city=reg_city or "",
37
+ reg_county=reg_county or "",
38
+ company_tag=company_tag or "",
39
+ page=page,
40
+ page_size=page_size,
41
+ )
42
+ print_result(result, output)
43
+ except ValueError as e:
44
+ typer.echo(f"错误: {e}", err=True)
45
+ raise typer.Exit(1)
46
+ except Exception as e:
47
+ typer.echo(f"请求失败: {e}", err=True)
48
+ raise typer.Exit(1)
@@ -0,0 +1,48 @@
1
+ from typing import Optional
2
+
3
+ import typer
4
+
5
+ from cli.client import MCPClient
6
+ from cli.utils.output import print_result
7
+
8
+
9
+ def evt_company_ipo(
10
+ start_date: Optional[str] = typer.Option(None, "--start-date", help="IPO日期-开始,YYYY-MM-DD"),
11
+ end_date: Optional[str] = typer.Option(None, "--end-date", help="IPO日期-截止,YYYY-MM-DD"),
12
+ reg_province: Optional[str] = typer.Option(None, "--province", help="公司注册省级行政区划"),
13
+ reg_city: Optional[str] = typer.Option(None, "--city", help="公司注册地级行政区划"),
14
+ reg_county: Optional[str] = typer.Option(None, "--county", help="公司注册县级行政区划"),
15
+ company_tag: Optional[str] = typer.Option(None, "--tag", help="项目公司标签(经营业务类)"),
16
+ page: int = typer.Option(1, "--page", "-p", help="页码,从1开始"),
17
+ page_size: int = typer.Option(20, "--page-size", "-s", help="每页条数,上限20"),
18
+ output: str = typer.Option("table", "--output", "-o", help="输出格式:table/json/csv"),
19
+ ):
20
+ """
21
+ 查询IPO事件列表
22
+
23
+ 支持按时间范围、公司注册地区域(省/市/县)、项目公司标签筛选,
24
+ 返回符合条件的IPO事件。
25
+
26
+ 示例:
27
+ zerone evt-company-ipo --start-date 2024-01-01 --end-date 2024-12-31
28
+ zerone evt-company-ipo --province 北京 --tag 半导体
29
+ """
30
+ try:
31
+ with MCPClient() as client:
32
+ result = client.evt_company_ipo(
33
+ start_date=start_date or "",
34
+ end_date=end_date or "",
35
+ reg_province=reg_province or "",
36
+ reg_city=reg_city or "",
37
+ reg_county=reg_county or "",
38
+ company_tag=company_tag or "",
39
+ page=page,
40
+ page_size=page_size,
41
+ )
42
+ print_result(result, output)
43
+ except ValueError as e:
44
+ typer.echo(f"错误: {e}", err=True)
45
+ raise typer.Exit(1)
46
+ except Exception as e:
47
+ typer.echo(f"请求失败: {e}", err=True)
48
+ raise typer.Exit(1)
@@ -0,0 +1,48 @@
1
+ from typing import Optional
2
+
3
+ import typer
4
+
5
+ from cli.client import MCPClient
6
+ from cli.utils.output import print_result
7
+
8
+
9
+ def evt_company_repurchase(
10
+ start_date: Optional[str] = typer.Option(None, "--start-date", help="回购日期-开始,YYYY-MM-DD"),
11
+ end_date: Optional[str] = typer.Option(None, "--end-date", help="回购日期-截止,YYYY-MM-DD"),
12
+ reg_province: Optional[str] = typer.Option(None, "--province", help="公司注册省级行政区划"),
13
+ reg_city: Optional[str] = typer.Option(None, "--city", help="公司注册地级行政区划"),
14
+ reg_county: Optional[str] = typer.Option(None, "--county", help="公司注册县级行政区划"),
15
+ company_tag: Optional[str] = typer.Option(None, "--tag", help="项目公司标签(经营业务类)"),
16
+ page: int = typer.Option(1, "--page", "-p", help="页码,从1开始"),
17
+ page_size: int = typer.Option(20, "--page-size", "-s", help="每页条数,上限20"),
18
+ output: str = typer.Option("table", "--output", "-o", help="输出格式:table/json/csv"),
19
+ ):
20
+ """
21
+ 查询回购事件列表
22
+
23
+ 支持按时间范围、公司注册地区域(省/市/县)、项目公司标签筛选,
24
+ 返回符合条件的回购事件。
25
+
26
+ 示例:
27
+ zerone evt-company-repurchase --start-date 2024-01-01 --end-date 2024-12-31
28
+ zerone evt-company-repurchase --province 江苏
29
+ """
30
+ try:
31
+ with MCPClient() as client:
32
+ result = client.evt_company_repurchase(
33
+ start_date=start_date or "",
34
+ end_date=end_date or "",
35
+ reg_province=reg_province or "",
36
+ reg_city=reg_city or "",
37
+ reg_county=reg_county or "",
38
+ company_tag=company_tag or "",
39
+ page=page,
40
+ page_size=page_size,
41
+ )
42
+ print_result(result, output)
43
+ except ValueError as e:
44
+ typer.echo(f"错误: {e}", err=True)
45
+ raise typer.Exit(1)
46
+ except Exception as e:
47
+ typer.echo(f"请求失败: {e}", err=True)
48
+ raise typer.Exit(1)
@@ -0,0 +1,48 @@
1
+ from typing import Optional
2
+
3
+ import typer
4
+
5
+ from cli.client import MCPClient
6
+ from cli.utils.output import print_result
7
+
8
+
9
+ def evt_company_secondary(
10
+ start_date: Optional[str] = typer.Option(None, "--start-date", help="转让日期-开始,YYYY-MM-DD"),
11
+ end_date: Optional[str] = typer.Option(None, "--end-date", help="转让日期-截止,YYYY-MM-DD"),
12
+ reg_province: Optional[str] = typer.Option(None, "--province", help="公司注册省级行政区划"),
13
+ reg_city: Optional[str] = typer.Option(None, "--city", help="公司注册地级行政区划"),
14
+ reg_county: Optional[str] = typer.Option(None, "--county", help="公司注册县级行政区划"),
15
+ company_tag: Optional[str] = typer.Option(None, "--tag", help="项目公司标签(经营业务类)"),
16
+ page: int = typer.Option(1, "--page", "-p", help="页码,从1开始"),
17
+ page_size: int = typer.Option(20, "--page-size", "-s", help="每页条数,上限20"),
18
+ output: str = typer.Option("table", "--output", "-o", help="输出格式:table/json/csv"),
19
+ ):
20
+ """
21
+ 查询老股转让事件列表
22
+
23
+ 支持按时间范围、公司注册地区域(省/市/县)、项目公司标签筛选,
24
+ 返回符合条件的老股转让事件。
25
+
26
+ 示例:
27
+ zerone evt-company-secondary --start-date 2024-01-01 --end-date 2024-12-31
28
+ zerone evt-company-secondary --province 上海
29
+ """
30
+ try:
31
+ with MCPClient() as client:
32
+ result = client.evt_company_secondary(
33
+ start_date=start_date or "",
34
+ end_date=end_date or "",
35
+ reg_province=reg_province or "",
36
+ reg_city=reg_city or "",
37
+ reg_county=reg_county or "",
38
+ company_tag=company_tag or "",
39
+ page=page,
40
+ page_size=page_size,
41
+ )
42
+ print_result(result, output)
43
+ except ValueError as e:
44
+ typer.echo(f"错误: {e}", err=True)
45
+ raise typer.Exit(1)
46
+ except Exception as e:
47
+ typer.echo(f"请求失败: {e}", err=True)
48
+ raise typer.Exit(1)