cnhkmcp 2.0.2__tar.gz → 2.0.3__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 (103) hide show
  1. {cnhkmcp-2.0.2/cnhkmcp.egg-info → cnhkmcp-2.0.3}/PKG-INFO +1 -1
  2. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/ace_lib.py +30 -9
  3. {cnhkmcp-2.0.2/cnhkmcp/untracked/APP/give_me_idea → cnhkmcp-2.0.3/cnhkmcp/untracked/APP}/ace_lib.py +30 -9
  4. {cnhkmcp-2.0.2/cnhkmcp/untracked/APP → cnhkmcp-2.0.3/cnhkmcp/untracked/APP/give_me_idea}/ace_lib.py +30 -9
  5. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +5 -1
  6. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/ace_lib.py +30 -9
  7. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP//347/274/230/345/210/206/344/270/200/351/201/223/346/241/245/ace_lib.py +30 -9
  8. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP//350/277/220/350/241/214/346/211/223/345/274/200/346/210/221.py +2 -1
  9. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3/cnhkmcp.egg-info}/PKG-INFO +1 -1
  10. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/setup.py +1 -1
  11. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/LICENSE +0 -0
  12. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/MANIFEST.in +0 -0
  13. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/README.md +0 -0
  14. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/__init__.py +0 -0
  15. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/.gitignore +0 -0
  16. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md +0 -0
  17. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/README.md +0 -0
  18. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/Transformer.py +0 -0
  19. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/ace.log +0 -0
  20. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/helpful_functions.py +0 -0
  21. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json +0 -0
  22. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_/347/244/272/344/276/213.json" +0 -0
  23. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json +0 -0
  24. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json +0 -0
  25. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_/347/244/272/344/276/213/345/217/257/347/233/264/346/216/245/350/275/275/345/205/245Machine_lib.json" +0 -0
  26. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/parsetab.py +0 -0
  27. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/template_summary.txt +0 -0
  28. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/transformer_config.json +0 -0
  29. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/Tranformer/validator.py +0 -0
  30. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/ace.log +0 -0
  31. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/blueprints/__init__.py +0 -0
  32. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/blueprints/feature_engineering.py +0 -0
  33. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/blueprints/idea_house.py +0 -0
  34. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/blueprints/inspiration_house.py +0 -0
  35. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/blueprints/paper_analysis.py +0 -0
  36. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/custom_templates/templates.json +0 -0
  37. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +0 -0
  38. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py +0 -0
  39. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +0 -0
  40. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/helpful_functions.py +0 -0
  41. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/ace.log +0 -0
  42. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/autosim_20251205_145240.log +0 -0
  43. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/autosim_20251215_030103.log +0 -0
  44. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/autosimulator.py +0 -0
  45. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py +0 -0
  46. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/mirror_config.txt +0 -0
  47. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/operaters.csv +0 -0
  48. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/requirements.txt +0 -0
  49. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/run_app.bat +0 -0
  50. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/run_app.sh +0 -0
  51. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/setup_tsinghua.bat +0 -0
  52. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/setup_tsinghua.sh +0 -0
  53. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/simulator/alpha_submitter.py +0 -0
  54. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/simulator/simulator_wqb.py +0 -0
  55. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/ssrn-3332513.pdf +0 -0
  56. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/brain.js +0 -0
  57. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/decoder.js +0 -0
  58. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/feature_engineering.js +0 -0
  59. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/idea_house.js +0 -0
  60. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/inspiration.js +0 -0
  61. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/inspiration_house.js +0 -0
  62. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/paper_analysis.js +0 -0
  63. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/script.js +0 -0
  64. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/simulator.js +0 -0
  65. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/styles.css +0 -0
  66. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/static/usage_widget.js +0 -0
  67. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/alpha_inspector.html +0 -0
  68. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/feature_engineering.html +0 -0
  69. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/idea_house.html +0 -0
  70. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/index.html +0 -0
  71. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/inspiration_house.html +0 -0
  72. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/paper_analysis.html +0 -0
  73. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/simulator.html +0 -0
  74. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/templates/transformer_web.html +0 -0
  75. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP/usage.md +0 -0
  76. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP//347/274/230/345/210/206/344/270/200/351/201/223/346/241/245/brain_alpha_inspector.py" +0 -0
  77. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/APP//347/274/230/345/210/206/344/270/200/351/201/223/346/241/245/helpful_functions.py" +0 -0
  78. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/arXiv_API_Tool_Manual.md +0 -0
  79. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/arxiv_api.py +0 -0
  80. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/forum_functions.py +0 -0
  81. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/mcp/346/226/207/344/273/266/350/256/272/345/235/233/347/211/2102_/345/246/202/346/236/234/345/216/237/347/211/210/345/220/257/345/212/250/344/270/215/344/272/206/346/265/217/350/247/210/345/231/250/345/260/261/350/257/225/350/277/231/344/270/252/forum_functions.py" +0 -0
  82. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/mcp/346/226/207/344/273/266/350/256/272/345/235/233/347/211/2102_/345/246/202/346/236/234/345/216/237/347/211/210/345/220/257/345/212/250/344/270/215/344/272/206/346/265/217/350/247/210/345/231/250/345/260/261/350/257/225/350/277/231/344/270/252/platform_functions.py" +0 -0
  83. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/mcp/346/226/207/344/273/266/350/256/272/345/235/233/347/211/2102_/345/246/202/346/236/234/345/216/237/347/211/210/345/220/257/345/212/250/344/270/215/344/272/206/346/265/217/350/247/210/345/231/250/345/260/261/350/257/225/350/277/231/344/270/252/user_config.json" +0 -0
  84. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/mcp/346/226/207/344/273/266/350/256/272/345/235/233/347/211/2102_/345/246/202/346/236/234/345/216/237/347/211/210/345/220/257/345/212/250/344/270/215/344/272/206/346/265/217/350/247/210/345/231/250/345/260/261/350/257/225/350/277/231/344/270/252//350/256/251AI/350/257/273/350/277/231/344/270/252/346/226/207/346/241/243/346/235/245/345/255/246/344/274/232/344/270/213/350/275/275/346/265/217/350/247/210/345/231/250.md" +0 -0
  85. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/mcp/346/226/207/344/273/266/350/256/272/345/235/233/347/211/2102_/345/246/202/346/236/234/345/216/237/347/211/210/345/220/257/345/212/250/344/270/215/344/272/206/346/265/217/350/247/210/345/231/250/345/260/261/350/257/225/350/277/231/344/270/252//351/205/215/347/275/256/345/211/215/350/277/220/350/241/214/346/210/221_/345/256/211/350/243/205/345/277/205/350/246/201/344/276/235/350/265/226/345/214/205.py" +0 -0
  86. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/platform_functions.py +0 -0
  87. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/sample_mcp_config.json +0 -0
  88. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked/user_config.json +0 -0
  89. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/217/202/350/200/203/346/226/207/346/241/243_BRAIN_Alpha_Test_Requirements_and_Tips.md" +0 -0
  90. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/267/245/344/275/234/346/265/201_Alpha_explaination_workflow.md" +0 -0
  91. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/267/245/344/275/234/346/265/201_BRAIN_6_Tips_Datafield_Exploration_Guide.md" +0 -0
  92. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/267/245/344/275/234/346/265/201_BRAIN_Alpha_Improvement_Workflow.md" +0 -0
  93. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/267/245/344/275/234/346/265/201_Dataset_Exploration_Expert_Manual.md" +0 -0
  94. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//347/244/272/344/276/213/345/267/245/344/275/234/346/265/201_daily_report_workflow.md" +0 -0
  95. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp/untracked//351/205/215/347/275/256/345/211/215/350/277/220/350/241/214/346/210/221_/345/256/211/350/243/205/345/277/205/350/246/201/344/276/235/350/265/226/345/214/205.py" +0 -0
  96. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/SOURCES.txt +0 -0
  97. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/dependency_links.txt +0 -0
  98. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/entry_points.txt +0 -0
  99. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/not-zip-safe +0 -0
  100. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/requires.txt +0 -0
  101. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/cnhkmcp.egg-info/top_level.txt +0 -0
  102. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/requirements.txt +0 -0
  103. {cnhkmcp-2.0.2 → cnhkmcp-2.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
5
5
  Home-page: https://github.com/cnhk/cnhkmcp
6
6
  Author: CNHK
@@ -1134,7 +1134,7 @@ def get_datasets(
1134
1134
  region: str = "USA",
1135
1135
  delay: int = 1,
1136
1136
  universe: str = "TOP3000",
1137
- theme: str = "false",
1137
+ theme: str = "ALL",
1138
1138
  ) -> pd.DataFrame:
1139
1139
  """
1140
1140
  Retrieve available datasets based on specified parameters.
@@ -1145,18 +1145,39 @@ def get_datasets(
1145
1145
  region (str, optional): The region. Defaults to "USA".
1146
1146
  delay (int, optional): The delay. Defaults to 1.
1147
1147
  universe (str, optional): The universe. Defaults to "TOP3000".
1148
- theme (str, optional): The theme. Defaults to "false".
1148
+ theme (str, optional): The theme. Defaults to "ALL".
1149
1149
 
1150
1150
  Returns:
1151
1151
  pandas.DataFrame: A DataFrame containing information about available datasets.
1152
1152
  """
1153
- url = (
1154
- brain_api_url
1155
- + "/data-sets?"
1156
- + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1157
- )
1158
- result = s.get(url)
1159
- datasets_df = pd.DataFrame(result.json()["results"])
1153
+ if theme == "ALL":
1154
+ # Fetch both theme=false and theme=true
1155
+ url_false = (
1156
+ brain_api_url
1157
+ + "/data-sets?"
1158
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=false"
1159
+ )
1160
+ result_false = s.get(url_false)
1161
+ df_false = pd.DataFrame(result_false.json()["results"])
1162
+
1163
+ url_true = (
1164
+ brain_api_url
1165
+ + "/data-sets?"
1166
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=true"
1167
+ )
1168
+ result_true = s.get(url_true)
1169
+ df_true = pd.DataFrame(result_true.json()["results"])
1170
+
1171
+ datasets_df = pd.concat([df_false, df_true], ignore_index=True)
1172
+ else:
1173
+ url = (
1174
+ brain_api_url
1175
+ + "/data-sets?"
1176
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1177
+ )
1178
+ result = s.get(url)
1179
+ datasets_df = pd.DataFrame(result.json()["results"])
1180
+
1160
1181
  datasets_df = expand_dict_columns(datasets_df)
1161
1182
  return datasets_df
1162
1183
 
@@ -1134,7 +1134,7 @@ def get_datasets(
1134
1134
  region: str = "USA",
1135
1135
  delay: int = 1,
1136
1136
  universe: str = "TOP3000",
1137
- theme: str = "false",
1137
+ theme: str = "ALL",
1138
1138
  ) -> pd.DataFrame:
1139
1139
  """
1140
1140
  Retrieve available datasets based on specified parameters.
@@ -1145,18 +1145,39 @@ def get_datasets(
1145
1145
  region (str, optional): The region. Defaults to "USA".
1146
1146
  delay (int, optional): The delay. Defaults to 1.
1147
1147
  universe (str, optional): The universe. Defaults to "TOP3000".
1148
- theme (str, optional): The theme. Defaults to "false".
1148
+ theme (str, optional): The theme. Defaults to "ALL".
1149
1149
 
1150
1150
  Returns:
1151
1151
  pandas.DataFrame: A DataFrame containing information about available datasets.
1152
1152
  """
1153
- url = (
1154
- brain_api_url
1155
- + "/data-sets?"
1156
- + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1157
- )
1158
- result = s.get(url)
1159
- datasets_df = pd.DataFrame(result.json()["results"])
1153
+ if theme == "ALL":
1154
+ # Fetch both theme=false and theme=true
1155
+ url_false = (
1156
+ brain_api_url
1157
+ + "/data-sets?"
1158
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=false"
1159
+ )
1160
+ result_false = s.get(url_false)
1161
+ df_false = pd.DataFrame(result_false.json()["results"])
1162
+
1163
+ url_true = (
1164
+ brain_api_url
1165
+ + "/data-sets?"
1166
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=true"
1167
+ )
1168
+ result_true = s.get(url_true)
1169
+ df_true = pd.DataFrame(result_true.json()["results"])
1170
+
1171
+ datasets_df = pd.concat([df_false, df_true], ignore_index=True)
1172
+ else:
1173
+ url = (
1174
+ brain_api_url
1175
+ + "/data-sets?"
1176
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1177
+ )
1178
+ result = s.get(url)
1179
+ datasets_df = pd.DataFrame(result.json()["results"])
1180
+
1160
1181
  datasets_df = expand_dict_columns(datasets_df)
1161
1182
  return datasets_df
1162
1183
 
@@ -1134,7 +1134,7 @@ def get_datasets(
1134
1134
  region: str = "USA",
1135
1135
  delay: int = 1,
1136
1136
  universe: str = "TOP3000",
1137
- theme: str = "false",
1137
+ theme: str = "ALL",
1138
1138
  ) -> pd.DataFrame:
1139
1139
  """
1140
1140
  Retrieve available datasets based on specified parameters.
@@ -1145,18 +1145,39 @@ def get_datasets(
1145
1145
  region (str, optional): The region. Defaults to "USA".
1146
1146
  delay (int, optional): The delay. Defaults to 1.
1147
1147
  universe (str, optional): The universe. Defaults to "TOP3000".
1148
- theme (str, optional): The theme. Defaults to "false".
1148
+ theme (str, optional): The theme. Defaults to "ALL".
1149
1149
 
1150
1150
  Returns:
1151
1151
  pandas.DataFrame: A DataFrame containing information about available datasets.
1152
1152
  """
1153
- url = (
1154
- brain_api_url
1155
- + "/data-sets?"
1156
- + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1157
- )
1158
- result = s.get(url)
1159
- datasets_df = pd.DataFrame(result.json()["results"])
1153
+ if theme == "ALL":
1154
+ # Fetch both theme=false and theme=true
1155
+ url_false = (
1156
+ brain_api_url
1157
+ + "/data-sets?"
1158
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=false"
1159
+ )
1160
+ result_false = s.get(url_false)
1161
+ df_false = pd.DataFrame(result_false.json()["results"])
1162
+
1163
+ url_true = (
1164
+ brain_api_url
1165
+ + "/data-sets?"
1166
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=true"
1167
+ )
1168
+ result_true = s.get(url_true)
1169
+ df_true = pd.DataFrame(result_true.json()["results"])
1170
+
1171
+ datasets_df = pd.concat([df_false, df_true], ignore_index=True)
1172
+ else:
1173
+ url = (
1174
+ brain_api_url
1175
+ + "/data-sets?"
1176
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1177
+ )
1178
+ result = s.get(url)
1179
+ datasets_df = pd.DataFrame(result.json()["results"])
1180
+
1160
1181
  datasets_df = expand_dict_columns(datasets_df)
1161
1182
  return datasets_df
1162
1183
 
@@ -189,7 +189,11 @@ def main():
189
189
  universe=universe
190
190
  )
191
191
  print(f"Retrieved {len(datasets_df)} datasets.")
192
- print(datasets_df[['id', 'name', 'category', 'subcategory']].head(10))
192
+ # print(datasets_df[['id', 'name', 'category', 'subcategory']].head(10))
193
+
194
+ # Print all datasets for user selection
195
+ pd.set_option('display.max_rows', None)
196
+ print(datasets_df[['id', 'name', 'category', 'subcategory']])
193
197
  except Exception as e:
194
198
  print(f"Failed to get datasets: {e}")
195
199
  return
@@ -1143,7 +1143,7 @@ def get_datasets(
1143
1143
  region: str = "USA",
1144
1144
  delay: int = 1,
1145
1145
  universe: str = "TOP3000",
1146
- theme: str = "false",
1146
+ theme: str = "ALL",
1147
1147
  ) -> pd.DataFrame:
1148
1148
  """
1149
1149
  Retrieve available datasets based on specified parameters.
@@ -1154,18 +1154,39 @@ def get_datasets(
1154
1154
  region (str, optional): The region. Defaults to "USA".
1155
1155
  delay (int, optional): The delay. Defaults to 1.
1156
1156
  universe (str, optional): The universe. Defaults to "TOP3000".
1157
- theme (str, optional): The theme. Defaults to "false".
1157
+ theme (str, optional): The theme. Defaults to "ALL".
1158
1158
 
1159
1159
  Returns:
1160
1160
  pandas.DataFrame: A DataFrame containing information about available datasets.
1161
1161
  """
1162
- url = (
1163
- brain_api_url
1164
- + "/data-sets?"
1165
- + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1166
- )
1167
- result = s.get(url)
1168
- datasets_df = pd.DataFrame(result.json()["results"])
1162
+ if theme == "ALL":
1163
+ # Fetch both theme=false and theme=true
1164
+ url_false = (
1165
+ brain_api_url
1166
+ + "/data-sets?"
1167
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=false"
1168
+ )
1169
+ result_false = s.get(url_false)
1170
+ df_false = pd.DataFrame(result_false.json()["results"])
1171
+
1172
+ url_true = (
1173
+ brain_api_url
1174
+ + "/data-sets?"
1175
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=true"
1176
+ )
1177
+ result_true = s.get(url_true)
1178
+ df_true = pd.DataFrame(result_true.json()["results"])
1179
+
1180
+ datasets_df = pd.concat([df_false, df_true], ignore_index=True)
1181
+ else:
1182
+ url = (
1183
+ brain_api_url
1184
+ + "/data-sets?"
1185
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1186
+ )
1187
+ result = s.get(url)
1188
+ datasets_df = pd.DataFrame(result.json()["results"])
1189
+
1169
1190
  datasets_df = expand_dict_columns(datasets_df)
1170
1191
  return datasets_df
1171
1192
 
@@ -1134,7 +1134,7 @@ def get_datasets(
1134
1134
  region: str = "USA",
1135
1135
  delay: int = 1,
1136
1136
  universe: str = "TOP3000",
1137
- theme: str = "false",
1137
+ theme: str = "ALL",
1138
1138
  ) -> pd.DataFrame:
1139
1139
  """
1140
1140
  Retrieve available datasets based on specified parameters.
@@ -1145,18 +1145,39 @@ def get_datasets(
1145
1145
  region (str, optional): The region. Defaults to "USA".
1146
1146
  delay (int, optional): The delay. Defaults to 1.
1147
1147
  universe (str, optional): The universe. Defaults to "TOP3000".
1148
- theme (str, optional): The theme. Defaults to "false".
1148
+ theme (str, optional): The theme. Defaults to "ALL".
1149
1149
 
1150
1150
  Returns:
1151
1151
  pandas.DataFrame: A DataFrame containing information about available datasets.
1152
1152
  """
1153
- url = (
1154
- brain_api_url
1155
- + "/data-sets?"
1156
- + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1157
- )
1158
- result = s.get(url)
1159
- datasets_df = pd.DataFrame(result.json()["results"])
1153
+ if theme == "ALL":
1154
+ # Fetch both theme=false and theme=true
1155
+ url_false = (
1156
+ brain_api_url
1157
+ + "/data-sets?"
1158
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=false"
1159
+ )
1160
+ result_false = s.get(url_false)
1161
+ df_false = pd.DataFrame(result_false.json()["results"])
1162
+
1163
+ url_true = (
1164
+ brain_api_url
1165
+ + "/data-sets?"
1166
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme=true"
1167
+ )
1168
+ result_true = s.get(url_true)
1169
+ df_true = pd.DataFrame(result_true.json()["results"])
1170
+
1171
+ datasets_df = pd.concat([df_false, df_true], ignore_index=True)
1172
+ else:
1173
+ url = (
1174
+ brain_api_url
1175
+ + "/data-sets?"
1176
+ + f"instrumentType={instrument_type}&region={region}&delay={str(delay)}&universe={universe}&theme={theme}"
1177
+ )
1178
+ result = s.get(url)
1179
+ datasets_df = pd.DataFrame(result.json()["results"])
1180
+
1160
1181
  datasets_df = expand_dict_columns(datasets_df)
1161
1182
  return datasets_df
1162
1183
 
@@ -2253,7 +2253,8 @@ def inspiration_datasets():
2253
2253
  )
2254
2254
  df = df[mask]
2255
2255
 
2256
- results = df.head(50).to_dict(orient='records')
2256
+ # Return all results instead of limiting to 50
2257
+ results = df.to_dict(orient='records')
2257
2258
  return jsonify(results)
2258
2259
  except Exception as e:
2259
2260
  return jsonify({'error': str(e)}), 500
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cnhkmcp
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration
5
5
  Home-page: https://github.com/cnhk/cnhkmcp
6
6
  Author: CNHK
@@ -13,7 +13,7 @@ def read_requirements():
13
13
 
14
14
  setup(
15
15
  name="cnhkmcp",
16
- version="2.0.2",
16
+ version="2.0.3",
17
17
  author="CNHK",
18
18
  author_email="cnhk@example.com",
19
19
  description="A comprehensive Model Context Protocol (MCP) server for quantitative trading platform integration",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes