siat 3.4.15__py3-none-any.whl → 3.4.16__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/translate.py
CHANGED
@@ -3252,6 +3252,7 @@ if __name__=='__main__':
|
|
3252
3252
|
ticker='PDD'
|
3253
3253
|
ticker='IBM'
|
3254
3254
|
ticker='600000.SS'
|
3255
|
+
ticker='ULVR.L'
|
3255
3256
|
|
3256
3257
|
ticker_type='auto'
|
3257
3258
|
ticker_type='bond'
|
@@ -3259,6 +3260,7 @@ if __name__=='__main__':
|
|
3259
3260
|
ticker={'Market':('US','^SPX','中概教培组合'),'EDU':0.5,'TAL':0.3,'TEDU':0.2}
|
3260
3261
|
|
3261
3262
|
ticker1_name(ticker,ticker_type)
|
3263
|
+
ticker1_name(ticker)
|
3262
3264
|
|
3263
3265
|
def ticker1_name(ticker,ticker_type='auto'):
|
3264
3266
|
"""
|
@@ -3283,7 +3285,6 @@ def ticker1_name(ticker,ticker_type='auto'):
|
|
3283
3285
|
if tname != ticker: #翻译成功,注意证券代码与其名称相同的情形,例如IBM
|
3284
3286
|
return tname
|
3285
3287
|
|
3286
|
-
|
3287
3288
|
symbol=ticker1_cvt2yahoo(ticker)
|
3288
3289
|
|
3289
3290
|
#申万行业指数
|
@@ -3325,7 +3326,8 @@ def ticker1_name(ticker,ticker_type='auto'):
|
|
3325
3326
|
if tname != symbol or symbol in ['IBM']: break
|
3326
3327
|
else:
|
3327
3328
|
tname=get_stock_name_china_sina(symbol[:6])
|
3328
|
-
if tname
|
3329
|
+
if tname=='': tname=symbol
|
3330
|
+
if tname != symbol and tname != '': break
|
3329
3331
|
|
3330
3332
|
|
3331
3333
|
#查找证券名称文件:次优先交易所债券
|
@@ -3351,11 +3353,11 @@ def ticker1_name(ticker,ticker_type='auto'):
|
|
3351
3353
|
break
|
3352
3354
|
|
3353
3355
|
#如未查到,尝试stooq和雅虎名称,限英文名称
|
3354
|
-
if tname==symbol:
|
3356
|
+
if tname==symbol or tname=='':
|
3355
3357
|
#不包括中国大陆和香港证券,这些都应在前面查到?新上市的可能查不到
|
3356
3358
|
#if ('.SS' not in symbol) and ('.SH' not in symbol) and ('.SZ' not in symbol) and ('.BJ' not in symbol) and ('.HK' not in symbol):
|
3357
3359
|
tname=get_stock_name1_en(symbol)
|
3358
|
-
if tname
|
3360
|
+
if tname!=symbol:
|
3359
3361
|
return tname
|
3360
3362
|
|
3361
3363
|
#加港股标记
|
siat/yf_name.py
CHANGED
@@ -295,6 +295,52 @@ def yahoo_name1(ticker,short_name=False,add_suffix=True,maxlen=80):
|
|
295
295
|
t_name=t_name+'('+sid+')'
|
296
296
|
|
297
297
|
return t_name
|
298
|
+
|
299
|
+
#==============================================================================
|
300
|
+
if __name__ == '__main__':
|
301
|
+
stock_code='KSL.AX'
|
302
|
+
stock_code='AAPL'
|
303
|
+
stock_code='600519.SS'
|
304
|
+
stock_code='6758.T'
|
305
|
+
stock_code='6758.JP'
|
306
|
+
stock_code='ULVR.L'
|
307
|
+
stock_code='ULVR.UK'
|
308
|
+
|
309
|
+
stock_code='1155.KL'
|
310
|
+
stock_code='MSFT'
|
311
|
+
|
312
|
+
yahoo_name1_direct(stock_code)
|
313
|
+
|
314
|
+
|
315
|
+
def yahoo_name1_direct(stock_code,add_suffix=True):
|
316
|
+
"""
|
317
|
+
功能:网页直接抓取,有的带后缀的股票代码可能失败,原因未知
|
318
|
+
"""
|
319
|
+
import requests
|
320
|
+
from bs4 import BeautifulSoup
|
321
|
+
|
322
|
+
stock_code1=stock_code.upper()
|
323
|
+
|
324
|
+
#抓取证券名称
|
325
|
+
url = f"https://finance.yahoo.com/quote/{stock_code1}/"
|
326
|
+
response = requests.get(url)
|
327
|
+
if response.status_code == 200:
|
328
|
+
soup = BeautifulSoup(response.text, 'html.parser')
|
329
|
+
soup_title=soup.title
|
330
|
+
soup_text=soup_title.text
|
331
|
+
soup_text_list=soup_text.split('(')
|
332
|
+
|
333
|
+
t_name = soup_text_list[0].strip()
|
334
|
+
else:
|
335
|
+
#未找到证券代码
|
336
|
+
pass
|
337
|
+
return stock_code
|
338
|
+
|
339
|
+
#过滤名称中多余的尾部词汇
|
340
|
+
t_name=filter_stock_name(t_name)
|
341
|
+
|
342
|
+
|
343
|
+
return t_name
|
298
344
|
#==============================================================================
|
299
345
|
if __name__=='__main__':
|
300
346
|
original_name='Oponeo.pl SA'
|
@@ -437,6 +483,10 @@ if __name__=='__main__':
|
|
437
483
|
ticker='MBG.DE'
|
438
484
|
ticker='005930.KS'
|
439
485
|
ticker='LI'
|
486
|
+
ticker='ULVR.L'
|
487
|
+
ticker='KSL.AX'
|
488
|
+
|
489
|
+
ticker='IBM'
|
440
490
|
|
441
491
|
get_stock_name1_en(ticker)
|
442
492
|
|
@@ -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=Isa2gjmuY6xKo3HwaPOR0CJzPqLalcu0J1Qw2cZbmFs,218567
|
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=9U_XfEeMlS3TrCrO3Bww21nuFgghbnO-cqDJMhQWqew,16193
|
142
|
+
siat-3.4.16.dist-info/METADATA,sha256=6jn_hf0WErGP2RdyweWl-65rvA-ypaJ2y-UumDF2fyU,7683
|
143
|
+
siat-3.4.16.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
144
|
+
siat-3.4.16.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
145
|
+
siat-3.4.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|