siat 3.10.13__py3-none-any.whl → 3.10.24__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 +27 -0
- siat/security_prices.py +109 -3
- siat/security_trend2.py +26 -7
- siat/stock.py +9 -9
- siat/stock_china.py +69 -35
- {siat-3.10.13.dist-info → siat-3.10.24.dist-info}/METADATA +1 -1
- {siat-3.10.13.dist-info → siat-3.10.24.dist-info}/RECORD +10 -10
- {siat-3.10.13.dist-info → siat-3.10.24.dist-info}/LICENSE +0 -0
- {siat-3.10.13.dist-info → siat-3.10.24.dist-info}/WHEEL +0 -0
- {siat-3.10.13.dist-info → siat-3.10.24.dist-info}/top_level.txt +0 -0
siat/common.py
CHANGED
@@ -5074,5 +5074,32 @@ def last_in_list(element,alist):
|
|
5074
5074
|
|
5075
5075
|
return result
|
5076
5076
|
#==============================================================================
|
5077
|
+
if __name__ == '__main__':
|
5078
|
+
ticker='600519.SS'
|
5079
|
+
ticker='09998.HK'
|
5080
|
+
ticker='AAPL'
|
5081
|
+
|
5082
|
+
is_A_share(ticker)
|
5083
|
+
|
5084
|
+
def is_A_share(ticker):
|
5085
|
+
"""
|
5086
|
+
功能:判断是否中国A股
|
5087
|
+
ticker:单个股票代码
|
5088
|
+
返回值:True, False
|
5089
|
+
"""
|
5090
|
+
if not isinstance(ticker,str):
|
5091
|
+
return False
|
5092
|
+
|
5093
|
+
tlist=ticker.split('.')
|
5094
|
+
if len(tlist) < 2:
|
5095
|
+
return False
|
5096
|
+
|
5097
|
+
# SUFFIX_LIST_CN=['SS','SZ','BJ','SW','SH']
|
5098
|
+
if tlist[1] in SUFFIX_LIST_CN:
|
5099
|
+
return True
|
5100
|
+
else:
|
5101
|
+
return False
|
5102
|
+
|
5103
|
+
|
5077
5104
|
#==============================================================================
|
5078
5105
|
#==============================================================================
|
siat/security_prices.py
CHANGED
@@ -1458,10 +1458,11 @@ if __name__=='__main__':
|
|
1458
1458
|
#==============================================================================
|
1459
1459
|
if __name__=='__main__':
|
1460
1460
|
ticker='^TYX'
|
1461
|
-
|
1462
|
-
|
1461
|
+
ticker='AMZN'
|
1462
|
+
ticker='AAPL'
|
1463
|
+
start='2020-12-1'; end='2025-1-31'
|
1463
1464
|
|
1464
|
-
get_price_yq(ticker,start,end)
|
1465
|
+
p=get_price_yq(ticker,start,end)
|
1465
1466
|
|
1466
1467
|
def get_price_yq(ticker,start,end):
|
1467
1468
|
"""
|
@@ -1536,7 +1537,112 @@ def get_price_yq(ticker,start,end):
|
|
1536
1537
|
#print(" #Error(get_prices_yf):",ticker1,"not found or no prices in the period or inaccessible to yahoo")
|
1537
1538
|
|
1538
1539
|
return p
|
1540
|
+
|
1541
|
+
#==============================================================================
|
1542
|
+
if __name__=='__main__':
|
1543
|
+
ticker='AMZN'
|
1544
|
+
ticker='AAPL'
|
1545
|
+
start='2020-12-1'; end='2025-1-31'
|
1546
|
+
|
1547
|
+
def get_dividend_yq(ticker,start,end,facecolor="papayawhip"):
|
1548
|
+
"""
|
1549
|
+
功能:获得股票分红历史数据
|
1550
|
+
"""
|
1539
1551
|
|
1552
|
+
print(f" Looking for dividend info for {ticker} from Yahoo ...")
|
1553
|
+
try:
|
1554
|
+
p=get_price_yq(ticker,start,end)
|
1555
|
+
except:
|
1556
|
+
print(f" #Error(get_dividend_yq): crump problem. If {ticker} is correct, try again later")
|
1557
|
+
return None
|
1558
|
+
if p is None:
|
1559
|
+
print(f" #Error(get_dividend_yq): failed to get dividend info for {ticker}, may try again later")
|
1560
|
+
return None
|
1561
|
+
|
1562
|
+
pcols=list(p)
|
1563
|
+
if not ('dividends' in pcols):
|
1564
|
+
print(f" No dividend info found for {ticker} from {start} to {end}")
|
1565
|
+
return None
|
1566
|
+
|
1567
|
+
div1=p[['date','dividends','Close','Adj Close']]
|
1568
|
+
div2=div1[div1['dividends'] != 0]
|
1569
|
+
|
1570
|
+
if len(div2) == 0:
|
1571
|
+
print(f" No dividend info found for {ticker} during {start} to {end}")
|
1572
|
+
return None
|
1573
|
+
|
1574
|
+
div2['dividends']=div2['dividends'].apply(lambda x: round(x,4))
|
1575
|
+
div2['Close']=div2['Close'].apply(lambda x: round(x,2))
|
1576
|
+
div2['Adj Close']=div2['Adj Close'].apply(lambda x: round(x,2))
|
1577
|
+
div2.rename(columns={"date":text_lang("除息日期","ex-Dividend Date"), \
|
1578
|
+
"dividends":text_lang("每股分红(本币,税前)","Dividend per Share (Pre-tax)"), \
|
1579
|
+
"Close":text_lang("收盘价","Close Price"), \
|
1580
|
+
"Adj Close":text_lang("前复权价","Adjusted Close Price")}, \
|
1581
|
+
inplace=True)
|
1582
|
+
|
1583
|
+
titletxt=ticker_name(ticker,"stock")+": "+text_lang("股票分红历史","Stock Dividend History")
|
1584
|
+
import datetime
|
1585
|
+
todaydt = datetime.date.today()
|
1586
|
+
footnote_cn=f"期间:{start}至{end}, 数据来源:雅虎, {todaydt}"
|
1587
|
+
footnote_en=f"Period:{start} to {end}. Data source:Yahoo, {todaydt}"
|
1588
|
+
footnote=text_lang(footnote_cn,footnote_en)
|
1589
|
+
df_display_CSS(div2,titletxt=titletxt,footnote=footnote,facecolor=facecolor,decimals=2, \
|
1590
|
+
first_col_align='center',second_col_align='center', \
|
1591
|
+
last_col_align='right',other_col_align='center')
|
1592
|
+
|
1593
|
+
|
1594
|
+
return div2
|
1595
|
+
|
1596
|
+
def get_split_yq(ticker,start,end,facecolor="papayawhip"):
|
1597
|
+
"""
|
1598
|
+
功能:获得股票分拆历史数据
|
1599
|
+
"""
|
1600
|
+
|
1601
|
+
print(f" Looking for split info for {ticker} from Yahoo ...")
|
1602
|
+
try:
|
1603
|
+
p=get_price_yq(ticker,start,end)
|
1604
|
+
except:
|
1605
|
+
print(f" #Error(get_split_yq): crump problem. If {ticker} is correct, try again later")
|
1606
|
+
return None
|
1607
|
+
if p is None:
|
1608
|
+
print(f" #Error(get_split_yq): split info not found for {ticker}, may try again later")
|
1609
|
+
return None
|
1610
|
+
|
1611
|
+
pcols=list(p)
|
1612
|
+
if not ('splits' in pcols):
|
1613
|
+
print(f" No split info found for {ticker} from {start} to {end}")
|
1614
|
+
return None
|
1615
|
+
|
1616
|
+
div1=p[['date','splits','Close','Adj Close']]
|
1617
|
+
div2=div1[div1['splits'] != 0]
|
1618
|
+
|
1619
|
+
if len(div2) == 0:
|
1620
|
+
print(f" No split info found for {ticker} during {start} to {end}")
|
1621
|
+
return None
|
1622
|
+
|
1623
|
+
div2['Close']=div2['Close']*div2['splits']
|
1624
|
+
div2['splits']=div2['splits'].apply(lambda x: int(x))
|
1625
|
+
div2['Close']=div2['Close'].apply(lambda x: round(x,2))
|
1626
|
+
div2['Adj Close']=div2['Adj Close'].apply(lambda x: round(x,2))
|
1627
|
+
div2.rename(columns={"date":text_lang("分拆日期","Split Date"), \
|
1628
|
+
"splits":text_lang("分拆比例","Split Ratio"), \
|
1629
|
+
"Close":text_lang("收盘价","Close Price"), \
|
1630
|
+
"Adj Close":text_lang("前复权价","Adjusted Close Price")}, \
|
1631
|
+
inplace=True)
|
1632
|
+
|
1633
|
+
titletxt=ticker_name(ticker,"stock")+": "+text_lang("股票分拆历史","Stock Split History")
|
1634
|
+
import datetime
|
1635
|
+
todaydt = datetime.date.today()
|
1636
|
+
footnote_cn=f"期间:{start}至{end}, 数据来源:雅虎, {todaydt}"
|
1637
|
+
footnote_en=f"Period:{start} to {end}. Data source:Yahoo, {todaydt}"
|
1638
|
+
footnote=text_lang(footnote_cn,footnote_en)
|
1639
|
+
df_display_CSS(div2,titletxt=titletxt,footnote=footnote,facecolor=facecolor,decimals=2, \
|
1640
|
+
first_col_align='center',second_col_align='center', \
|
1641
|
+
last_col_align='right',other_col_align='center')
|
1642
|
+
|
1643
|
+
|
1644
|
+
return div2
|
1645
|
+
|
1540
1646
|
#==============================================================================
|
1541
1647
|
if __name__=='__main__':
|
1542
1648
|
ticker='^GSPC'
|
siat/security_trend2.py
CHANGED
@@ -116,7 +116,9 @@ if __name__=='__main__':
|
|
116
116
|
mark_top=True; mark_bottom=True; mark_end=True
|
117
117
|
printout=True; source='auto'
|
118
118
|
ticker_type='auto'
|
119
|
-
facecolor='papayawhip'
|
119
|
+
facecolor='papayawhip'
|
120
|
+
|
121
|
+
dividend=True
|
120
122
|
|
121
123
|
df=security_trend(ticker,indicator,start,end,ticker_type=ticker_type)
|
122
124
|
|
@@ -238,6 +240,7 @@ def security_trend(ticker,indicator='Close',adjust='', \
|
|
238
240
|
start='MRY')
|
239
241
|
"""
|
240
242
|
DEBUG=False
|
243
|
+
is_yfinance_work=False
|
241
244
|
|
242
245
|
if mark_high: mark_top=True
|
243
246
|
if mark_low: mark_bottom=True
|
@@ -302,7 +305,7 @@ def security_trend(ticker,indicator='Close',adjust='', \
|
|
302
305
|
ticker_type=ticker_type,facecolor=facecolor)
|
303
306
|
return df
|
304
307
|
|
305
|
-
#
|
308
|
+
# 处理股票分红和股票分拆:境外股票需要访问雅虎财经=============================
|
306
309
|
if dividend:
|
307
310
|
if portfolio_flag:
|
308
311
|
print(" #Warning(security_trend): investment portfolio does not support for stock dividend")
|
@@ -310,9 +313,20 @@ def security_trend(ticker,indicator='Close',adjust='', \
|
|
310
313
|
|
311
314
|
if start in ['default']:
|
312
315
|
fromdate=date_adjust(todate,adjust=-365*5)
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
+
|
317
|
+
if is_A_share(tickers[0]):
|
318
|
+
stock_profile_china(tickers[0],category='dividend', \
|
319
|
+
start=fromdate,facecolor=facecolor)
|
320
|
+
return None
|
321
|
+
else:
|
322
|
+
#print(" Trying to access Yahoo via yfinance for stock dividend ...")
|
323
|
+
df=None
|
324
|
+
if is_yfinance_work:
|
325
|
+
df=stock_dividend(ticker=tickers[0],start=fromdate,end=todate,facecolor=facecolor)
|
326
|
+
if df is None:
|
327
|
+
df=get_dividend_yq(ticker=tickers[0],start=fromdate,end=todate,facecolor=facecolor)
|
328
|
+
|
329
|
+
return df
|
316
330
|
|
317
331
|
if split:
|
318
332
|
if portfolio_flag:
|
@@ -321,8 +335,13 @@ def security_trend(ticker,indicator='Close',adjust='', \
|
|
321
335
|
|
322
336
|
if start in ['default']:
|
323
337
|
fromdate=date_adjust(todate,adjust=-365*5)
|
324
|
-
print("
|
325
|
-
df=
|
338
|
+
#print(" Trying to access Yahoo via yfinance for stock split ...")
|
339
|
+
df=None
|
340
|
+
if is_yfinance_work:
|
341
|
+
df=stock_split(ticker=tickers[0],start=fromdate,end=todate,facecolor=facecolor)
|
342
|
+
if df is None:
|
343
|
+
df=get_split_yq(ticker=tickers[0],start=fromdate,end=todate,facecolor=facecolor)
|
344
|
+
|
326
345
|
return df
|
327
346
|
|
328
347
|
|
siat/stock.py
CHANGED
@@ -2678,7 +2678,7 @@ def stock_dividend(ticker,start="L3Y",end="today",facecolor='whitesmoke',fontcol
|
|
2678
2678
|
|
2679
2679
|
fromdate,todate=start,end
|
2680
2680
|
|
2681
|
-
print(" Searching for
|
2681
|
+
print(" Searching for dividend info of stock",ticker,"...")
|
2682
2682
|
result,startdt,enddt=check_period(fromdate,todate)
|
2683
2683
|
if not result:
|
2684
2684
|
print(" #Error(stock_dividend): invalid period",fromdate,todate)
|
@@ -2694,10 +2694,10 @@ def stock_dividend(ticker,start="L3Y",end="today",facecolor='whitesmoke',fontcol
|
|
2694
2694
|
try:
|
2695
2695
|
div=stock.dividends
|
2696
2696
|
except:
|
2697
|
-
print(" #Error(stock_dividend):
|
2697
|
+
print(f" #Error(stock_dividend): dividend info inaccessible for {ticker}")
|
2698
2698
|
return None
|
2699
2699
|
if len(div)==0:
|
2700
|
-
print(" #Warning(stock_dividend):
|
2700
|
+
print(f" #Warning(stock_dividend): failed to get dividend info for {ticker}")
|
2701
2701
|
return None
|
2702
2702
|
|
2703
2703
|
# 去掉时区信息,避免合并中的日期时区冲突问题
|
@@ -2709,7 +2709,7 @@ def stock_dividend(ticker,start="L3Y",end="today",facecolor='whitesmoke',fontcol
|
|
2709
2709
|
div1=div[div.index >= startdt]
|
2710
2710
|
div2=div1[div1.index <= enddt]
|
2711
2711
|
if len(div2)==0:
|
2712
|
-
print(" #Warning(stock_dividend): no
|
2712
|
+
print(f" #Warning(stock_dividend): no dividends found from {fromdate} to {todate}")
|
2713
2713
|
return None
|
2714
2714
|
|
2715
2715
|
#对齐打印
|
@@ -2765,7 +2765,7 @@ def stock_dividend(ticker,start="L3Y",end="today",facecolor='whitesmoke',fontcol
|
|
2765
2765
|
"""
|
2766
2766
|
#print('') #空一行
|
2767
2767
|
|
2768
|
-
df_display_CSS(divprt,titletxt=titletxt,footnote=footnote,facecolor=
|
2768
|
+
df_display_CSS(divprt,titletxt=titletxt,footnote=footnote,facecolor=facecolor,decimals=4, \
|
2769
2769
|
first_col_align='center',second_col_align='center', \
|
2770
2770
|
last_col_align='right',other_col_align='center')
|
2771
2771
|
|
@@ -2819,7 +2819,7 @@ def stock_split(ticker,start="L10Y",end="today",facecolor='whitesmoke',fontcolor
|
|
2819
2819
|
|
2820
2820
|
fromdate,todate=start,end
|
2821
2821
|
|
2822
|
-
print(" Searching for
|
2822
|
+
print(" Searching for split info of stock",ticker,"...")
|
2823
2823
|
result,startdt,enddt=check_period(fromdate,todate)
|
2824
2824
|
if not result:
|
2825
2825
|
print(" #Error(stock_split): invalid period",fromdate,todate)
|
@@ -2835,10 +2835,10 @@ def stock_split(ticker,start="L10Y",end="today",facecolor='whitesmoke',fontcolor
|
|
2835
2835
|
try:
|
2836
2836
|
div=stock.splits
|
2837
2837
|
except:
|
2838
|
-
print(" #Error(stock_split):
|
2838
|
+
print(f" #Error(stock_split): split info inaccessible for {ticker}")
|
2839
2839
|
return None
|
2840
2840
|
if len(div)==0:
|
2841
|
-
print(" #Warning(stock_split): no split
|
2841
|
+
print(f" #Warning(stock_split): no split info found for {ticker}")
|
2842
2842
|
return None
|
2843
2843
|
|
2844
2844
|
# 去掉时区信息,避免合并中的日期时区冲突问题
|
@@ -2930,7 +2930,7 @@ def stock_split(ticker,start="L10Y",end="today",facecolor='whitesmoke',fontcolor
|
|
2930
2930
|
"""
|
2931
2931
|
print(' ') #空一行
|
2932
2932
|
|
2933
|
-
df_display_CSS(divprt,titletxt=titletxt,footnote=footnote,facecolor=
|
2933
|
+
df_display_CSS(divprt,titletxt=titletxt,footnote=footnote,facecolor=facecolor,decimals=2, \
|
2934
2934
|
first_col_align='center',second_col_align='center', \
|
2935
2935
|
last_col_align='right',other_col_align='center')
|
2936
2936
|
"""
|
siat/stock_china.py
CHANGED
@@ -1099,7 +1099,7 @@ if __name__ =="__main__":
|
|
1099
1099
|
def stock_profile_china(ticker,category='profile', \
|
1100
1100
|
business_period='recent', \
|
1101
1101
|
financial_quarters=8, \
|
1102
|
-
|
1102
|
+
start='2020-1-1', \
|
1103
1103
|
|
1104
1104
|
#参数prettytab和tabborder弃用,保留只为了兼容性
|
1105
1105
|
prettytab=False, \
|
@@ -1117,7 +1117,7 @@ def stock_profile_china(ticker,category='profile', \
|
|
1117
1117
|
默认recent为最近一期(可能为季报、中报或年报),annual为使用最近的年报。
|
1118
1118
|
|
1119
1119
|
financial_quarters:配合category='financial'使用,介绍财务基本面使用的季度个数,最大为8.
|
1120
|
-
|
1120
|
+
start:配合category='valuation'或'dividend'使用,介绍估值/分红信息的开始日期,默认为2020-1-1。
|
1121
1121
|
|
1122
1122
|
prettytab:输出表格样式,默认False使用markdown报表,True使用prettytable报表
|
1123
1123
|
tabborder:prettytable报表时是否绘制边框,默认不绘制False,True绘制简单字符链接的边框,丑陋。
|
@@ -1420,62 +1420,88 @@ def stock_profile_china(ticker,category='profile', \
|
|
1420
1420
|
"""
|
1421
1421
|
#if category in ['dividend','split']:
|
1422
1422
|
if any(s in category for s in ['dividend','split']):
|
1423
|
+
tickername=ticker_name(ticker,'stock')
|
1423
1424
|
# 分红
|
1424
|
-
titletxt=
|
1425
|
+
titletxt=tickername+':分红历史'
|
1425
1426
|
try:
|
1426
1427
|
#df3=ak.stock_dividents_cninfo(symbol=ticker1)
|
1427
1428
|
df3=ak.stock_history_dividend_detail(symbol=ticker1, indicator="分红")
|
1428
1429
|
except:
|
1429
1430
|
print('')
|
1431
|
+
"""
|
1430
1432
|
print(titletxt)
|
1431
1433
|
print(" #Warning(stock_profile_china): dividend info not found for stock",ticker)
|
1434
|
+
"""
|
1435
|
+
print(f" {tickername}:{start}后未找到分红信息")
|
1432
1436
|
return
|
1433
1437
|
|
1434
1438
|
if len(df3)==0:
|
1439
|
+
"""
|
1435
1440
|
print('')
|
1436
1441
|
print(titletxt)
|
1437
1442
|
print(" No dividend record found for stock",ticker)
|
1443
|
+
"""
|
1444
|
+
print(f" {tickername}:{start}后未找到分红信息")
|
1438
1445
|
return
|
1439
1446
|
|
1440
1447
|
# 整理信息
|
1441
1448
|
dftmp=df3[df3['进度']=='实施']
|
1442
|
-
dftmp.drop(['进度','红股上市日'],axis=1,inplace=True)
|
1449
|
+
#dftmp.drop(['进度','红股上市日'],axis=1,inplace=True)
|
1450
|
+
dftmp.drop(['进度'],axis=1,inplace=True)
|
1443
1451
|
dftmp.replace(0,'-',inplace=True)
|
1452
|
+
import numpy as np
|
1453
|
+
dftmp.replace(np.nan,'-',inplace=True)
|
1444
1454
|
|
1445
|
-
newcols=['公告日期','送股','转增','派息','股权登记日','除权除息日']
|
1455
|
+
newcols=['公告日期','送股','转增','派息','股权登记日','除权除息日','红股上市日']
|
1446
1456
|
dftmp3=dftmp[newcols]
|
1447
1457
|
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1458
|
+
import pandas as pd
|
1459
|
+
startpd=pd.Timestamp(start)
|
1460
|
+
dftmp4=dftmp3[dftmp3['公告日期'] >= startpd.date()]
|
1461
|
+
|
1462
|
+
if len(dftmp4) == 0:
|
1463
|
+
print(f" {tickername}:{start}后未找到分红信息")
|
1453
1464
|
else:
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1465
|
+
titletxt=ticker_name(ticker,'stock')+':分红历史'
|
1466
|
+
"""
|
1467
|
+
if prettytab:
|
1468
|
+
pandas2prettytable(dftmp3,titletxt,firstColSpecial=False,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1469
|
+
print('【注】送股/转增:股数/10股,派息:元(税前)/10股,数据来源:新浪财经,',str(today))
|
1470
|
+
else:
|
1471
|
+
print('\n*** '+titletxt+'\n')
|
1472
|
+
alignlist=['center']+['right']*(len(list(dftmp3))-1)
|
1473
|
+
print(dftmp3.to_markdown(tablefmt='Simple',index=False,colalign=alignlist))
|
1474
|
+
print('【注】送股/转增:股数/10股,派息:元(税前)/10股,数据来源:新浪财经,',str(today))
|
1475
|
+
"""
|
1476
|
+
footnote='【注】送股/转增:股数/10股,派息:元(税前)/10股,数据来源:新浪财经,'+str(stoday)
|
1477
|
+
df_display_CSS(df=dftmp4,titletxt=titletxt,footnote=footnote, \
|
1478
|
+
first_col_align='center',second_col_align='center', \
|
1479
|
+
last_col_align='center',other_col_align='center', \
|
1480
|
+
|
1481
|
+
facecolor=facecolor,decimals=2, \
|
1482
|
+
titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
|
1483
|
+
data_font_size=data_font_size)
|
1464
1484
|
|
1465
1485
|
# 配股
|
1466
1486
|
titletxt=ticker_name(ticker,'stock')+':配股历史'
|
1467
1487
|
try:
|
1468
1488
|
df3p=ak.stock_history_dividend_detail(symbol=ticker1, indicator="配股")
|
1469
1489
|
except:
|
1490
|
+
"""
|
1470
1491
|
print('')
|
1471
1492
|
print(titletxt)
|
1472
1493
|
print(" #Warning(stock_profile_china): allotment info not found for stock",ticker)
|
1494
|
+
"""
|
1495
|
+
#print(f"\n {tickername}:{start}后未找到配股信息")
|
1473
1496
|
return
|
1474
1497
|
|
1475
1498
|
if len(df3p)==0:
|
1499
|
+
"""
|
1476
1500
|
print('')
|
1477
1501
|
print(titletxt)
|
1478
1502
|
print(" #Warning(stock_profile_china): no allotment info found for stock",ticker)
|
1503
|
+
"""
|
1504
|
+
#print(f"\n {tickername}:{start}后未找到配股信息")
|
1479
1505
|
return
|
1480
1506
|
|
1481
1507
|
# 整理信息
|
@@ -1484,21 +1510,30 @@ def stock_profile_china(ticker,category='profile', \
|
|
1484
1510
|
|
1485
1511
|
newcols=['公告日期','配股方案','配股价格','股权登记日','除权日','缴款起始日','缴款终止日','配股上市日']
|
1486
1512
|
dftmp3=dftmp[newcols]
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
print(
|
1513
|
+
|
1514
|
+
dftmp4=dftmp3[dftmp3['公告日期'] >= startpd.date()]
|
1515
|
+
if len(dftmp4) == 0:
|
1516
|
+
#print(f"\n {tickername}:{start}后未找到配股信息")
|
1517
|
+
return
|
1491
1518
|
else:
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1519
|
+
"""
|
1520
|
+
if prettytab:
|
1521
|
+
pandas2prettytable(dftmp3,titletxt,firstColSpecial=False,leftColAlign='l',otherColAlign='c',tabborder=tabborder)
|
1522
|
+
print('【注】配股方案:每10股的配股数,配股价格为元。数据来源:新浪财经,',str(today))
|
1523
|
+
else:
|
1524
|
+
print('\n*** '+titletxt+'\n')
|
1525
|
+
alignlist=['center']+['right']*(len(list(dftmp3))-1)
|
1526
|
+
print(dftmp3.to_markdown(tablefmt='Simple',index=False,colalign=alignlist))
|
1527
|
+
print('【注】配股方案:每10股的配股数,配股价格为元。数据来源:新浪财经,',str(today))
|
1528
|
+
"""
|
1529
|
+
footnote='【注】配股方案:每10股的配股数,配股价格为元。数据来源:新浪财经,'+str(stoday)
|
1530
|
+
df_display_CSS(df=dftmp3,titletxt=titletxt,footnote=footnote, \
|
1531
|
+
first_col_align='center',second_col_align='center', \
|
1532
|
+
last_col_align='center',other_col_align='center', \
|
1533
|
+
|
1534
|
+
facecolor=facecolor,decimals=2, \
|
1535
|
+
titile_font_size=titile_font_size,heading_font_size=heading_font_size, \
|
1536
|
+
data_font_size=data_font_size)
|
1502
1537
|
|
1503
1538
|
|
1504
1539
|
# 主要股东信息查询=============================================================================
|
@@ -1606,7 +1641,6 @@ def stock_profile_china(ticker,category='profile', \
|
|
1606
1641
|
|
1607
1642
|
# 整理信息
|
1608
1643
|
import pandas as pd
|
1609
|
-
start=valuation_start
|
1610
1644
|
#startpd=pd.to_datetime(start)
|
1611
1645
|
startpd=pd.Timestamp(start)
|
1612
1646
|
|
@@ -19,7 +19,7 @@ siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
|
|
19
19
|
siat/capm_beta2.py,sha256=LmrfFhm4A-HLGolJ5rdlZFDGJkClS2I3Wv7gaHM3Tdw,34275
|
20
20
|
siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
|
21
21
|
siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
|
22
|
-
siat/common.py,sha256=
|
22
|
+
siat/common.py,sha256=xmmx2jdxUky9qe1O33g1YB6PKqQOqMA4VcVe_ZKNppE,184004
|
23
23
|
siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
|
24
24
|
siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
|
25
25
|
siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
|
@@ -103,17 +103,17 @@ siat/sector_china.py,sha256=9zjdORWx5ia_gUezidhOKWmCnVDwWcnnjjugHudelaQ,157411
|
|
103
103
|
siat/sector_china_test.py,sha256=1wq7ef8Bb_L8F0h0W6FvyBrIcBTEbrTV7hljtpj49U4,5843
|
104
104
|
siat/security_price.py,sha256=2oHskgiw41KMGfqtnA0i2YjNNV6cYgtlUK0j3YeuXWs,29185
|
105
105
|
siat/security_price2.py,sha256=uC-wA6w3IlA9ZOJYINqIB7LexCbrnnqTkHTPuCSCwpo,27697
|
106
|
-
siat/security_prices.py,sha256=
|
106
|
+
siat/security_prices.py,sha256=C5fhNlkZF3EmDgc5V8saqWYSa6SLdJs1Ax7NQoBR_cg,116618
|
107
107
|
siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,10779
|
108
108
|
siat/security_trend.py,sha256=o0vpWdrJkmODCP94X-Bvn-w7efHhj9HpUYBHtLl55D0,17240
|
109
109
|
siat/security_trend2-20240620.py,sha256=QVnEcb7AyVbO77jVqfFsJffGXrX8pgJ9xCfoAKmWBPk,24854
|
110
|
-
siat/security_trend2.py,sha256=
|
110
|
+
siat/security_trend2.py,sha256=EoDgGYgL-X3vT_YoJB_jA2VeC38jS4e9MxtQzy-C0QI,31955
|
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=
|
113
|
+
siat/stock.py,sha256=iSObjGX9D8HwVnqQZkpz-spzolqkUYBYWo9ylg37RLg,160210
|
114
114
|
siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
|
115
115
|
siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
|
116
|
-
siat/stock_china.py,sha256=
|
116
|
+
siat/stock_china.py,sha256=WeHhZ7GlsKdkfkBoaXrk3hCmK6PmHjNcdJKUN2S2xEE,94967
|
117
117
|
siat/stock_china_test.py,sha256=eO4HWsSvc6qezl0LndjtL24lViEyrBjH_sx2c2Y2Q2M,1294
|
118
118
|
siat/stock_info.pickle,sha256=XqcFwQrXoBXAzZnE6rnfpI7zETXZS2usqzsx2ff7MEg,1319005
|
119
119
|
siat/stock_info_test.py,sha256=gfG3DbhDACbtD8wnv_R6zhj0t11XaC8NX8uLD9Qv3Fo,6122
|
@@ -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.10.
|
149
|
-
siat-3.10.
|
150
|
-
siat-3.10.
|
151
|
-
siat-3.10.
|
152
|
-
siat-3.10.
|
148
|
+
siat-3.10.24.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
|
149
|
+
siat-3.10.24.dist-info/METADATA,sha256=SAbYZhLq09GVuxGheLXjWBJWUWUkHkzFWrqr5lJ53IE,8222
|
150
|
+
siat-3.10.24.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
151
|
+
siat-3.10.24.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
152
|
+
siat-3.10.24.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|