cnhkmcp 2.0.1__py3-none-any.whl

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 (95) hide show
  1. cnhkmcp/__init__.py +125 -0
  2. cnhkmcp/untracked/APP/.gitignore +32 -0
  3. cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md +112 -0
  4. cnhkmcp/untracked/APP/README.md +309 -0
  5. cnhkmcp/untracked/APP/Tranformer/Transformer.py +2192 -0
  6. cnhkmcp/untracked/APP/Tranformer/ace.log +0 -0
  7. cnhkmcp/untracked/APP/Tranformer/ace_lib.py +1489 -0
  8. cnhkmcp/untracked/APP/Tranformer/helpful_functions.py +180 -0
  9. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json +1786 -0
  10. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_/321/207/320/264/342/225/221/321/204/342/225/233/320/233.json +654 -0
  11. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json +261 -0
  12. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json +170 -0
  13. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_/321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/277/321/207/320/253/342/224/244/321/206/320/236/320/265/321/210/342/225/234/342/225/234/321/205/320/225/320/265Machine_lib.json +22 -0
  14. cnhkmcp/untracked/APP/Tranformer/parsetab.py +60 -0
  15. cnhkmcp/untracked/APP/Tranformer/template_summary.txt +408 -0
  16. cnhkmcp/untracked/APP/Tranformer/transformer_config.json +7 -0
  17. cnhkmcp/untracked/APP/Tranformer/validator.py +889 -0
  18. cnhkmcp/untracked/APP/ace.log +65 -0
  19. cnhkmcp/untracked/APP/ace_lib.py +1489 -0
  20. cnhkmcp/untracked/APP/blueprints/__init__.py +6 -0
  21. cnhkmcp/untracked/APP/blueprints/feature_engineering.py +347 -0
  22. cnhkmcp/untracked/APP/blueprints/idea_house.py +221 -0
  23. cnhkmcp/untracked/APP/blueprints/inspiration_house.py +432 -0
  24. cnhkmcp/untracked/APP/blueprints/paper_analysis.py +570 -0
  25. cnhkmcp/untracked/APP/custom_templates/templates.json +1257 -0
  26. cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +400 -0
  27. cnhkmcp/untracked/APP/give_me_idea/ace_lib.py +1489 -0
  28. cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +247 -0
  29. cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py +180 -0
  30. cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +11 -0
  31. cnhkmcp/untracked/APP/helpful_functions.py +180 -0
  32. cnhkmcp/untracked/APP/hkSimulator/ace.log +0 -0
  33. cnhkmcp/untracked/APP/hkSimulator/ace_lib.py +1476 -0
  34. cnhkmcp/untracked/APP/hkSimulator/autosim_20251205_145240.log +0 -0
  35. cnhkmcp/untracked/APP/hkSimulator/autosim_20251215_030103.log +0 -0
  36. cnhkmcp/untracked/APP/hkSimulator/autosimulator.py +447 -0
  37. cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py +180 -0
  38. cnhkmcp/untracked/APP/mirror_config.txt +20 -0
  39. cnhkmcp/untracked/APP/operaters.csv +129 -0
  40. cnhkmcp/untracked/APP/requirements.txt +53 -0
  41. cnhkmcp/untracked/APP/run_app.bat +28 -0
  42. cnhkmcp/untracked/APP/run_app.sh +34 -0
  43. cnhkmcp/untracked/APP/setup_tsinghua.bat +39 -0
  44. cnhkmcp/untracked/APP/setup_tsinghua.sh +43 -0
  45. cnhkmcp/untracked/APP/simulator/alpha_submitter.py +404 -0
  46. cnhkmcp/untracked/APP/simulator/simulator_wqb.py +618 -0
  47. cnhkmcp/untracked/APP/ssrn-3332513.pdf +109188 -19
  48. cnhkmcp/untracked/APP/static/brain.js +528 -0
  49. cnhkmcp/untracked/APP/static/decoder.js +1540 -0
  50. cnhkmcp/untracked/APP/static/feature_engineering.js +1729 -0
  51. cnhkmcp/untracked/APP/static/idea_house.js +937 -0
  52. cnhkmcp/untracked/APP/static/inspiration.js +465 -0
  53. cnhkmcp/untracked/APP/static/inspiration_house.js +868 -0
  54. cnhkmcp/untracked/APP/static/paper_analysis.js +390 -0
  55. cnhkmcp/untracked/APP/static/script.js +2942 -0
  56. cnhkmcp/untracked/APP/static/simulator.js +597 -0
  57. cnhkmcp/untracked/APP/static/styles.css +3127 -0
  58. cnhkmcp/untracked/APP/static/usage_widget.js +508 -0
  59. cnhkmcp/untracked/APP/templates/alpha_inspector.html +511 -0
  60. cnhkmcp/untracked/APP/templates/feature_engineering.html +960 -0
  61. cnhkmcp/untracked/APP/templates/idea_house.html +564 -0
  62. cnhkmcp/untracked/APP/templates/index.html +911 -0
  63. cnhkmcp/untracked/APP/templates/inspiration_house.html +861 -0
  64. cnhkmcp/untracked/APP/templates/paper_analysis.html +91 -0
  65. cnhkmcp/untracked/APP/templates/simulator.html +343 -0
  66. cnhkmcp/untracked/APP/templates/transformer_web.html +580 -0
  67. cnhkmcp/untracked/APP/usage.md +351 -0
  68. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/ace_lib.py +1489 -0
  69. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/brain_alpha_inspector.py +712 -0
  70. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/helpful_functions.py +180 -0
  71. cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +2393 -0
  72. cnhkmcp/untracked/arXiv_API_Tool_Manual.md +490 -0
  73. cnhkmcp/untracked/arxiv_api.py +229 -0
  74. cnhkmcp/untracked/forum_functions.py +998 -0
  75. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/forum_functions.py +407 -0
  76. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +2415 -0
  77. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/user_config.json +31 -0
  78. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/210/320/276/320/271AI/321/210/320/277/342/225/227/321/210/342/224/220/320/251/321/204/342/225/225/320/272/321/206/320/246/320/227/321/206/320/261/320/263/321/206/320/255/320/265/321/205/320/275/320/266/321/204/342/225/235/320/252/321/204/342/225/225/320/233/321/210/342/225/234/342/225/234/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270.md +101 -0
  79. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  80. cnhkmcp/untracked/platform_functions.py +2886 -0
  81. cnhkmcp/untracked/sample_mcp_config.json +11 -0
  82. cnhkmcp/untracked/user_config.json +31 -0
  83. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/222/321/210/320/220/320/223/321/206/320/246/320/227/321/206/320/261/320/263_BRAIN_Alpha_Test_Requirements_and_Tips.md +202 -0
  84. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Alpha_explaination_workflow.md +56 -0
  85. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_6_Tips_Datafield_Exploration_Guide.md +194 -0
  86. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_Alpha_Improvement_Workflow.md +101 -0
  87. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Dataset_Exploration_Expert_Manual.md +436 -0
  88. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_daily_report_workflow.md +128 -0
  89. cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  90. cnhkmcp-2.0.1.dist-info/METADATA +187 -0
  91. cnhkmcp-2.0.1.dist-info/RECORD +95 -0
  92. cnhkmcp-2.0.1.dist-info/WHEEL +5 -0
  93. cnhkmcp-2.0.1.dist-info/entry_points.txt +2 -0
  94. cnhkmcp-2.0.1.dist-info/licenses/LICENSE +21 -0
  95. cnhkmcp-2.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,190 @@
1
+ """
2
+ check_install_packages.py
3
+
4
+ Simple script that hardcodes the project's required packages and ensures they are installed
5
+ before running the server or tests. It will install missing packages (or upgrade if below
6
+ required version) by invoking pip via the running Python interpreter.
7
+
8
+ Usage: python check_install_packages.py
9
+
10
+ This script is intentionally conservative: it uses the distribution/package names from
11
+ `requirements.txt` and calls pip to install the exact spec (e.g. "requests>=2.31.0").
12
+ It prints a concise summary at the end.
13
+ """
14
+
15
+ from __future__ import annotations
16
+ import sys
17
+ import subprocess
18
+ import importlib
19
+ import importlib.metadata
20
+ import re
21
+ from typing import List, Tuple, Optional
22
+
23
+ # Hardcoded package requirements (from requirements.txt)
24
+ REQUIRED_PACKAGES: List[str] = [
25
+ "fastmcp>=0.1.0",
26
+ "requests>=2.31.0",
27
+ "pandas>=2.0.0",
28
+ "selenium>=4.15.0",
29
+ "beautifulsoup4>=4.12.0",
30
+ "pydantic>=2.0.0",
31
+ "email-validator>=2.0.0",
32
+ "aiohttp>=3.8.0",
33
+ "webdriver-manager>=4.0.0"
34
+ ]
35
+
36
+
37
+ def parse_spec(spec: str) -> Tuple[str, Optional[str]]:
38
+ """Return (name, min_version) for a spec like 'pkg>=1.2.3'."""
39
+ if ">=" in spec:
40
+ name, ver = spec.split(">=", 1)
41
+ return name.strip(), ver.strip()
42
+ return spec.strip(), None
43
+
44
+
45
+ def version_tuple(v: str) -> List[int]:
46
+ parts = re.split(r"[^0-9]+", v)
47
+ nums = []
48
+ for p in parts:
49
+ if p == "":
50
+ continue
51
+ try:
52
+ nums.append(int(p))
53
+ except ValueError:
54
+ # Non-numeric part, stop parsing further
55
+ break
56
+ return nums
57
+
58
+
59
+ def is_version_sufficient(installed: str, required: str) -> bool:
60
+ if not installed:
61
+ return False
62
+ try:
63
+ i_parts = version_tuple(installed)
64
+ r_parts = version_tuple(required)
65
+ # Compare element-wise
66
+ for a, b in zip(i_parts, r_parts):
67
+ if a > b:
68
+ return True
69
+ if a < b:
70
+ return False
71
+ # If equal up to the length of required, installed is sufficient if it's at least as long
72
+ return len(i_parts) >= len(r_parts)
73
+ except Exception:
74
+ return False
75
+
76
+
77
+ def install_package(spec: str) -> Tuple[bool, str]:
78
+ """Install a package spec using pip. Streams output live and returns (success, output)."""
79
+ # Use -v for verbose pip output; capture stdout/stderr while streaming to console
80
+ cmd = [sys.executable, "-m", "pip", "install", "-v", spec]
81
+ try:
82
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
83
+ output_lines = []
84
+ if proc.stdout:
85
+ for line in proc.stdout:
86
+ output_lines.append(line)
87
+ # print each pip line as it arrives for visibility
88
+ try:
89
+ print(line.rstrip())
90
+ except Exception:
91
+ # fallback: print raw line
92
+ print(line)
93
+ proc.wait()
94
+ out = "".join(output_lines)
95
+ success = proc.returncode == 0
96
+ return success, out
97
+ except Exception as e:
98
+ return False, str(e)
99
+
100
+
101
+ def main():
102
+ results = []
103
+ print("Checking required packages...\n")
104
+ for spec in REQUIRED_PACKAGES:
105
+ name, min_ver = parse_spec(spec)
106
+ installed_ver = None
107
+ try:
108
+ installed_ver = importlib.metadata.version(name)
109
+ except importlib.metadata.PackageNotFoundError:
110
+ installed_ver = None
111
+ except Exception:
112
+ # Some packages may have different distribution vs import names; try best-effort
113
+ installed_ver = None
114
+
115
+ needs_install = False
116
+ action = "present"
117
+ if installed_ver is None:
118
+ needs_install = True
119
+ action = "install"
120
+ elif min_ver is not None:
121
+ if not is_version_sufficient(installed_ver, min_ver):
122
+ needs_install = True
123
+ action = f"upgrade (installed {installed_ver} < required {min_ver})"
124
+
125
+ if needs_install:
126
+ print(f"-> {name}: {action} via pip ({spec})")
127
+ success, output = install_package(spec)
128
+ # Attempt to read installed version after install
129
+ installed_after = None
130
+ if success:
131
+ try:
132
+ installed_after = importlib.metadata.version(name)
133
+ except Exception:
134
+ installed_after = None
135
+ if installed_after:
136
+ print(f" -> {name} now installed as: {installed_after}")
137
+
138
+ results.append({
139
+ "name": name,
140
+ "spec": spec,
141
+ "installed_version_before": installed_ver,
142
+ "installed_version_after": installed_after,
143
+ "action": action,
144
+ "success": success,
145
+ "output": output
146
+ })
147
+ else:
148
+ print(f"-> {name}: OK (installed: {installed_ver})")
149
+ results.append({
150
+ "name": name,
151
+ "spec": spec,
152
+ "installed_version_before": installed_ver,
153
+ "action": "none",
154
+ "success": True,
155
+ "output": ""
156
+ })
157
+
158
+ # Summary
159
+ print("\nSummary:")
160
+ installed_count = sum(1 for r in results if r["success"] and r["action"] == "none")
161
+ installed_or_fixed = sum(1 for r in results if r["success"] and r["action"] != "none")
162
+ failed = [r for r in results if not r["success"]]
163
+
164
+ print(f" Packages already OK: {installed_count}")
165
+ print(f" Packages installed/upgraded by this script: {installed_or_fixed}")
166
+ print(f" Packages failed to install: {len(failed)}")
167
+ if failed:
168
+ for f in failed:
169
+ print(f" - {f['name']}: attempted '{f['spec']}' -> error (see details below)")
170
+
171
+ # If any failed, print their outputs for debugging
172
+ if failed:
173
+ print("\nFailed install details:\n")
174
+ for f in failed:
175
+ print("-----")
176
+ print(f"Package: {f['name']}")
177
+ print(f"Spec: {f['spec']}")
178
+ print(f"Installed before: {f.get('installed_version_before')}")
179
+ print(f"Installed after: {f.get('installed_version_after')}")
180
+ print("Output:")
181
+ print(f.get("output", "(no output)"))
182
+
183
+ print("\nDone.")
184
+ # Exit with non-zero code if any install failed
185
+ if failed:
186
+ sys.exit(2)
187
+
188
+
189
+ if __name__ == "__main__":
190
+ main()
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: cnhkmcp
3
+ Version: 2.0.1
4
+ Summary: A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
5
+ Home-page: https://github.com/cnhk/cnhkmcp
6
+ Author: CNHK
7
+ Author-email: cnhk@example.com
8
+ Project-URL: Bug Reports, https://github.com/cnhk/cnhkmcp/issues
9
+ Project-URL: Source, https://github.com/cnhk/cnhkmcp
10
+ Project-URL: Documentation, https://github.com/cnhk/cnhkmcp#readme
11
+ Keywords: mcp,quantitative,trading,api,client
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Financial and Insurance Industry
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Topic :: Office/Business :: Financial
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Requires-Python: >=3.8
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: requests>=2.28.0
28
+ Requires-Dist: pandas>=1.5.0
29
+ Requires-Dist: selenium>=4.0.0
30
+ Requires-Dist: beautifulsoup4>=4.11.0
31
+ Requires-Dist: mcp>=0.1.0
32
+ Requires-Dist: pydantic>=1.10.0
33
+ Requires-Dist: lxml>=4.9.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=6.0; extra == "dev"
36
+ Requires-Dist: pytest-asyncio>=0.18.0; extra == "dev"
37
+ Requires-Dist: black>=21.0; extra == "dev"
38
+ Requires-Dist: flake8>=3.8; extra == "dev"
39
+ Dynamic: author
40
+ Dynamic: author-email
41
+ Dynamic: classifier
42
+ Dynamic: description
43
+ Dynamic: description-content-type
44
+ Dynamic: home-page
45
+ Dynamic: keywords
46
+ Dynamic: license-file
47
+ Dynamic: project-url
48
+ Dynamic: provides-extra
49
+ Dynamic: requires-dist
50
+ Dynamic: requires-python
51
+ Dynamic: summary
52
+
53
+ # CNHK MCP Server
54
+
55
+ A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration. This package provides a complete set of tools for interacting with quantitative trading APIs, managing simulations, and accessing financial data.
56
+
57
+ ## Features
58
+
59
+ - **API Integration**: Complete API client for quantitative trading platforms
60
+ - **Simulation Management**: Create, monitor, and manage trading simulations
61
+ - **Data Access**: Retrieve datasets, data fields, and financial information
62
+ - **Alpha Management**: Comprehensive alpha factor management and analysis
63
+ - **Forum Integration**: Access to support forums and documentation
64
+ - **Performance Analysis**: Advanced performance metrics and correlation analysis
65
+ - **Competition Support**: Tools for trading competitions and leaderboards
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ pip install cnhkmcp
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ```python
76
+ from cnhkmcp import BrainApiClient
77
+
78
+ # Initialize client
79
+ client = BrainApiClient()
80
+
81
+ # Authenticate
82
+ await client.authenticate("your_email@example.com", "your_password")
83
+
84
+ # Create a simulation
85
+ simulation_data = {
86
+ "type": "REGULAR",
87
+ "settings": {
88
+ "instrumentType": "EQUITY",
89
+ "region": "USA",
90
+ "universe": "TOP3000"
91
+ },
92
+ "regular": "your_alpha_formula"
93
+ }
94
+
95
+ result = await client.create_simulation(simulation_data)
96
+ print(f"Simulation created: {result}")
97
+ ```
98
+
99
+ ## Main Components
100
+
101
+ ### API Client (`pythonmcp.py`)
102
+ - Authentication and session management
103
+ - Simulation creation and monitoring
104
+ - Alpha factor management
105
+ - Data retrieval and analysis
106
+ - Performance metrics
107
+
108
+ ### Forum Client (`forum_functions.py`)
109
+ - Glossary term extraction
110
+ - Forum post search and reading
111
+ - Support documentation access
112
+
113
+ ## Usage Examples
114
+
115
+ ### Authentication
116
+ ```python
117
+ from cnhkmcp import authenticate
118
+
119
+ result = await authenticate("email@example.com", "password")
120
+ print(f"Authentication status: {result}")
121
+ ```
122
+
123
+ ### Create Simulation
124
+ ```python
125
+ from cnhkmcp import create_simulation
126
+
127
+ result = await create_simulation(
128
+ type="REGULAR",
129
+ instrument_type="EQUITY",
130
+ region="USA",
131
+ universe="TOP3000",
132
+ regular="your_alpha_formula_here"
133
+ )
134
+ ```
135
+
136
+ ### Get Alpha Details
137
+ ```python
138
+ from cnhkmcp import get_alpha_details
139
+
140
+ alpha_info = await get_alpha_details("alpha_id_here")
141
+ print(f"Alpha details: {alpha_info}")
142
+ ```
143
+
144
+ ### Search Forum Posts
145
+ ```python
146
+ from cnhkmcp import search_forum_posts
147
+
148
+ results = await search_forum_posts(
149
+ email="email@example.com",
150
+ password="password",
151
+ search_query="alpha formula"
152
+ )
153
+ ```
154
+
155
+ ## Configuration
156
+
157
+ The package supports configuration through JSON files:
158
+
159
+ - `user_config.json`: User-specific settings
160
+ - `brain_config.json`: Platform configuration
161
+
162
+ ## Requirements
163
+
164
+ - Python 3.8+
165
+ - Chrome browser (for forum functionality)
166
+ - Valid platform credentials
167
+
168
+ ## Dependencies
169
+
170
+ - requests
171
+ - pandas
172
+ - selenium
173
+ - beautifulsoup4
174
+ - mcp
175
+ - pydantic
176
+
177
+ ## License
178
+
179
+ MIT License
180
+
181
+ ## Contributing
182
+
183
+ Contributions are welcome! Please feel free to submit a Pull Request.
184
+
185
+ ## Support
186
+
187
+ For support and questions, please refer to the documentation or create an issue in the repository.
@@ -0,0 +1,95 @@
1
+ cnhkmcp/__init__.py,sha256=6HAUbLyRJK-E8TxYkbuGHZ57oAxeH8LgrUVK19ttNhY,2758
2
+ cnhkmcp/untracked/arXiv_API_Tool_Manual.md,sha256=I3hvI5mpmIjBuWptufoVSWFnuhyUc67oCGHEuR0p_xs,13552
3
+ cnhkmcp/untracked/arxiv_api.py,sha256=-E-Ub9K-DXAYaCjrbobyfQ9H97gaZBc7pL6xPEyVHec,9020
4
+ cnhkmcp/untracked/forum_functions.py,sha256=QW-CplAsqDkw-Wcwq-1tuZBq48dEO-vXZ8xw7X65EuE,42303
5
+ cnhkmcp/untracked/platform_functions.py,sha256=3tXQnlYlXJyrYdEvys6q-4L-PMAk2sOVkBlntsbB4Ig,123322
6
+ cnhkmcp/untracked/sample_mcp_config.json,sha256=QSFvZ086bxUQsvmLjcE6pL9ObzKn4FGnt9npWPo7Eps,1044
7
+ cnhkmcp/untracked/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
8
+ cnhkmcp/untracked/示例参考文档_BRAIN_Alpha_Test_Requirements_and_Tips.md,sha256=W4dtQrqoTN72UyvIsvkGRF0HFOJLHSDeeSlbR3gqQg0,17133
9
+ cnhkmcp/untracked/示例工作流_Alpha_explaination_workflow.md,sha256=QukeT9gIg4g28AuYPqn-fYtCwb-JmMxZuIkmkrkUfFY,4916
10
+ cnhkmcp/untracked/示例工作流_BRAIN_6_Tips_Datafield_Exploration_Guide.md,sha256=YyMX1MIsDTJTduxulY-fYipNHvRihshQy9Q2j6Zxg2Q,9123
11
+ cnhkmcp/untracked/示例工作流_BRAIN_Alpha_Improvement_Workflow.md,sha256=XlWYREd_qXe1skdXIhkiGY05oDr_6KiBs1WkerY4S8U,5092
12
+ cnhkmcp/untracked/示例工作流_Dataset_Exploration_Expert_Manual.md,sha256=-C4fWdaBe9UzA5BDZz0Do2z8RaPWLslb6D0nTz6fqk4,24403
13
+ cnhkmcp/untracked/示例工作流_daily_report_workflow.md,sha256=6aNmPqWRn09XdQMRxoVTka9IYVOUv5LcWparHu16EfQ,9460
14
+ cnhkmcp/untracked/配置前运行我_安装必要依赖包.py,sha256=BnUyL5g6PaC62yEuS-8vcDSJ0oKu3k6jqQxi2jginuQ,6612
15
+ cnhkmcp/untracked/APP/.gitignore,sha256=oPCoVTNo82bhkN0c671LdjCpOTVpVhZI5NR75ztcg48,317
16
+ cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md,sha256=b5xV74-_RtXq2K1EsYDwMukO6lxjJ4-lnOAEnTHpFS0,4706
17
+ cnhkmcp/untracked/APP/README.md,sha256=vb7hmQX0sH5aFNBmDCN5szMSDHm1_h2VKY4UKCt0aMk,11676
18
+ cnhkmcp/untracked/APP/ace.log,sha256=A2YNM5-LlQeROSkKFV7Xv20K2mfrn6CzwLNKyBGsvSY,10753
19
+ cnhkmcp/untracked/APP/ace_lib.py,sha256=2YbAhDldT5Jwdva-9LK-rqHVYQxtOLKLN0Z4jsfoazA,52937
20
+ cnhkmcp/untracked/APP/helpful_functions.py,sha256=VS-rh4T2CMWLFK4clI7-DYsnqwO5dx5L-rgL8U8BmT8,6622
21
+ cnhkmcp/untracked/APP/mirror_config.txt,sha256=RL1jFYwcvDPkLd6tc_lqVcwjTLORWt5Qu0Ym_BTPaao,504
22
+ cnhkmcp/untracked/APP/operaters.csv,sha256=g8m6z-u0x-CoqGFSp_g3UMyLJkdFLE5UwsNkueMH1yw,13610
23
+ cnhkmcp/untracked/APP/requirements.txt,sha256=T7qwWI9C916AVkKpYWxbcCCCX8iPL7vu3Ha_exnltRY,859
24
+ cnhkmcp/untracked/APP/run_app.bat,sha256=YqDOfGihB4NmW5WnUsv6gYIZBjaYSaLXSyXe9ESg9fI,663
25
+ cnhkmcp/untracked/APP/run_app.sh,sha256=6uM4Yky-gE6rP-zJgLR36jpI03NFBqNAa-Vgg5cbZm8,846
26
+ cnhkmcp/untracked/APP/setup_tsinghua.bat,sha256=9dLWCaQTULf3d2LqiAlvQrA4wuM1dysGh-vIDMfpgvE,1050
27
+ cnhkmcp/untracked/APP/setup_tsinghua.sh,sha256=mMDXTqCRIXtSHa_1pU0jCnNF-xajqfZDlUA72XpcAOk,1195
28
+ cnhkmcp/untracked/APP/ssrn-3332513.pdf,sha256=GEwf1Srtk-fTvF03dhTEjXJstHBARIUg31k7s5kxS98,2082078
29
+ cnhkmcp/untracked/APP/usage.md,sha256=lPpA6qqAMvVsm41ikbRR1ZWFcuPSgqhMXOUig52eZCI,16164
30
+ cnhkmcp/untracked/APP/运行打开我.py,sha256=MdTCyPAQHiH58xlA75yAZf6zsRFGlsW0grkricAONPo,97152
31
+ cnhkmcp/untracked/APP/Tranformer/Transformer.py,sha256=nvkDLv_untR-M_lAsvhpyvoyrkb8732JblB8MGeGjIA,111571
32
+ cnhkmcp/untracked/APP/Tranformer/ace.log,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
+ cnhkmcp/untracked/APP/Tranformer/ace_lib.py,sha256=2YbAhDldT5Jwdva-9LK-rqHVYQxtOLKLN0Z4jsfoazA,52937
34
+ cnhkmcp/untracked/APP/Tranformer/helpful_functions.py,sha256=VS-rh4T2CMWLFK4clI7-DYsnqwO5dx5L-rgL8U8BmT8,6622
35
+ cnhkmcp/untracked/APP/Tranformer/parsetab.py,sha256=29clH5xFEmKpqzRvrLN89QE8JFJNYFhH-gEFR4y7448,7650
36
+ cnhkmcp/untracked/APP/Tranformer/template_summary.txt,sha256=vNuvOWGxLu_JCsR_MkasOQaxuamuOenRKKiiYcfS50s,32616
37
+ cnhkmcp/untracked/APP/Tranformer/transformer_config.json,sha256=q3Io_1o_BAt-2GNAUKgCs_YR3exkiGFnUqykiPUC1jw,191
38
+ cnhkmcp/untracked/APP/Tranformer/validator.py,sha256=bvQt55-n2FHkeBA6Ui7tc0oLk_cnriDxt5z-IgaeKZA,50789
39
+ cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json,sha256=Xu1FHoLAAPVipNwBhCrEYIteLhV8woe9JBWCG9lENCc,83118
40
+ cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_示例.json,sha256=K40tcWPiUKaPnrtMdfsN2BOBG5IzqSz04XT6gRz7FVE,23139
41
+ cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json,sha256=toxymnqyP-Viy9Kg05hNOW5LXqTPhcWNuWbQs3zQp5c,10324
42
+ cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json,sha256=LnNJp3qM3WTCEJo4KKkCyk6VcdPgwcq7qVwimcu0lLs,17892
43
+ cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_示例可直接载入Machine_lib.json,sha256=RToEIw0zov6csDwW6MfEJyxJEhaw9LvuRD9bz9QDCFY,3200
44
+ cnhkmcp/untracked/APP/blueprints/__init__.py,sha256=akR6SdIFo637C4Ii7c2-c7asVesJQT_sJ5ICMSRBeOU,216
45
+ cnhkmcp/untracked/APP/blueprints/feature_engineering.py,sha256=TyLaePibNUJtwEOTun8gVrB6j5QhXbwxwEixBhv15kk,13103
46
+ cnhkmcp/untracked/APP/blueprints/idea_house.py,sha256=P_Pq_kmw2N3YluBOH9e0SwsCswWZc6yR7eVwMK4dxe0,9259
47
+ cnhkmcp/untracked/APP/blueprints/inspiration_house.py,sha256=JsSoKyCfvxh8n0wpRqWxzajc83SwNQ_aVcoBauu9QfM,19002
48
+ cnhkmcp/untracked/APP/blueprints/paper_analysis.py,sha256=YVtQ22uiY8ZO-B2x4ckoyZ4olDtcxqsJrV0gPDX56A8,22247
49
+ cnhkmcp/untracked/APP/custom_templates/templates.json,sha256=ARrpRsxGcUpC2iepS6j6A_0tdu_xUJTIyvLDb8uzL_E,48776
50
+ cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md,sha256=y95Lr8AZ-CQ-axJBDJHixsqR2Ig6nWJhHItKJJU1ZCA,16376
51
+ cnhkmcp/untracked/APP/give_me_idea/ace_lib.py,sha256=2YbAhDldT5Jwdva-9LK-rqHVYQxtOLKLN0Z4jsfoazA,52937
52
+ cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py,sha256=uqG2nK5x8BGvZWdK2S0zSym-3mevWYobcN4_k8xZzDA,8795
53
+ cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py,sha256=VS-rh4T2CMWLFK4clI7-DYsnqwO5dx5L-rgL8U8BmT8,6622
54
+ cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md,sha256=QjwX0_b0DhhiNlo3ZwkIfXXSsJnk_FyjkZftyVwnCZ8,2317
55
+ cnhkmcp/untracked/APP/hkSimulator/ace.log,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
+ cnhkmcp/untracked/APP/hkSimulator/ace_lib.py,sha256=v5i16oVc7o2ndacm7GPnq_RBc4D1NHgc8fQA2F_Y1oA,52669
57
+ cnhkmcp/untracked/APP/hkSimulator/autosim_20251205_145240.log,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
+ cnhkmcp/untracked/APP/hkSimulator/autosim_20251215_030103.log,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
+ cnhkmcp/untracked/APP/hkSimulator/autosimulator.py,sha256=JmhmboakiDDQetWmn8t0-k6dgbbm0T3i-W6imVwuuGA,18641
60
+ cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py,sha256=VS-rh4T2CMWLFK4clI7-DYsnqwO5dx5L-rgL8U8BmT8,6622
61
+ cnhkmcp/untracked/APP/simulator/alpha_submitter.py,sha256=Wxx7DyFr0VwH709JhxXPj1Jiz8dShaVaYar3HTVMgv4,15652
62
+ cnhkmcp/untracked/APP/simulator/simulator_wqb.py,sha256=dh3FGBUKZWxTpyJAline1Kh_UJp5we__qcBc8di8ilk,23724
63
+ cnhkmcp/untracked/APP/static/brain.js,sha256=WSRMZvj1aQUwiI6yG6gfv7xa2SnIRCF0sHEPhwpzews,18819
64
+ cnhkmcp/untracked/APP/static/decoder.js,sha256=sKyfgsleHvokCMw6Zp-XfcjixkT8cyMvw6ASDhN6b9I,61987
65
+ cnhkmcp/untracked/APP/static/feature_engineering.js,sha256=X6nis3FmytrNAE8mM-U6-VqmqZMAQ2X59Iy9RmOF5_8,73895
66
+ cnhkmcp/untracked/APP/static/idea_house.js,sha256=dg6zt1mFr99gONdIDqNN_P3ChPEMzCmnWTF0OW09x9w,34225
67
+ cnhkmcp/untracked/APP/static/inspiration.js,sha256=uSmk8_a9MTYDmDwjZG9Z_Jl3nvC4Hxr3aYiqXZl-ZBk,17014
68
+ cnhkmcp/untracked/APP/static/inspiration_house.js,sha256=U3L5vyguy10z7Ww-EFz59OlZUDw3KtIK_JyQzXYtdZ4,31795
69
+ cnhkmcp/untracked/APP/static/paper_analysis.js,sha256=EWD6fTfC6hMLL6IeqDmstP9w6Cezq5607ucUpEpuHkg,16939
70
+ cnhkmcp/untracked/APP/static/script.js,sha256=uyh3XHlRMC-VUe7mhWMvBlejGd-f_gMgH1kola7PlH8,108925
71
+ cnhkmcp/untracked/APP/static/simulator.js,sha256=y8SEYsl1EifQJPC1A7D87q1sx6N4LESkG0l6gHg1u1Q,21590
72
+ cnhkmcp/untracked/APP/static/styles.css,sha256=n1ufP3lerFSG9paiGO6Criq0zIqvqdHhZPNOcjCKJ0Q,55498
73
+ cnhkmcp/untracked/APP/static/usage_widget.js,sha256=nbjNFiLSaX2SllDaLrXb6OlqZ2DC_6fi9H0D62Ei-GY,16646
74
+ cnhkmcp/untracked/APP/templates/alpha_inspector.html,sha256=EY919KDTPw46FBQwQaxwfpx9_CYUet7fkpD03LBGlF8,22226
75
+ cnhkmcp/untracked/APP/templates/feature_engineering.html,sha256=SA_N46-Q_Oo68clS0-QFvbNW5v40uZPQ8Cmmc44RCP8,38443
76
+ cnhkmcp/untracked/APP/templates/idea_house.html,sha256=oQV-vdpAi-HPof1nUClYsJALrF0JX5jhgfM3LOecBdM,20553
77
+ cnhkmcp/untracked/APP/templates/index.html,sha256=jNYOUci-IKWA9MyHXou-iUO3N0Sk9H86w7zFeYwqTjQ,57679
78
+ cnhkmcp/untracked/APP/templates/inspiration_house.html,sha256=oWTEjmR0FEniFvr5NaM7_AThkRNmurKGvoTyINIVDl0,26469
79
+ cnhkmcp/untracked/APP/templates/paper_analysis.html,sha256=vbDw4MAfmpFoXbef4roX6NKdto_a58RMIRi7Amr2P4M,4220
80
+ cnhkmcp/untracked/APP/templates/simulator.html,sha256=dPAY-fT7oEDCW945ZLLPSUPoawF-TACnVKiqrGiaWkI,12589
81
+ cnhkmcp/untracked/APP/templates/transformer_web.html,sha256=de5fNhtbdsMMyW5cygvvvW9vSJL81O2A_QPqTmr0usc,27513
82
+ cnhkmcp/untracked/APP/缘分一道桥/ace_lib.py,sha256=2YbAhDldT5Jwdva-9LK-rqHVYQxtOLKLN0Z4jsfoazA,52937
83
+ cnhkmcp/untracked/APP/缘分一道桥/brain_alpha_inspector.py,sha256=KjU6PNyD1Xfqqa0IGKM-VFH_p_4RKBzhmGQczM14KiM,24703
84
+ cnhkmcp/untracked/APP/缘分一道桥/helpful_functions.py,sha256=VS-rh4T2CMWLFK4clI7-DYsnqwO5dx5L-rgL8U8BmT8,6622
85
+ cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/forum_functions.py,sha256=VuyUaguA0OjJbVRN5Vy8UEFXSAviS3jhDSRWyyPOtfo,18975
86
+ cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/platform_functions.py,sha256=aa5jCRjCORFars8CVahqwbk5ni0mLYWu9yND7Z4TGUM,99159
87
+ cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/user_config.json,sha256=_INn1X1qIsITrmEno-BRlQOAGm9wnNCw-6B333DEvnk,695
88
+ cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/让AI读这个文档来学会下载浏览器.md,sha256=v5QPSMjRDh52ZjgC4h8QjImnaqlVRLjTHGxmGjTo36g,3396
89
+ cnhkmcp/untracked/mcp文件论坛版2_如果原版启动不了浏览器就试这个/配置前运行我_安装必要依赖包.py,sha256=BnUyL5g6PaC62yEuS-8vcDSJ0oKu3k6jqQxi2jginuQ,6612
90
+ cnhkmcp-2.0.1.dist-info/licenses/LICENSE,sha256=QLxO2eNMnJQEdI_R1UV2AOD-IvuA8zVrkHWA4D9gtoc,1081
91
+ cnhkmcp-2.0.1.dist-info/METADATA,sha256=upx84eWO9H5S6iJoxJPy0jOJ3CP1W7KOoFMa-O2BlW8,5171
92
+ cnhkmcp-2.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
93
+ cnhkmcp-2.0.1.dist-info/entry_points.txt,sha256=lTQieVyIvjhSMK4fT-XwnccY-JBC1H4vVQ3V9dDM-Pc,70
94
+ cnhkmcp-2.0.1.dist-info/top_level.txt,sha256=x--ibUcSgOS9Z_RWK2Qc-vfs7DaXQN-WMaaxEETJ1Bw,8
95
+ cnhkmcp-2.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cnhkmcp = cnhkmcp.untracked.platform_functions:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 CNHK
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ cnhkmcp