siat 3.4.14__py3-none-any.whl → 3.4.15__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/common.py +1 -1
- siat/sector_china.py +13 -5
- siat/translate.py +6 -1
- siat/yf_name.py +33 -0
- {siat-3.4.14.dist-info → siat-3.4.15.dist-info}/METADATA +1 -1
- {siat-3.4.14.dist-info → siat-3.4.15.dist-info}/RECORD +8 -8
- {siat-3.4.14.dist-info → siat-3.4.15.dist-info}/WHEEL +0 -0
- {siat-3.4.14.dist-info → siat-3.4.15.dist-info}/top_level.txt +0 -0
siat/common.py
CHANGED
@@ -3810,7 +3810,7 @@ if __name__=='__main__':
|
|
3810
3810
|
|
3811
3811
|
def upgrade_siat(module_list=['siat','akshare','pandas','pandas_datareader', \
|
3812
3812
|
'yfinance','yahooquery','urllib3','tabulate','twine', \
|
3813
|
-
'mplfinance','openpyxl','pip','bottleneck'], \
|
3813
|
+
'mplfinance','openpyxl','pip','bottleneck','ipywidgets'], \
|
3814
3814
|
pipcmd="pip install --upgrade",alternative=""):
|
3815
3815
|
"""
|
3816
3816
|
功能:一次性升级siat及其相关插件
|
siat/sector_china.py
CHANGED
@@ -814,8 +814,11 @@ def print_industry_component_sw(iname,numberPerLine=5,colalign='left'):
|
|
814
814
|
"""
|
815
815
|
打印申万行业的成分股,名称(代码)
|
816
816
|
"""
|
817
|
-
|
818
|
-
|
817
|
+
try:
|
818
|
+
icode=industry_sw_code(iname)
|
819
|
+
except:
|
820
|
+
print(" #Warning(print_industry_component_sw): sector or industry name not found for",iname)
|
821
|
+
return
|
819
822
|
|
820
823
|
clist,cdf=industry_stock_sw(icode,top=1000)
|
821
824
|
|
@@ -826,10 +829,13 @@ def print_industry_component_sw(iname,numberPerLine=5,colalign='left'):
|
|
826
829
|
cdf=cdf.mask(cdf.eq('None')).dropna()
|
827
830
|
cdf['name_code']=cdf.apply(lambda x: x['证券名称']+'('+x['icode']+')',axis=1)
|
828
831
|
|
829
|
-
|
832
|
+
#标题
|
830
833
|
import datetime as dt; stoday=dt.date.today()
|
831
|
-
|
832
|
-
|
834
|
+
ilist=list(cdf['name_code'])
|
835
|
+
|
836
|
+
titletxt="行业板块"+iname+"("+icode+")成分股:计"+str(len(ilist))+'只,按行业指数权重降序排列,'+str(stoday)
|
837
|
+
print("\n"+titletxt,end='')
|
838
|
+
#表格
|
833
839
|
printInLine_md(ilist,numberPerLine=numberPerLine,colalign=colalign)
|
834
840
|
|
835
841
|
return
|
@@ -3524,6 +3530,8 @@ def get_stock_industry_sw(ticker):
|
|
3524
3530
|
industry = t.find_all("tr")[2].find("td").text
|
3525
3531
|
|
3526
3532
|
return industry
|
3533
|
+
else:
|
3534
|
+
return ticker
|
3527
3535
|
|
3528
3536
|
#==============================================================================
|
3529
3537
|
if __name__ == '__main__':
|
siat/translate.py
CHANGED
@@ -3283,6 +3283,7 @@ def ticker1_name(ticker,ticker_type='auto'):
|
|
3283
3283
|
if tname != ticker: #翻译成功,注意证券代码与其名称相同的情形,例如IBM
|
3284
3284
|
return tname
|
3285
3285
|
|
3286
|
+
|
3286
3287
|
symbol=ticker1_cvt2yahoo(ticker)
|
3287
3288
|
|
3288
3289
|
#申万行业指数
|
@@ -3321,7 +3322,11 @@ def ticker1_name(ticker,ticker_type='auto'):
|
|
3321
3322
|
else:
|
3322
3323
|
tname=df1[df1['SYMBOL']==symbol]['ENAME'].values[0]
|
3323
3324
|
except: pass
|
3324
|
-
if tname != symbol: break
|
3325
|
+
if tname != symbol or symbol in ['IBM']: break
|
3326
|
+
else:
|
3327
|
+
tname=get_stock_name_china_sina(symbol[:6])
|
3328
|
+
if tname != symbol: break
|
3329
|
+
|
3325
3330
|
|
3326
3331
|
#查找证券名称文件:次优先交易所债券
|
3327
3332
|
if tt in ['bond']:
|
siat/yf_name.py
CHANGED
@@ -460,6 +460,39 @@ def get_stock_name1_en(ticker,short_name=False,add_suffix=True,maxlen=80):
|
|
460
460
|
return sname
|
461
461
|
|
462
462
|
#==============================================================================
|
463
|
+
#==============================================================================
|
464
|
+
if __name__ == '__main__':
|
465
|
+
ticker='600519.SS'
|
466
|
+
ticker='600305.SS'
|
467
|
+
ticker='200725.SZ'
|
468
|
+
ticker='000725.SZ'
|
469
|
+
|
470
|
+
get_stock_name_china_sina(ticker)
|
471
|
+
|
472
|
+
def get_stock_name_china_sina(ticker):
|
473
|
+
"""
|
474
|
+
功能:抓取股票的申万行业分类名称
|
475
|
+
"""
|
476
|
+
|
477
|
+
import requests
|
478
|
+
from bs4 import BeautifulSoup
|
479
|
+
|
480
|
+
ticker6=ticker[:6]
|
481
|
+
url=f"https://vip.stock.finance.sina.com.cn/corp/go.php/vCI_CorpOtherInfo/stockid/{ticker6}/menu_num/2.phtml"
|
482
|
+
response = requests.get(url)
|
483
|
+
|
484
|
+
if response.status_code == 200:
|
485
|
+
soup = BeautifulSoup(response.text, 'html.parser')
|
486
|
+
soup_text=soup.find(id="stockName").text
|
487
|
+
|
488
|
+
soup_text_list=soup_text.split('(')
|
489
|
+
|
490
|
+
t_name = soup_text_list[0].strip()
|
491
|
+
|
492
|
+
return t_name
|
493
|
+
else:
|
494
|
+
return ticker
|
495
|
+
|
463
496
|
#==============================================================================
|
464
497
|
#==============================================================================
|
465
498
|
#==============================================================================
|
@@ -18,7 +18,7 @@ siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
|
|
18
18
|
siat/capm_beta2.py,sha256=lUuCPVSxebkA2yye1PXu1V2Jd2UKEwD_kIA25DCIDTs,29750
|
19
19
|
siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
|
20
20
|
siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
|
21
|
-
siat/common.py,sha256=
|
21
|
+
siat/common.py,sha256=hRRYWfmxAz1gSz2DJBoY8z8li0cbDMw-EiJIvThuhZY,151708
|
22
22
|
siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
|
23
23
|
siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
|
24
24
|
siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
|
@@ -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
|
97
|
+
siat/sector_china.py,sha256=_-NgVSI2AMRCZw3U85ov6CgU5riii4Y9oY-rfUrfVSk,132551
|
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
|
@@ -131,15 +131,15 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
|
|
131
131
|
siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
|
132
132
|
siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
|
133
133
|
siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
|
134
|
-
siat/translate.py,sha256=
|
134
|
+
siat/translate.py,sha256=6Bp0DPoR2mpoja0ElAWlPdXuImZ2uz4_YLJchxbd9Fo,218453
|
135
135
|
siat/translate_20240606.py,sha256=63IyHWEU3Uz9mjwyuAX3fqY4nUMdwh0ICQAgmgPXP7Y,215121
|
136
136
|
siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
|
137
137
|
siat/valuation.py,sha256=NKfeZMdDJOW42oLVHob6eSVBXUqlN1OCnnzwyGAst8c,48855
|
138
138
|
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
|
-
siat/yf_name.py,sha256=
|
142
|
-
siat-3.4.
|
143
|
-
siat-3.4.
|
144
|
-
siat-3.4.
|
145
|
-
siat-3.4.
|
141
|
+
siat/yf_name.py,sha256=0c2jsMu8MwEShCE6IROSWnFman1H1V7wXIOFv12652Q,14881
|
142
|
+
siat-3.4.15.dist-info/METADATA,sha256=zlhaTgEyLTvXD5W2MQpc9YwmNUN1Mguh79vLxjxGn1w,7683
|
143
|
+
siat-3.4.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
144
|
+
siat-3.4.15.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
145
|
+
siat-3.4.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|