siat 3.10.130__py3-none-any.whl → 3.10.132__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 (217) hide show
  1. build/lib/build/lib/siat/__init__.py +75 -0
  2. build/lib/build/lib/siat/allin.py +137 -0
  3. build/lib/build/lib/siat/assets_liquidity.py +915 -0
  4. build/lib/build/lib/siat/beta_adjustment.py +1058 -0
  5. build/lib/build/lib/siat/beta_adjustment_china.py +548 -0
  6. build/lib/build/lib/siat/blockchain.py +143 -0
  7. build/lib/build/lib/siat/bond.py +2900 -0
  8. build/lib/build/lib/siat/bond_base.py +992 -0
  9. build/lib/build/lib/siat/bond_china.py +100 -0
  10. build/lib/build/lib/siat/bond_zh_sina.py +143 -0
  11. build/lib/build/lib/siat/capm_beta.py +783 -0
  12. build/lib/build/lib/siat/capm_beta2.py +887 -0
  13. build/lib/build/lib/siat/common.py +5360 -0
  14. build/lib/build/lib/siat/compare_cross.py +642 -0
  15. build/lib/build/lib/siat/copyrights.py +18 -0
  16. build/lib/build/lib/siat/cryptocurrency.py +667 -0
  17. build/lib/build/lib/siat/economy.py +1471 -0
  18. build/lib/build/lib/siat/economy2.py +1853 -0
  19. build/lib/build/lib/siat/esg.py +536 -0
  20. build/lib/build/lib/siat/event_study.py +815 -0
  21. build/lib/build/lib/siat/fama_french.py +1521 -0
  22. build/lib/build/lib/siat/fin_stmt2_yahoo.py +982 -0
  23. build/lib/build/lib/siat/financial_base.py +1160 -0
  24. build/lib/build/lib/siat/financial_statements.py +598 -0
  25. build/lib/build/lib/siat/financials.py +2339 -0
  26. build/lib/build/lib/siat/financials2.py +1278 -0
  27. build/lib/build/lib/siat/financials_china.py +4433 -0
  28. build/lib/build/lib/siat/financials_china2.py +2212 -0
  29. build/lib/build/lib/siat/fund.py +629 -0
  30. build/lib/build/lib/siat/fund_china.py +3307 -0
  31. build/lib/build/lib/siat/future_china.py +551 -0
  32. build/lib/build/lib/siat/google_authenticator.py +47 -0
  33. build/lib/build/lib/siat/grafix.py +3636 -0
  34. build/lib/build/lib/siat/holding_risk.py +867 -0
  35. build/lib/build/lib/siat/luchy_draw.py +638 -0
  36. build/lib/build/lib/siat/market_china.py +1168 -0
  37. build/lib/build/lib/siat/markowitz.py +2363 -0
  38. build/lib/build/lib/siat/markowitz2.py +3150 -0
  39. build/lib/build/lib/siat/markowitz2_20250704.py +2969 -0
  40. build/lib/build/lib/siat/markowitz2_20250705.py +3158 -0
  41. build/lib/build/lib/siat/markowitz_simple.py +373 -0
  42. build/lib/build/lib/siat/ml_cases.py +2291 -0
  43. build/lib/build/lib/siat/ml_cases_example.py +60 -0
  44. build/lib/build/lib/siat/option_china.py +3069 -0
  45. build/lib/build/lib/siat/option_pricing.py +1925 -0
  46. build/lib/build/lib/siat/other_indexes.py +409 -0
  47. build/lib/build/lib/siat/risk_adjusted_return.py +1576 -0
  48. build/lib/build/lib/siat/risk_adjusted_return2.py +1900 -0
  49. build/lib/build/lib/siat/risk_evaluation.py +2218 -0
  50. build/lib/build/lib/siat/risk_free_rate.py +351 -0
  51. build/lib/build/lib/siat/sector_china.py +4140 -0
  52. build/lib/build/lib/siat/security_price2.py +727 -0
  53. build/lib/build/lib/siat/security_prices.py +3408 -0
  54. build/lib/build/lib/siat/security_trend.py +402 -0
  55. build/lib/build/lib/siat/security_trend2.py +646 -0
  56. build/lib/build/lib/siat/stock.py +4284 -0
  57. build/lib/build/lib/siat/stock_advice_linear.py +934 -0
  58. build/lib/build/lib/siat/stock_base.py +26 -0
  59. build/lib/build/lib/siat/stock_china.py +2095 -0
  60. build/lib/build/lib/siat/stock_prices_kneighbors.py +910 -0
  61. build/lib/build/lib/siat/stock_prices_linear.py +386 -0
  62. build/lib/build/lib/siat/stock_profile.py +707 -0
  63. build/lib/build/lib/siat/stock_technical.py +3305 -0
  64. build/lib/build/lib/siat/stooq.py +74 -0
  65. build/lib/build/lib/siat/transaction.py +347 -0
  66. build/lib/build/lib/siat/translate.py +5183 -0
  67. build/lib/build/lib/siat/valuation.py +1378 -0
  68. build/lib/build/lib/siat/valuation_china.py +2076 -0
  69. build/lib/build/lib/siat/var_model_validation.py +444 -0
  70. build/lib/build/lib/siat/yf_name.py +811 -0
  71. build/lib/siat/__init__.py +75 -0
  72. build/lib/siat/allin.py +137 -0
  73. build/lib/siat/assets_liquidity.py +915 -0
  74. build/lib/siat/beta_adjustment.py +1058 -0
  75. build/lib/siat/beta_adjustment_china.py +548 -0
  76. build/lib/siat/blockchain.py +143 -0
  77. build/lib/siat/bond.py +2900 -0
  78. build/lib/siat/bond_base.py +992 -0
  79. build/lib/siat/bond_china.py +100 -0
  80. build/lib/siat/bond_zh_sina.py +143 -0
  81. build/lib/siat/capm_beta.py +783 -0
  82. build/lib/siat/capm_beta2.py +887 -0
  83. build/lib/siat/common.py +5360 -0
  84. build/lib/siat/compare_cross.py +642 -0
  85. build/lib/siat/copyrights.py +18 -0
  86. build/lib/siat/cryptocurrency.py +667 -0
  87. build/lib/siat/economy.py +1471 -0
  88. build/lib/siat/economy2.py +1853 -0
  89. build/lib/siat/esg.py +536 -0
  90. build/lib/siat/event_study.py +815 -0
  91. build/lib/siat/fama_french.py +1521 -0
  92. build/lib/siat/fin_stmt2_yahoo.py +982 -0
  93. build/lib/siat/financial_base.py +1160 -0
  94. build/lib/siat/financial_statements.py +598 -0
  95. build/lib/siat/financials.py +2339 -0
  96. build/lib/siat/financials2.py +1278 -0
  97. build/lib/siat/financials_china.py +4433 -0
  98. build/lib/siat/financials_china2.py +2212 -0
  99. build/lib/siat/fund.py +629 -0
  100. build/lib/siat/fund_china.py +3307 -0
  101. build/lib/siat/future_china.py +551 -0
  102. build/lib/siat/google_authenticator.py +47 -0
  103. build/lib/siat/grafix.py +3636 -0
  104. build/lib/siat/holding_risk.py +867 -0
  105. build/lib/siat/luchy_draw.py +638 -0
  106. build/lib/siat/market_china.py +1168 -0
  107. build/lib/siat/markowitz.py +2363 -0
  108. build/lib/siat/markowitz2.py +3150 -0
  109. build/lib/siat/markowitz2_20250704.py +2969 -0
  110. build/lib/siat/markowitz2_20250705.py +3158 -0
  111. build/lib/siat/markowitz_simple.py +373 -0
  112. build/lib/siat/ml_cases.py +2291 -0
  113. build/lib/siat/ml_cases_example.py +60 -0
  114. build/lib/siat/option_china.py +3069 -0
  115. build/lib/siat/option_pricing.py +1925 -0
  116. build/lib/siat/other_indexes.py +409 -0
  117. build/lib/siat/risk_adjusted_return.py +1576 -0
  118. build/lib/siat/risk_adjusted_return2.py +1900 -0
  119. build/lib/siat/risk_evaluation.py +2218 -0
  120. build/lib/siat/risk_free_rate.py +351 -0
  121. build/lib/siat/sector_china.py +4140 -0
  122. build/lib/siat/security_price2.py +727 -0
  123. build/lib/siat/security_prices.py +3408 -0
  124. build/lib/siat/security_trend.py +402 -0
  125. build/lib/siat/security_trend2.py +646 -0
  126. build/lib/siat/stock.py +4284 -0
  127. build/lib/siat/stock_advice_linear.py +934 -0
  128. build/lib/siat/stock_base.py +26 -0
  129. build/lib/siat/stock_china.py +2095 -0
  130. build/lib/siat/stock_prices_kneighbors.py +910 -0
  131. build/lib/siat/stock_prices_linear.py +386 -0
  132. build/lib/siat/stock_profile.py +707 -0
  133. build/lib/siat/stock_technical.py +3305 -0
  134. build/lib/siat/stooq.py +74 -0
  135. build/lib/siat/transaction.py +347 -0
  136. build/lib/siat/translate.py +5183 -0
  137. build/lib/siat/valuation.py +1378 -0
  138. build/lib/siat/valuation_china.py +2076 -0
  139. build/lib/siat/var_model_validation.py +444 -0
  140. build/lib/siat/yf_name.py +811 -0
  141. siat/__init__.py +0 -0
  142. siat/allin.py +0 -0
  143. siat/assets_liquidity.py +0 -0
  144. siat/beta_adjustment.py +0 -0
  145. siat/beta_adjustment_china.py +0 -0
  146. siat/blockchain.py +0 -0
  147. siat/bond.py +0 -0
  148. siat/bond_base.py +0 -0
  149. siat/bond_china.py +0 -0
  150. siat/bond_zh_sina.py +0 -0
  151. siat/capm_beta.py +0 -0
  152. siat/capm_beta2.py +0 -0
  153. siat/common.py +94 -30
  154. siat/compare_cross.py +0 -0
  155. siat/copyrights.py +0 -0
  156. siat/cryptocurrency.py +0 -0
  157. siat/economy.py +0 -0
  158. siat/economy2.py +0 -0
  159. siat/esg.py +0 -0
  160. siat/event_study.py +0 -0
  161. siat/fama_french.py +0 -0
  162. siat/fin_stmt2_yahoo.py +0 -0
  163. siat/financial_base.py +0 -0
  164. siat/financial_statements.py +0 -0
  165. siat/financials.py +0 -0
  166. siat/financials2.py +0 -0
  167. siat/financials_china.py +0 -0
  168. siat/financials_china2.py +0 -0
  169. siat/fund.py +0 -0
  170. siat/fund_china.py +0 -0
  171. siat/future_china.py +0 -0
  172. siat/google_authenticator.py +0 -0
  173. siat/grafix.py +1 -1
  174. siat/holding_risk.py +0 -0
  175. siat/luchy_draw.py +0 -0
  176. siat/market_china.py +7 -1
  177. siat/markowitz.py +0 -0
  178. siat/markowitz2.py +240 -39
  179. siat/markowitz2_20250704.py +2969 -0
  180. siat/markowitz2_20250705.py +3158 -0
  181. siat/markowitz_simple.py +0 -0
  182. siat/ml_cases.py +0 -0
  183. siat/ml_cases_example.py +0 -0
  184. siat/option_china.py +0 -0
  185. siat/option_pricing.py +0 -0
  186. siat/other_indexes.py +0 -0
  187. siat/risk_adjusted_return.py +0 -0
  188. siat/risk_adjusted_return2.py +0 -0
  189. siat/risk_evaluation.py +0 -0
  190. siat/risk_free_rate.py +0 -0
  191. siat/sector_china.py +0 -0
  192. siat/security_price2.py +0 -0
  193. siat/security_prices.py +3 -1
  194. siat/security_trend.py +0 -0
  195. siat/security_trend2.py +1 -1
  196. siat/stock.py +4 -2
  197. siat/stock_advice_linear.py +0 -0
  198. siat/stock_base.py +0 -0
  199. siat/stock_china.py +0 -0
  200. siat/stock_prices_kneighbors.py +0 -0
  201. siat/stock_prices_linear.py +0 -0
  202. siat/stock_profile.py +0 -0
  203. siat/stock_technical.py +0 -0
  204. siat/stooq.py +0 -0
  205. siat/transaction.py +0 -0
  206. siat/translate.py +11 -11
  207. siat/valuation.py +0 -0
  208. siat/valuation_china.py +0 -0
  209. siat/var_model_validation.py +0 -0
  210. siat/yf_name.py +0 -0
  211. {siat-3.10.130.dist-info → siat-3.10.132.dist-info}/METADATA +11 -11
  212. siat-3.10.132.dist-info/RECORD +218 -0
  213. siat-3.10.132.dist-info/top_level.txt +4 -0
  214. siat-3.10.130.dist-info/RECORD +0 -76
  215. siat-3.10.130.dist-info/top_level.txt +0 -1
  216. {siat-3.10.130.dist-info → siat-3.10.132.dist-info}/WHEEL +0 -0
  217. {siat-3.10.130.dist-info → siat-3.10.132.dist-info}/licenses/LICENSE +0 -0
siat/__init__.py CHANGED
File without changes
siat/allin.py CHANGED
File without changes
siat/assets_liquidity.py CHANGED
File without changes
siat/beta_adjustment.py CHANGED
File without changes
File without changes
siat/blockchain.py CHANGED
File without changes
siat/bond.py CHANGED
File without changes
siat/bond_base.py CHANGED
File without changes
siat/bond_china.py CHANGED
File without changes
siat/bond_zh_sina.py CHANGED
File without changes
siat/capm_beta.py CHANGED
File without changes
siat/capm_beta2.py CHANGED
File without changes
siat/common.py CHANGED
@@ -4923,6 +4923,11 @@ if __name__ == '__main__':
4923
4923
  # 注意:上面的await命令会导致编译失败,测试后要注释掉
4924
4924
 
4925
4925
  #==============================================================================
4926
+ if __name__ == '__main__':
4927
+ # 定义 Notebook 路径和输出 PDF 路径
4928
+ notebook_dir = r"E:\北外工作-25春\SICA-BFSU\Session 2" # 替换为你的 Notebook 文件路径
4929
+ notebook_file= r"Session 2-Market index v3en" # 替换为你想保存的 PDF 文件路径
4930
+
4926
4931
  async def jupyter2pdf2(notebook_dir, notebook_file):
4927
4932
  """
4928
4933
  ===========================================================================
@@ -4947,6 +4952,8 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4947
4952
  else:
4948
4953
  sep='\\'
4949
4954
 
4955
+ #import os; sep=os.sep
4956
+
4950
4957
  # ipynb文件的完整路径
4951
4958
  if ('.ipynb' in notebook_file):
4952
4959
  notebook_file1=notebook_file.replace('.ipynb','')
@@ -4955,14 +4962,19 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4955
4962
  notebook_path=notebook_dir+sep+notebook_file1+'.ipynb'
4956
4963
 
4957
4964
  # pdf文件的完整路径
4958
- output_pdf_path1=notebook_dir+sep+notebook_file1+'A4.pdf'
4959
- output_pdf_path2=notebook_dir+sep+notebook_file1+'A3.pdf'
4965
+ output_pdf_path1=notebook_dir+sep+notebook_file1+' A4.pdf'
4966
+ output_pdf_path2=notebook_dir+sep+notebook_file1+' A3.pdf'
4960
4967
 
4961
- import os
4962
4968
  from nbconvert import HTMLExporter
4963
4969
 
4970
+ """
4971
+ import nest_asyncio
4972
+ nest_asyncio.apply() # 修复 Notebook 的事件循环问题
4973
+ """
4974
+
4964
4975
  try:
4965
4976
  from playwright.async_api import async_playwright
4977
+ #from playwright.sync_api import sync_playwright
4966
4978
  except:
4967
4979
  print(" #Warning(jupyter2pdf2): playwright seems not fully installed yet")
4968
4980
  print(" [Solution] execute the command before re-run: playwright install")
@@ -4993,17 +5005,35 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4993
5005
  await page.goto(f"file://{os.path.abspath(html_file)}")
4994
5006
 
4995
5007
  # 避免加载html文件超时,用于macOS
4996
- page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5008
+ if not sys.platform.startswith('win'):
5009
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
4997
5010
 
4998
5011
  await page.pdf(path=output_pdf_path1, format='A4')
4999
5012
  await page.pdf(path=output_pdf_path2, format='A3')
5000
5013
 
5001
5014
  await browser.close()
5002
-
5003
- print(f"2 PDF created in the same directory, pick 1 you think best")
5015
+ """
5016
+ with sync_playwright() as p:
5017
+ browser = p.chromium.launch()
5018
+ page = browser.new_page()
5019
+ page.goto(f"file://{os.path.abspath(html_file)}")
5020
+
5021
+ # 避免加载html文件超时,用于macOS
5022
+ if not sys.platform.startswith('win'):
5023
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5024
+
5025
+ page.pdf(path=output_pdf_path1, format='A4')
5026
+ page.pdf(path=output_pdf_path2, format='A3')
5027
+
5028
+ browser.close()
5029
+ """
5030
+
5031
+ print(f"2 PDFs created in the same directory, pick 1 you think best")
5004
5032
 
5005
5033
  except Exception as e:
5006
- print(f"PDF conversion failed because {e}")
5034
+ if str(e)=='':
5035
+ e="because of issues in your playwright or Python environment"
5036
+ print(f"PDF conversion failed {e}")
5007
5037
  return
5008
5038
 
5009
5039
  finally:
@@ -5022,15 +5052,18 @@ if __name__ == '__main__':
5022
5052
  notebook_file = "Session 1 全球证券市场-简化版.ipynb"
5023
5053
  #await jupyter2pdf2(notebook_dir, notebook_file)
5024
5054
  # 注意:上面的await命令会导致编译失败,测试后要注释掉
5025
-
5055
+
5026
5056
  #==============================================================================
5027
- async def jupyter2pdf3(notebook_file):
5057
+
5058
+
5059
+ async def jupyter2pdf3(notebook_path):
5028
5060
  """
5029
5061
  ===========================================================================
5030
5062
  将 Jupyter Notebook 转换为 PDF 文件,异步方式。
5031
5063
  主要参数:
5032
- notebook_file (str): Jupyter Notebook文件名,不含目录
5033
-
5064
+ notebook_path: Jupyter Notebook文件的完整路径,包括所在的目录和文件名
5065
+ 获取方法:在Jupyter Notebook中执行下列命令(仅在交互环境中工作)
5066
+ notebook_path=globals().get("__session__")
5034
5067
  输出:
5035
5068
  同时生成A4和A3两种幅面的pdf文件,由使用者自行挑选一个效果最好的。
5036
5069
  返回:
@@ -5038,14 +5071,22 @@ async def jupyter2pdf3(notebook_file):
5038
5071
 
5039
5072
  注意1:如果指令异常,可能还要执行python -m playwright install
5040
5073
  注意2:调用本函数的格式是异步await开头,例如:
5041
- await jupyter2pdf3(notebook_file)
5042
-
5043
- 注意:目前无法正确获得ipynb文件的所在目录,使用使用!!!
5074
+ await jupyter2pdf3(notebook_path)
5044
5075
  """
5045
- # 获得路径
5046
- import os
5047
- notebook_dir=os.getcwd()
5048
- # 注意:上述指令无法获取当前Jupyter文件的目录
5076
+ DEBUG=False
5077
+
5078
+ import os,sys
5079
+ # 分离目录和文件名
5080
+ notebook_dir, notebook_file = os.path.split(notebook_path)
5081
+
5082
+ if DEBUG:
5083
+ print("目录路径:", notebook_dir) # 输出:/Users/peterwang/Documents/project
5084
+ print("文件名:", notebook_file) # 输出:data.csv
5085
+
5086
+ # 如果还想拆出文件名和扩展名
5087
+ name_only, ext = os.path.splitext(notebook_file)
5088
+ print("文件名(不含扩展名):", name_only) # 输出:data
5089
+ print("扩展名:", ext) # 输出:.csv
5049
5090
 
5050
5091
  # 路径分割符号
5051
5092
  if ('/' in notebook_dir) and not ('\\' in notebook_dir):
@@ -5053,6 +5094,8 @@ async def jupyter2pdf3(notebook_file):
5053
5094
  else:
5054
5095
  sep='\\'
5055
5096
 
5097
+ #import os; sep=os.sep
5098
+
5056
5099
  # ipynb文件的完整路径
5057
5100
  if ('.ipynb' in notebook_file):
5058
5101
  notebook_file1=notebook_file.replace('.ipynb','')
@@ -5061,13 +5104,19 @@ async def jupyter2pdf3(notebook_file):
5061
5104
  notebook_path=notebook_dir+sep+notebook_file1+'.ipynb'
5062
5105
 
5063
5106
  # pdf文件的完整路径
5064
- output_pdf_path1=notebook_dir+sep+notebook_file1+'A4.pdf'
5065
- output_pdf_path2=notebook_dir+sep+notebook_file1+'A3.pdf'
5107
+ output_pdf_path1=notebook_dir+sep+notebook_file1+' A4.pdf'
5108
+ output_pdf_path2=notebook_dir+sep+notebook_file1+' A3.pdf'
5066
5109
 
5067
5110
  from nbconvert import HTMLExporter
5068
5111
 
5112
+ """
5113
+ import nest_asyncio
5114
+ nest_asyncio.apply() # 修复 Notebook 的事件循环问题
5115
+ """
5116
+
5069
5117
  try:
5070
5118
  from playwright.async_api import async_playwright
5119
+ #from playwright.sync_api import sync_playwright
5071
5120
  except:
5072
5121
  print(" #Warning(jupyter2pdf2): playwright seems not fully installed yet")
5073
5122
  print(" [Solution] execute the command before re-run: playwright install")
@@ -5080,7 +5129,7 @@ async def jupyter2pdf3(notebook_file):
5080
5129
  html_exporter = HTMLExporter()
5081
5130
  try:
5082
5131
  html_content, _ = html_exporter.from_filename(notebook_path)
5083
- print("Converting notebook file to pdf in both A4 and A3 sizes ...")
5132
+ print(f"Converting {notebook_file} to pdf ...")
5084
5133
 
5085
5134
  except:
5086
5135
  print("File not found for {}".format(notebook_path))
@@ -5097,15 +5146,36 @@ async def jupyter2pdf3(notebook_file):
5097
5146
  page = await browser.new_page()
5098
5147
  await page.goto(f"file://{os.path.abspath(html_file)}")
5099
5148
 
5149
+ # 避免加载html文件超时,用于macOS
5150
+ if not sys.platform.startswith('win'):
5151
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5152
+
5100
5153
  await page.pdf(path=output_pdf_path1, format='A4')
5101
5154
  await page.pdf(path=output_pdf_path2, format='A3')
5102
5155
 
5103
5156
  await browser.close()
5104
-
5105
- print(f"2 PDF created in the same directory, pick 1 you think best")
5157
+ """
5158
+ with sync_playwright() as p:
5159
+ browser = p.chromium.launch()
5160
+ page = browser.new_page()
5161
+ page.goto(f"file://{os.path.abspath(html_file)}")
5162
+
5163
+ # 避免加载html文件超时,用于macOS
5164
+ if not sys.platform.startswith('win'):
5165
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5166
+
5167
+ page.pdf(path=output_pdf_path1, format='A4')
5168
+ page.pdf(path=output_pdf_path2, format='A3')
5169
+
5170
+ browser.close()
5171
+ """
5172
+
5173
+ print(f"2 PDFs created in {notebook_dir}")
5106
5174
 
5107
5175
  except Exception as e:
5108
- print(f"Conversion failed because {e}")
5176
+ if str(e)=='':
5177
+ e="because of issues in your playwright or Python environment"
5178
+ print(f"PDF conversion failed {e}")
5109
5179
  return
5110
5180
 
5111
5181
  finally:
@@ -5117,12 +5187,6 @@ async def jupyter2pdf3(notebook_file):
5117
5187
 
5118
5188
  return
5119
5189
 
5120
- if __name__ == '__main__':
5121
- # 替换为你想转存PDF的Notebook文件名
5122
- file = "Session 1 全球证券市场-简化版.ipynb"
5123
- #await jupyter2pdf3(file)
5124
- # 注意:上面的await命令会导致编译失败,测试后要注释掉
5125
-
5126
5190
  #==============================================================================
5127
5191
  if __name__ == '__main__':
5128
5192
  df=security_trend("600519.SS",indicator=['Close','Open','High','Low'],graph=False)
siat/compare_cross.py CHANGED
File without changes
siat/copyrights.py CHANGED
File without changes
siat/cryptocurrency.py CHANGED
File without changes
siat/economy.py CHANGED
File without changes
siat/economy2.py CHANGED
File without changes
siat/esg.py CHANGED
File without changes
siat/event_study.py CHANGED
File without changes
siat/fama_french.py CHANGED
File without changes
siat/fin_stmt2_yahoo.py CHANGED
File without changes
siat/financial_base.py CHANGED
File without changes
File without changes
siat/financials.py CHANGED
File without changes
siat/financials2.py CHANGED
File without changes
siat/financials_china.py CHANGED
File without changes
siat/financials_china2.py CHANGED
File without changes
siat/fund.py CHANGED
File without changes
siat/fund_china.py CHANGED
File without changes
siat/future_china.py CHANGED
File without changes
File without changes
siat/grafix.py CHANGED
@@ -365,7 +365,7 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
365
365
  #av=str(round(av,2)) if av < 100 else str(int(av))
366
366
  #av=str(int(av)) if abs(av) >= 100 else str(round(av,2)) if abs(av) >= 10 else str(round(av,3))
367
367
  avstr=str(int(av)) if abs(av) >= 100 else str(round(av,2)) if abs(av) >= 10 else str(round(av,3))
368
- plt.axhline(y=av,ls="dashed",c="blueviolet",linewidth=2,label=text_lang("本期间均值","Periodic mean")+avstr)
368
+ plt.axhline(y=av,ls="dashed",c="blueviolet",linewidth=2,label=text_lang("本期间均值","Periodic mean ")+avstr)
369
369
  #footnote=footnote + ",均值"+av
370
370
  #footnote=text_lang("注:期间均值","Note: Periodic mean ")+av+"; "+footnote
371
371
 
siat/holding_risk.py CHANGED
File without changes
siat/luchy_draw.py CHANGED
File without changes
siat/market_china.py CHANGED
@@ -442,6 +442,12 @@ def market_detail_exchange_china(exchange='SSE',category='price'):
442
442
  except:
443
443
  print(" #Error(market_detail_exchange_china): info unavailable for",exchange,"\b, try again later")
444
444
  return None
445
+
446
+ # 检查东方财富抓取限制
447
+ if len(df0) <= 100:
448
+ print(" #Warning(market_detail_exchange_china): web scraping restricted to 100 records by data source")
449
+ print(" Solution: upgrade akshare (pip install akshare --upgrade), restart Python kernel, run again")
450
+ return None
445
451
 
446
452
  #DEBUG
447
453
  #print(" Check1:",len(df0))
@@ -1003,7 +1009,7 @@ def market_detail_china2(category='price',
1003
1009
  ft4=heading+text_lang("☆涨速:平均每分钟股价变化率,表示股价变化速度\n","*Changing speed(涨速): rate of changes per minute\n")
1004
1010
  ft5=heading+text_lang("☆5分钟涨跌:最新5分钟内股价的涨跌幅度\n","*5 min up-down(5分钟涨跌): changes recent 5 minutes\n")
1005
1011
  ft6=heading+text_lang("☆振幅:最高最低价差绝对值/昨收,表示股价变化活跃程度\n","*Amplitude(振幅): (High - Low)/Prev Close\n")
1006
- ft7=heading+text_lang("☆涨跌幅:(最新价-昨收)/昨收,表示相对昨日的变化程度\n","*Change%(涨跌幅): (Current Price/Prev Close - 1\n")
1012
+ ft7=heading+text_lang("☆涨跌幅:(最新价-昨收)/昨收,表示相对昨日的变化程度\n","*Change%(涨跌幅): (Current Price/Prev Close) - 1\n")
1007
1013
  ft8=heading+text_lang("☆涨跌额:最新价-昨收,表示相对昨日的变化金额\n","*Change(涨跌额): Current Price - Prev Close\n")
1008
1014
 
1009
1015
  ft9=heading+text_lang("☆使用实时数据,不同日期/每天不同时刻统计的结果可能不同\n","*Based on real-time data, vary with time\n")
siat/markowitz.py CHANGED
File without changes