siat 3.8.45__py3-none-any.whl → 3.8.47__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/financials_china.py +15 -11
- {siat-3.8.45.dist-info → siat-3.8.47.dist-info}/METADATA +3 -3
- {siat-3.8.45.dist-info → siat-3.8.47.dist-info}/RECORD +6 -6
- {siat-3.8.45.dist-info → siat-3.8.47.dist-info}/LICENSE +0 -0
- {siat-3.8.45.dist-info → siat-3.8.47.dist-info}/WHEEL +0 -0
- {siat-3.8.45.dist-info → siat-3.8.47.dist-info}/top_level.txt +0 -0
siat/financials_china.py
CHANGED
@@ -3432,6 +3432,9 @@ if __name__=='__main__':
|
|
3432
3432
|
ticker='600305.SS'
|
3433
3433
|
fsdates=['2023-6-30','2022-6-30','2021-6-30']
|
3434
3434
|
|
3435
|
+
ticker='002352.SZ'
|
3436
|
+
fsdates=['2024-12-31','2023-12-31','2022-12-31']
|
3437
|
+
|
3435
3438
|
fsdf1=get_fin_summary_1ticker_china(ticker,fsdates)
|
3436
3439
|
|
3437
3440
|
def get_fin_summary_1ticker_china(ticker,fsdates):
|
@@ -3882,6 +3885,7 @@ def get_fin_indicator_1ticker_china(ticker,fsdates):
|
|
3882
3885
|
d2=d1.strftime("%Y-%m-%d")
|
3883
3886
|
fsdates2=fsdates2 + [d2]
|
3884
3887
|
fsdates3=sorted(fsdates2,reverse=True)
|
3888
|
+
start_year=fsdates3[-1][:4]
|
3885
3889
|
|
3886
3890
|
# 亿元
|
3887
3891
|
yiyuan=float(1e+08)
|
@@ -3889,20 +3893,20 @@ def get_fin_indicator_1ticker_china(ticker,fsdates):
|
|
3889
3893
|
# 获得股票所有财报数据
|
3890
3894
|
_,t1,_=split_prefix_suffix(ticker)
|
3891
3895
|
try:
|
3892
|
-
dft=ak.stock_financial_analysis_indicator(t1)
|
3896
|
+
dft=ak.stock_financial_analysis_indicator(t1,start_year=start_year)
|
3893
3897
|
dft['日期']=dft['日期'].apply(lambda x: x.strftime("%Y-%m-%d"))
|
3894
3898
|
dft.sort_values(by=['日期'],ascending=False,inplace=True)
|
3895
3899
|
except:
|
3896
|
-
print(" #Error(
|
3900
|
+
print(" #Error(get_fin_indicator_1ticker_china): no info found for",ticker)
|
3897
3901
|
return None
|
3898
3902
|
|
3899
3903
|
# 过滤财报日期
|
3900
3904
|
fsdate_field=list(dft)[0]
|
3901
3905
|
dft2=dft[dft[fsdate_field].isin(fsdates3)]
|
3902
3906
|
if len(dft2) < len(fsdates3):
|
3903
|
-
print(" #Warning(
|
3907
|
+
print(" #Warning(get_fin_indicator_1ticker_china): info of some dates unavailable for",ticker+'('+ticker_name(ticker,'stock')+')')
|
3904
3908
|
if len(dft2) ==0:
|
3905
|
-
print(" #Error(
|
3909
|
+
print(" #Error(get_fin_indicator_1ticker_china): no info found for",ticker+'('+ticker_name(ticker,'stock')+') on',fsdates)
|
3906
3910
|
return None
|
3907
3911
|
|
3908
3912
|
# 去掉重复行
|
@@ -4063,32 +4067,32 @@ def compare_fin_indicator_china(tickers,fsdates,facecolor='papayawhip',font_size
|
|
4063
4067
|
tickers=[tickers]
|
4064
4068
|
tickers=list(tickers) #强制转换
|
4065
4069
|
if len(tickers)==0:
|
4066
|
-
print(" #Error(
|
4070
|
+
print(" #Error(compare_fin_indicator_china): need at least one stock in",tickers)
|
4067
4071
|
return None
|
4068
4072
|
|
4069
4073
|
# 检查财报日期列表
|
4070
4074
|
if isinstance(fsdates,str):
|
4071
4075
|
fsdates=[fsdates]
|
4072
4076
|
if len(fsdates)==0:
|
4073
|
-
print(" #Error(
|
4077
|
+
print(" #Error(compare_fin_indicator_china): need at least one date in",fsdates)
|
4074
4078
|
return None
|
4075
4079
|
|
4076
4080
|
for d in fsdates:
|
4077
4081
|
result,_,_=check_period(d,d)
|
4078
4082
|
if not result:
|
4079
|
-
print(" #Error(
|
4083
|
+
print(" #Error(compare_fin_indicator_china): invalid date",d)
|
4080
4084
|
return None
|
4081
4085
|
|
4082
4086
|
# 获取财报数据
|
4083
|
-
print("Searching for financial statements, please wait ...")
|
4087
|
+
print(" Searching for financial statements, please wait ...")
|
4084
4088
|
fsdf=get_fin_indicator_china(tickers,fsdates)
|
4085
4089
|
if fsdf is None:
|
4086
|
-
print(" #Error(
|
4090
|
+
print(" #Error(compare_fin_indicator_china): none record found for above tickers on",fsdates[0])
|
4087
4091
|
print(" Reasons: either wrong tickers or dates, or blocked by data source, try later")
|
4088
4092
|
return None
|
4089
4093
|
if len(fsdf) == 0:
|
4090
|
-
print(" #Warning(
|
4091
|
-
print(" Reasons:
|
4094
|
+
print(" #Warning(compare_fin_indicator_china): zero recrod found for above tickers on",fsdates[0])
|
4095
|
+
print(" Reasons: wrong tickers or dates, or blocked by data source, try later")
|
4092
4096
|
return None
|
4093
4097
|
|
4094
4098
|
# 不改变列表顺序去重
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: siat
|
3
|
-
Version: 3.8.
|
3
|
+
Version: 3.8.47
|
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
|
@@ -37,9 +37,9 @@ Requires-Dist: bottleneck
|
|
37
37
|
Requires-Dist: translate
|
38
38
|
Requires-Dist: translators
|
39
39
|
Requires-Dist: nbconvert
|
40
|
-
Requires-Dist: ipywidgets
|
40
|
+
Requires-Dist: ipywidgets==8.1.6
|
41
41
|
Requires-Dist: playwright
|
42
|
-
Requires-Dist: yahooquery
|
42
|
+
Requires-Dist: yahooquery==2.3.7
|
43
43
|
Dynamic: author
|
44
44
|
Dynamic: author-email
|
45
45
|
Dynamic: description
|
@@ -45,7 +45,7 @@ siat/financial_statements_test.py,sha256=FLhx8JD-tVVWSBGux6AMz1jioXX4U4bp9DmgFHY
|
|
45
45
|
siat/financials.py,sha256=hcXcwozYhfMtW6cTE2bDp5R80-IEKAyUHFO6mJ87GXQ,86267
|
46
46
|
siat/financials2 - 副本.py,sha256=dKlNjIfKeoSy055fQ6E6TUj9HEoO5Ney9grD84J5kfk,14389
|
47
47
|
siat/financials2.py,sha256=YF-A-5iSTzLXTFI0sDGju4_6T87wWC9IlFd4fSXbJXw,50805
|
48
|
-
siat/financials_china.py,sha256=
|
48
|
+
siat/financials_china.py,sha256=EoniZSm8MumdWVn3mMiXU7dU9ePHGO27y1MWNeD3Jjc,192083
|
49
49
|
siat/financials_china2.py,sha256=VvkzkjZeH84zwypR7ReldgJeZ7jnNw0qkzebvWMPm10,94956
|
50
50
|
siat/financials_china2_test.py,sha256=Erz5k4LyOplBBvYls2MypuqHpVNJ3daiLdyeJezNPu0,2722
|
51
51
|
siat/financials_china2_test2.py,sha256=C8CuYTMHN4Mhp-sTu-Bmg0zMXRCaYV6ezGDoYartRYQ,3507
|
@@ -144,8 +144,8 @@ siat/valuation_china.py,sha256=eSKIDckyjG8QkENlW_OKkqbQHno8pzDcomBO9iGNJVM,83079
|
|
144
144
|
siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
145
145
|
siat/var_model_validation.py,sha256=R0caWnuZarrRg9939hxh3vJIIpIyPfvelYmzFNZtPbo,14910
|
146
146
|
siat/yf_name.py,sha256=laNKMTZ9hdenGX3IZ7G0a2RLBKEWtUQJFY9CWuk_fp8,24058
|
147
|
-
siat-3.8.
|
148
|
-
siat-3.8.
|
149
|
-
siat-3.8.
|
150
|
-
siat-3.8.
|
151
|
-
siat-3.8.
|
147
|
+
siat-3.8.47.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
|
148
|
+
siat-3.8.47.dist-info/METADATA,sha256=eKIe_omdvLIcplc-2zHn7EcSKY5NfotVoBaojchZDgM,8335
|
149
|
+
siat-3.8.47.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
150
|
+
siat-3.8.47.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
151
|
+
siat-3.8.47.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|