siat 3.4.12__py3-none-any.whl → 3.4.14__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/sector_china.py CHANGED
@@ -3200,8 +3200,9 @@ if __name__=='__main__':
3200
3200
  peers=stock_industry_peer_em(ticker,indicator="市盈率",rank=10)
3201
3201
 
3202
3202
  def stock_peers_em(ticker='',indicator='',rank=10, \
3203
- font_size="16px",facecolor="papayawhip", \
3204
- numberPerLine=5):
3203
+ force_show_stock=False, \
3204
+ font_size="16px",facecolor="papayawhip", \
3205
+ numberPerLine=5):
3205
3206
  """
3206
3207
  功能:基于东方财富行业分类,查找股票所属的行业以及主要同行
3207
3208
  特点:行业分类较粗糙,略胜于无
@@ -3498,5 +3499,65 @@ def concept_stocks_em(concept='',ticker='',indicator="市盈率",rank=10, \
3498
3499
 
3499
3500
 
3500
3501
  #==============================================================================
3502
+ if __name__ == '__main__':
3503
+ ticker='600519.SS'
3504
+ ticker='600305.SS'
3505
+
3506
+ get_stock_industry_sw(ticker)
3507
+
3508
+ def get_stock_industry_sw(ticker):
3509
+ """
3510
+ 功能:抓取股票的申万行业分类名称
3511
+ """
3512
+
3513
+ import requests
3514
+ from bs4 import BeautifulSoup
3515
+
3516
+ ticker6=ticker[:6]
3517
+ url=f"https://vip.stock.finance.sina.com.cn/corp/go.php/vCI_CorpOtherInfo/stockid/{ticker6}/menu_num/2.phtml"
3518
+ response = requests.get(url)
3519
+
3520
+ if response.status_code == 200:
3521
+ soup = BeautifulSoup(response.text, 'html.parser')
3522
+
3523
+ t = soup.find('table',class_="comInfo1")
3524
+ industry = t.find_all("tr")[2].find("td").text
3525
+
3526
+ return industry
3527
+
3528
+ #==============================================================================
3529
+ if __name__ == '__main__':
3530
+ ticker='600519.SS'
3531
+ ticker='600305.SS'
3532
+
3533
+ stock_peers_sw(ticker)
3534
+
3535
+ def stock_peers_sw(ticker):
3536
+ """
3537
+ 功能:找出股票的申万行业分类及其同行
3538
+ """
3539
+
3540
+ try:
3541
+ hangye=get_stock_industry_sw(ticker)
3542
+ except:
3543
+ print(" #Warning(stock_peers_sw): stock not found for",ticker)
3544
+ return
3545
+
3546
+ #三级行业优先
3547
+ hangye3=hangye+'Ⅲ'
3548
+ try:
3549
+ print_industry_component_sw(iname=hangye3)
3550
+ except:
3551
+ #二级行业次优先
3552
+ hangye2=hangye+'Ⅱ'
3553
+ try:
3554
+ print_industry_component_sw(iname=hangye2)
3555
+ except:
3556
+ try:
3557
+ print_industry_component_sw(iname=hangye)
3558
+ except:
3559
+ print(" #Warning(stock_peers_sw): failed to search peers for",ticker)
3501
3560
 
3561
+ return
3562
+
3502
3563
 
siat/stock.py CHANGED
@@ -2288,9 +2288,11 @@ def candlestick(stkcd,fromdate,todate,volume=True,style='China',mav=[5,10], \
2288
2288
 
2289
2289
  #设置图例,注意前两个为图中期间开始日期的线和柱子
2290
2290
  mav_labels=[text_lang('期间首日线','Day 1(line)'),text_lang('期间首日柱','Day 1(bar)')]
2291
+ #mav_labels=[None,None]
2291
2292
  for d in mav:
2292
2293
  mav_labels=mav_labels+[str(d)+text_lang("日移动均线","-day MAV line")]
2293
- axlist[0].legend(mav_labels,loc=loc)
2294
+ axlist[0].legend(labels=mav_labels,loc=loc)
2295
+ #axlist[0].legend(mav_labels[2:],loc=loc)
2294
2296
  """
2295
2297
  #去掉前两个无用的图例
2296
2298
  handles, labels = axlist[0].get_legend_handles_labels()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.4.12
3
+ Version: 3.4.14
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
@@ -94,7 +94,7 @@ siat/risk_evaluation.py,sha256=I6B3gty-t--AkDCO0tKF-291YfpnF-IkXcFjqNKCt9I,76286
94
94
  siat/risk_evaluation_test.py,sha256=YEXM96gKzTfwN4U61AS4Rr1tV7KgUvn4rRC6f3iMw9s,3731
95
95
  siat/risk_free_rate.py,sha256=ZMr4cHikPvXvywr54gGqiI3Nvb69am6tq3zj2hwzANE,12384
96
96
  siat/risk_free_rate_test.py,sha256=CpmhUf8aEAEZeNu4gvWP2Mz2dLoIgBX5bI41vfUBEr8,4285
97
- siat/sector_china.py,sha256=dCBzhFUbCKZytRmtMcPCmrq6ktmXJ50FH6g48SMXlt8,130573
97
+ siat/sector_china.py,sha256=-3Z13BOwTlNzRLlB2-Pt1xEVu4R7PY6OTuW9BxvXVVw,132299
98
98
  siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
99
99
  siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
100
100
  siat/security_price2.py,sha256=65s64L68aRZdVVK3V8UYxdPd_JHMqgJ2FBJJX5MSW-Q,26174
@@ -105,7 +105,7 @@ siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmW
105
105
  siat/security_trend2.py,sha256=lUMab8HilXIUPo_z9ZkztMiZ5kf3jAbbCwPPkYbQ1TI,25288
106
106
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
107
107
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
108
- siat/stock.py,sha256=22HTy0BfmynrkWuprNGlfRsYuWdTyCV0CJ9t_w5x238,152444
108
+ siat/stock.py,sha256=IY4-RC8jztjFEN4FFdc6YP299IRyIOwIcPRObswg588,152527
109
109
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
110
110
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
111
111
  siat/stock_china.py,sha256=zyUyghIrkkkYWlHRRP7Hoblxzfp-jrck60pTJpwMahg,91553
@@ -139,7 +139,7 @@ siat/valuation_china.py,sha256=EkZQaVkoBjM0c4MCNbaX-bMnlG0e3FXeaWczZDnkptU,67784
139
139
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
140
140
  siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
141
141
  siat/yf_name.py,sha256=H1EM8YYXA8nQHIqsJlso0I3HKPiJLT3QujO4gRVQXWs,13945
142
- siat-3.4.12.dist-info/METADATA,sha256=4x-7hEFgcIpc91o197nqMAM8kxqCckIONyb5qWMpdO8,7683
143
- siat-3.4.12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
144
- siat-3.4.12.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
145
- siat-3.4.12.dist-info/RECORD,,
142
+ siat-3.4.14.dist-info/METADATA,sha256=Bb5sc9tqZHXC_O1LOe7LRT9-OK8FKscIj8QzMRcUCqg,7683
143
+ siat-3.4.14.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
144
+ siat-3.4.14.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
145
+ siat-3.4.14.dist-info/RECORD,,
File without changes