siat 3.9.20__py3-none-any.whl → 3.9.22__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.
siat/financials2.py CHANGED
@@ -124,7 +124,7 @@ def fs_analysis(tickers,fsdates=[],analysis_type='balance sheet', \
124
124
  可为基本信息'profile'、高管概况('officers')、分红('dividend')、股票分拆('split')、市场表现('market')、
125
125
  财务状况('financial')、一般风险('risk')、ESG风险('esg')
126
126
 
127
- business_period:业务期间类型,可为季报'quarterly',年报'annual'、最近的6次报告'recent', 所有'all'
127
+ business_period:业务期间类型,可为季报'quarterly',默认年报'annual'、最近的6次报告'recent', 所有'all'
128
128
  scale1:仅用于杜邦分析,放大倍数(以便缩小与EM之间的数量级差异),用于Profit Margin,默认10
129
129
  scale2:仅用于杜邦分析,放大倍数,用于Total Asset Turnover,默认10
130
130
  dupont_sort:仅用于杜邦分析,用于排序指标,默认净利润率'PM',还可为总资产周转率'TAT'或权益乘数'EM'
@@ -302,8 +302,9 @@ def fs_analysis(tickers,fsdates=[],analysis_type='balance sheet', \
302
302
  fsdf4=fsdf3[fsdf3['periodType']=='Quarterly']
303
303
  elif business_period == 'annual':
304
304
  fsdf4=fsdf3[fsdf3['periodType']=='Annual']
305
- else:
306
- fsdf4=fsdf3[fsdf3['periodType']=='Annual']
305
+ else: #'all'
306
+ #fsdf4=fsdf3[fsdf3['periodType'].isin(['Annual','Quarterly'])]
307
+ fsdf4=fsdf3
307
308
 
308
309
  # 转置
309
310
  fsdf4=fsdf4.T
@@ -593,8 +594,10 @@ def fs_analysis(tickers,fsdates=[],analysis_type='balance sheet', \
593
594
  fsdf4=fsdf3[fsdf3['periodType']=='Annual']
594
595
  elif business_period == 'all':
595
596
  fsdf4=fsdf3
597
+ #fsdf4=fsdf3[fsdf3['periodType'].isin(['Annual','Quarterly'])]
596
598
  else:
597
- fsdf4=fsdf3[fsdf3['periodType']=='Annual']
599
+ #fsdf4=fsdf3[fsdf3['periodType']=='Annual']
600
+ fsdf4=fsdf3
598
601
 
599
602
  # 转置
600
603
  fsdf4=fsdf4.T
@@ -638,6 +641,7 @@ def fs_analysis(tickers,fsdates=[],analysis_type='balance sheet', \
638
641
  dftmp=get_financial_rates(t)
639
642
  if dftmp is None:
640
643
  print(" #Warning(fs_analysis): financial info unaccessible for",t)
644
+ print(f" Solution: make sure {t} is correct, try again later")
641
645
  return None
642
646
 
643
647
  if business_period=='recent':
@@ -803,8 +807,10 @@ def fs_analysis(tickers,fsdates=[],analysis_type='balance sheet', \
803
807
  fsdf4=fsdf3[fsdf3['periodType']=='Annual']
804
808
  elif business_period == 'all':
805
809
  fsdf4=fsdf3
810
+ #fsdf4=fsdf3[fsdf3['periodType'].isin(['Annual','Quarterly'])]
806
811
  else:
807
- fsdf4=fsdf3[fsdf3['periodType']=='Annual']
812
+ #fsdf4=fsdf3[fsdf3['periodType']=='Annual']
813
+ fsdf4=fsdf3
808
814
 
809
815
  # 转置
810
816
  fsdf4=fsdf4.T
siat/grafix.py CHANGED
@@ -331,7 +331,11 @@ def plot_line(df0,colname,collabel,ylabeltxt,titletxt,footnote,datatag=False, \
331
331
  atpd=at
332
332
 
333
333
  if DEBUG: print(f"atpd={atpd}")
334
- at_str=atpd.strftime('%Y-%m-%d')
334
+
335
+ try:
336
+ at_str=atpd.strftime('%Y-%m-%d')
337
+ except:
338
+ at_str=atpd
335
339
  #plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
336
340
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
337
341
 
@@ -724,8 +728,11 @@ def plot_line2_coaxial(df01,ticker1,colname1,label1, \
724
728
 
725
729
  if DEBUG:
726
730
  print("atpd=",atpd)
727
-
728
- at_str=atpd.strftime('%Y-%m-%d')
731
+
732
+ try:
733
+ at_str=atpd.strftime('%Y-%m-%d')
734
+ except:
735
+ at_str=atpd
729
736
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
730
737
 
731
738
  if not attention_point_area=='':
@@ -995,8 +1002,11 @@ def plot_line2_coaxial2(df01,ticker1,colname1,label1, \
995
1002
 
996
1003
  if DEBUG:
997
1004
  print("atpd=",atpd)
998
-
999
- at_str=atpd.strftime('%Y-%m-%d')
1005
+
1006
+ try:
1007
+ at_str=atpd.strftime('%Y-%m-%d')
1008
+ except:
1009
+ at_str=atpd
1000
1010
  #plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
1001
1011
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
1002
1012
 
@@ -1212,8 +1222,11 @@ def plot_line2_twinx(df01,ticker1,colname1,label1, \
1212
1222
  atpd=pd.to_datetime(at)
1213
1223
  except:
1214
1224
  atpd=at
1215
-
1216
- at_str=atpd.strftime('%Y-%m-%d')
1225
+
1226
+ try:
1227
+ at_str=atpd.strftime('%Y-%m-%d')
1228
+ except:
1229
+ at_str=atpd
1217
1230
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
1218
1231
 
1219
1232
  if not attention_point_area=='':
@@ -1463,7 +1476,10 @@ def plot_line2_LR(df01,ticker1,colname1,label1, \
1463
1476
  except:
1464
1477
  atpd=at
1465
1478
 
1466
- at_str=atpd.strftime('%Y-%m-%d')
1479
+ try:
1480
+ at_str=atpd.strftime('%Y-%m-%d')
1481
+ except:
1482
+ at_str=atpd
1467
1483
  #ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
1468
1484
  ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
1469
1485
 
@@ -1709,7 +1725,10 @@ def plot_line2_UD(df01,ticker1,colname1,label1, \
1709
1725
  except:
1710
1726
  atpd=at
1711
1727
 
1712
- at_str=atpd.strftime('%Y-%m-%d')
1728
+ try:
1729
+ at_str=atpd.strftime('%Y-%m-%d')
1730
+ except:
1731
+ at_str=atpd
1713
1732
  #ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
1714
1733
  ax.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
1715
1734
 
@@ -1952,7 +1971,10 @@ def plot_line2_twinx2(df01,ticker1,colname1,label1, \
1952
1971
  except:
1953
1972
  atpd=at
1954
1973
 
1955
- at_str=atpd.strftime('%Y-%m-%d')
1974
+ try:
1975
+ at_str=atpd.strftime('%Y-%m-%d')
1976
+ except:
1977
+ at_str=atpd
1956
1978
  #plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
1957
1979
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
1958
1980
 
@@ -2422,7 +2444,11 @@ def draw_lines(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
2422
2444
  plt.arrow(atpd,yaxis_min,arrow_dx,arrow_dy,ls=':',lw=2,fc=color,ec=color,alpha=0.5,shape='full', \
2423
2445
  width=0.05,length_includes_head=True)
2424
2446
  """
2425
- at_str=atpd.strftime('%Y-%m-%d')
2447
+
2448
+ try:
2449
+ at_str=atpd.strftime('%Y-%m-%d')
2450
+ except:
2451
+ at_str=atpd
2426
2452
  #plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
2427
2453
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
2428
2454
 
@@ -2801,7 +2827,11 @@ def draw_lines2(df0,y_label,x_label,axhline_value,axhline_label,title_txt, \
2801
2827
  except:
2802
2828
  atpd=at
2803
2829
 
2804
- at_str=atpd.strftime('%Y-%m-%d')
2830
+ try:
2831
+ at_str=atpd.strftime('%Y-%m-%d')
2832
+ except:
2833
+ at_str=atpd
2834
+
2805
2835
  #plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+str(at))
2806
2836
  plt.axvline(x=atpd,ls=":",c=color,linewidth=1.5,label=text_lang("关注点","Attention point ")+at_str)
2807
2837
 
siat/stock.py CHANGED
@@ -127,7 +127,7 @@ def get_profile(ticker):
127
127
  dic=tp.info
128
128
  except:
129
129
  print(f" #Error(get_profile): failed to retrieve info for {ticker}")
130
- print(" Solution: need access to Yahoo")
130
+ print(" Solution: try get_stock_profile instead")
131
131
  return None
132
132
 
133
133
  if dic is None:
@@ -3542,6 +3542,7 @@ def get_stock_profile(ticker,info_type='basic',printout=True):
3542
3542
  return None
3543
3543
  if info is None:
3544
3544
  print(" #Error(get_stock_profile): retrieved none info of",ticker)
3545
+ print(f" Solution: if {ticker} is correct, try again later!")
3545
3546
  return None
3546
3547
  if len(info) == 0:
3547
3548
  print(" #Error(get_stock_profile): retrieved empty info of",ticker)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: siat
3
- Version: 3.9.20
3
+ Version: 3.9.22
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -44,7 +44,7 @@ siat/financial_statements.py,sha256=xx0SMpFqAMKm6cj8uYeG2RpJE6G-RoJ3NWa33UyaVMk,
44
44
  siat/financial_statements_test.py,sha256=FLhx8JD-tVVWSBGux6AMz1jioXX4U4bp9DmgFHYXb_w,716
45
45
  siat/financials.py,sha256=hcXcwozYhfMtW6cTE2bDp5R80-IEKAyUHFO6mJ87GXQ,86267
46
46
  siat/financials2 - 副本.py,sha256=dKlNjIfKeoSy055fQ6E6TUj9HEoO5Ney9grD84J5kfk,14389
47
- siat/financials2.py,sha256=YF-A-5iSTzLXTFI0sDGju4_6T87wWC9IlFd4fSXbJXw,50805
47
+ siat/financials2.py,sha256=Yp2ffv3vc7zFwnJhYljWXbuyOANDpsW5btXjUdMkbB8,51177
48
48
  siat/financials_china.py,sha256=iHF3lEESTK9DLWLBHFpyxn3S_dO2sNBE89xqaVYpNCw,192459
49
49
  siat/financials_china2.py,sha256=VvkzkjZeH84zwypR7ReldgJeZ7jnNw0qkzebvWMPm10,94956
50
50
  siat/financials_china2_test.py,sha256=Erz5k4LyOplBBvYls2MypuqHpVNJ3daiLdyeJezNPu0,2722
@@ -64,7 +64,7 @@ siat/future_china.py,sha256=F-HsIf2Op8Z22RzTjet1g8COzldgnMjFNSXsAkeGyWo,17595
64
64
  siat/future_china_test.py,sha256=BrSzmDVaOHki6rntOtosmRn-6dkfOBuLulJNqh7MOpc,1163
65
65
  siat/global_index_test.py,sha256=hnFp3wqqzzL-kAP8mgxDZ54Bd5Ijf6ENi5YJlGBgcXw,2402
66
66
  siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,1637
67
- siat/grafix.py,sha256=8aL8z5TF963T7GgW62iNL5h5P_HA_AxAVxmBJK3Os28,141240
67
+ siat/grafix.py,sha256=z5XaWWxAaPWje8zXfFJoHHgRtAHUfFCyzQRtdU3NdSw,142074
68
68
  siat/grafix_test.py,sha256=kXvcpLgQNO7wd30g_bWljLj5UH7bIVI0_dUtXbfiKR0,3150
69
69
  siat/holding_risk.py,sha256=uWRtMMJqKr-puQn26g6Fq5N3mFB70c0B99zLQug8hAo,30774
70
70
  siat/holding_risk_test.py,sha256=FRlw_9wFG98BYcg_cSj95HX5WZ1TvkGaOUdXD7-V86s,474
@@ -110,7 +110,7 @@ siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmW
110
110
  siat/security_trend2.py,sha256=8-Z-PWaX8fjnyAyfxEp3qXdVllgDpRISOASKEn7Zeoc,30706
111
111
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
112
112
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
113
- siat/stock.py,sha256=itQquZpB8B086nmzzGadppGKsTE6Y7aGizhamGIXs0I,159860
113
+ siat/stock.py,sha256=ixl9NWhFS-z9cQUnBOaQ_u2gqsCiG02zZZrLVBSqPwQ,159941
114
114
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
115
115
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
116
116
  siat/stock_china.py,sha256=85Ggb21E2mrCYMdSSTTrkoyyLGXMK2V-BtlweHomSRg,93460
@@ -145,8 +145,8 @@ siat/valuation_china.py,sha256=eSKIDckyjG8QkENlW_OKkqbQHno8pzDcomBO9iGNJVM,83079
145
145
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
146
146
  siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
147
147
  siat/yf_name.py,sha256=laNKMTZ9hdenGX3IZ7G0a2RLBKEWtUQJFY9CWuk_fp8,24058
148
- siat-3.9.20.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
149
- siat-3.9.20.dist-info/METADATA,sha256=wXBJpcdrfc32c2wyhu8u4dtuP00jFsatoIMwUw3vVJQ,8396
150
- siat-3.9.20.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
151
- siat-3.9.20.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
152
- siat-3.9.20.dist-info/RECORD,,
148
+ siat-3.9.22.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
149
+ siat-3.9.22.dist-info/METADATA,sha256=a-vcD3uMrLpIc3q4vg40-_IKlNjvgWgzJCTwzhfNO7Y,8396
150
+ siat-3.9.22.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
151
+ siat-3.9.22.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
152
+ siat-3.9.22.dist-info/RECORD,,
File without changes
File without changes