siat 3.10.130__py3-none-any.whl → 3.10.131__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 CHANGED
@@ -4923,6 +4923,11 @@ if __name__ == '__main__':
4923
4923
  # 注意:上面的await命令会导致编译失败,测试后要注释掉
4924
4924
 
4925
4925
  #==============================================================================
4926
+ if __name__ == '__main__':
4927
+ # 定义 Notebook 路径和输出 PDF 路径
4928
+ notebook_dir = r"E:\北外工作-25春\SICA-BFSU\Session 2" # 替换为你的 Notebook 文件路径
4929
+ notebook_file= r"Session 2-Market index v3en" # 替换为你想保存的 PDF 文件路径
4930
+
4926
4931
  async def jupyter2pdf2(notebook_dir, notebook_file):
4927
4932
  """
4928
4933
  ===========================================================================
@@ -4947,6 +4952,8 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4947
4952
  else:
4948
4953
  sep='\\'
4949
4954
 
4955
+ #import os; sep=os.sep
4956
+
4950
4957
  # ipynb文件的完整路径
4951
4958
  if ('.ipynb' in notebook_file):
4952
4959
  notebook_file1=notebook_file.replace('.ipynb','')
@@ -4958,11 +4965,17 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4958
4965
  output_pdf_path1=notebook_dir+sep+notebook_file1+'A4.pdf'
4959
4966
  output_pdf_path2=notebook_dir+sep+notebook_file1+'A3.pdf'
4960
4967
 
4961
- import os
4968
+ import os,sys
4962
4969
  from nbconvert import HTMLExporter
4963
4970
 
4971
+ """
4972
+ import nest_asyncio
4973
+ nest_asyncio.apply() # 修复 Notebook 的事件循环问题
4974
+ """
4975
+
4964
4976
  try:
4965
4977
  from playwright.async_api import async_playwright
4978
+ #from playwright.sync_api import sync_playwright
4966
4979
  except:
4967
4980
  print(" #Warning(jupyter2pdf2): playwright seems not fully installed yet")
4968
4981
  print(" [Solution] execute the command before re-run: playwright install")
@@ -4993,17 +5006,35 @@ async def jupyter2pdf2(notebook_dir, notebook_file):
4993
5006
  await page.goto(f"file://{os.path.abspath(html_file)}")
4994
5007
 
4995
5008
  # 避免加载html文件超时,用于macOS
4996
- page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5009
+ if not sys.platform.startswith('win'):
5010
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
4997
5011
 
4998
5012
  await page.pdf(path=output_pdf_path1, format='A4')
4999
5013
  await page.pdf(path=output_pdf_path2, format='A3')
5000
5014
 
5001
5015
  await browser.close()
5002
-
5003
- print(f"2 PDF created in the same directory, pick 1 you think best")
5016
+ """
5017
+ with sync_playwright() as p:
5018
+ browser = p.chromium.launch()
5019
+ page = browser.new_page()
5020
+ page.goto(f"file://{os.path.abspath(html_file)}")
5021
+
5022
+ # 避免加载html文件超时,用于macOS
5023
+ if not sys.platform.startswith('win'):
5024
+ page.wait_for_selector(".jp-Notebook", state="visible", timeout=60000) # 等待笔记本主体出现
5025
+
5026
+ page.pdf(path=output_pdf_path1, format='A4')
5027
+ page.pdf(path=output_pdf_path2, format='A3')
5028
+
5029
+ browser.close()
5030
+ """
5031
+
5032
+ print(f"2 PDFs created in the same directory, pick 1 you think best")
5004
5033
 
5005
5034
  except Exception as e:
5006
- print(f"PDF conversion failed because {e}")
5035
+ if str(e)=='':
5036
+ e="because of issues in your playwright or Python environment"
5037
+ print(f"PDF conversion failed {e}")
5007
5038
  return
5008
5039
 
5009
5040
  finally:
@@ -5023,106 +5054,6 @@ if __name__ == '__main__':
5023
5054
  #await jupyter2pdf2(notebook_dir, notebook_file)
5024
5055
  # 注意:上面的await命令会导致编译失败,测试后要注释掉
5025
5056
 
5026
- #==============================================================================
5027
- async def jupyter2pdf3(notebook_file):
5028
- """
5029
- ===========================================================================
5030
- 将 Jupyter Notebook 转换为 PDF 文件,异步方式。
5031
- 主要参数:
5032
- notebook_file (str): Jupyter Notebook文件名,不含目录
5033
-
5034
- 输出:
5035
- 同时生成A4和A3两种幅面的pdf文件,由使用者自行挑选一个效果最好的。
5036
- 返回:
5037
- None
5038
-
5039
- 注意1:如果指令异常,可能还要执行python -m playwright install
5040
- 注意2:调用本函数的格式是异步await开头,例如:
5041
- await jupyter2pdf3(notebook_file)
5042
-
5043
- 注意:目前无法正确获得ipynb文件的所在目录,使用使用!!!
5044
- """
5045
- # 获得路径
5046
- import os
5047
- notebook_dir=os.getcwd()
5048
- # 注意:上述指令无法获取当前Jupyter文件的目录
5049
-
5050
- # 路径分割符号
5051
- if ('/' in notebook_dir) and not ('\\' in notebook_dir):
5052
- sep='/'
5053
- else:
5054
- sep='\\'
5055
-
5056
- # ipynb文件的完整路径
5057
- if ('.ipynb' in notebook_file):
5058
- notebook_file1=notebook_file.replace('.ipynb','')
5059
- else:
5060
- notebook_file1=notebook_file
5061
- notebook_path=notebook_dir+sep+notebook_file1+'.ipynb'
5062
-
5063
- # pdf文件的完整路径
5064
- output_pdf_path1=notebook_dir+sep+notebook_file1+'A4.pdf'
5065
- output_pdf_path2=notebook_dir+sep+notebook_file1+'A3.pdf'
5066
-
5067
- from nbconvert import HTMLExporter
5068
-
5069
- try:
5070
- from playwright.async_api import async_playwright
5071
- except:
5072
- print(" #Warning(jupyter2pdf2): playwright seems not fully installed yet")
5073
- print(" [Solution] execute the command before re-run: playwright install")
5074
- return
5075
-
5076
- html_file = ""
5077
-
5078
- try:
5079
- # 导出 Notebook 为 HTML
5080
- html_exporter = HTMLExporter()
5081
- try:
5082
- html_content, _ = html_exporter.from_filename(notebook_path)
5083
- print("Converting notebook file to pdf in both A4 and A3 sizes ...")
5084
-
5085
- except:
5086
- print("File not found for {}".format(notebook_path))
5087
- return
5088
-
5089
- # 创建临时 HTML 文件
5090
- html_file = "temp_notebook.html"
5091
- with open(html_file, "w", encoding="utf-8") as f:
5092
- f.write(html_content)
5093
-
5094
- # 使用 Playwright 打开 HTML 并保存为 PDF
5095
- async with async_playwright() as p:
5096
- browser = await p.chromium.launch()
5097
- page = await browser.new_page()
5098
- await page.goto(f"file://{os.path.abspath(html_file)}")
5099
-
5100
- await page.pdf(path=output_pdf_path1, format='A4')
5101
- await page.pdf(path=output_pdf_path2, format='A3')
5102
-
5103
- await browser.close()
5104
-
5105
- print(f"2 PDF created in the same directory, pick 1 you think best")
5106
-
5107
- except Exception as e:
5108
- print(f"Conversion failed because {e}")
5109
- return
5110
-
5111
- finally:
5112
- if html_file == "":
5113
- return
5114
- # 删除临时 HTML 文件
5115
- elif os.path.exists(html_file):
5116
- os.remove(html_file)
5117
-
5118
- return
5119
-
5120
- if __name__ == '__main__':
5121
- # 替换为你想转存PDF的Notebook文件名
5122
- file = "Session 1 全球证券市场-简化版.ipynb"
5123
- #await jupyter2pdf3(file)
5124
- # 注意:上面的await命令会导致编译失败,测试后要注释掉
5125
-
5126
5057
  #==============================================================================
5127
5058
  if __name__ == '__main__':
5128
5059
  df=security_trend("600519.SS",indicator=['Close','Open','High','Low'],graph=False)
File without changes
siat/fund_china.pickle CHANGED
File without changes
siat/market_china.py CHANGED
@@ -442,6 +442,12 @@ def market_detail_exchange_china(exchange='SSE',category='price'):
442
442
  except:
443
443
  print(" #Error(market_detail_exchange_china): info unavailable for",exchange,"\b, try again later")
444
444
  return None
445
+
446
+ # 检查东方财富抓取限制
447
+ if len(df0) <= 100:
448
+ print(" #Warning(market_detail_exchange_china): web scraping restricted to 100 records by data source")
449
+ print(" Solution: upgrade akshare (pip install akshare --upgrade), restart Python kernel, run again")
450
+ return None
445
451
 
446
452
  #DEBUG
447
453
  #print(" Check1:",len(df0))
siat/stock_info.pickle CHANGED
File without changes
@@ -1,235 +1,227 @@
1
- Metadata-Version: 2.4
2
- Name: siat
3
- Version: 3.10.130
4
- Summary: Securities Investment Analysis Tools (siat)
5
- Home-page: https://pypi.org/project/siat/
6
- Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
7
- Author-email: wdehong2000@163.com
8
- License: Copyright (C) WANG Dehong, 2025. For educational purpose only!
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Requires-Dist: pandas_datareader
12
- Requires-Dist: yfinance
13
- Requires-Dist: tqdm
14
- Requires-Dist: plotly_express
15
- Requires-Dist: akshare
16
- Requires-Dist: urllib3
17
- Requires-Dist: mplfinance
18
- Requires-Dist: statsmodels
19
- Requires-Dist: yahoo_earnings_calendar
20
- Requires-Dist: pypinyin
21
- Requires-Dist: seaborn
22
- Requires-Dist: scipy
23
- Requires-Dist: pandas
24
- Requires-Dist: scikit-learn
25
- Requires-Dist: baostock
26
- Requires-Dist: pyproject.toml
27
- Requires-Dist: pathlib
28
- Requires-Dist: ruamel-yaml
29
- Requires-Dist: prettytable
30
- Requires-Dist: graphviz
31
- Requires-Dist: luddite
32
- Requires-Dist: pendulum
33
- Requires-Dist: itables
34
- Requires-Dist: py_trans
35
- Requires-Dist: bottleneck
36
- Requires-Dist: translate
37
- Requires-Dist: translators
38
- Requires-Dist: nbconvert
39
- Requires-Dist: ipywidgets
40
- Requires-Dist: yahooquery==2.3.7
41
- Requires-Dist: lxml==4.9.4
42
- Requires-Dist: alpha_vantage
43
- Requires-Dist: tiingo[pandas]
44
- Requires-Dist: numpy<2
45
- Dynamic: author
46
- Dynamic: author-email
47
- Dynamic: description
48
- Dynamic: description-content-type
49
- Dynamic: home-page
50
- Dynamic: license
51
- Dynamic: license-file
52
- Dynamic: requires-dist
53
- Dynamic: summary
54
-
55
-
56
- # What is siat?
57
- siat is a Python 3 plug-in for security investment analysis, primarily designed for teaching and learning purposes in universities for undergraduate and postgraduate programs.
58
-
59
- siat is recommended to run in Jupyter Notebook or Jupyter Lab, and most of its results are in the forms of figures and/or tables.
60
- # Version naming
61
- Version structure: X.Y.Z
62
-
63
- X is the major version for architecture upgrade only.
64
- Y is the functional version for functional enhancements.
65
- Z is the minor version just for bug fixing.
66
-
67
- # Quick examples of using siat
68
-
69
-
70
- ```python
71
- # Enable siat
72
- from siat import *
73
- ```
74
-
75
-
76
- ```python
77
- # Set language to English, default is Chinese
78
- set_language("English")
79
- ```
80
-
81
- ## Example 1: Apple stock price for the recent month
82
-
83
-
84
- ```python
85
- # Simple way: show Apple's stock price in recent month
86
- apple=security_trend("AAPL")
87
- ```
88
- You may expect more information, such as price trend in a recent year (MRY), with the high/low point, current price and average price, like below:
89
-
90
- ```python
91
- apple=security_trend("AAPL", start="MRY",
92
- mark_top=True, mark_bottom=True, mark_end=True,
93
- average_value=True)
94
- ```
95
-
96
- ## Example 2: Comparing Price changes among Apple, Microsoft and NVidia
97
- You may expect compare the price changes for the recent quarter (MRQ) for the three stocks.
98
-
99
- Since there is a major stock split for NVidia in 2024 by 1:10, it is necessary to use adjusted prices (Adj Close) to compare these stock prices.
100
-
101
- ```python
102
- comp=security_trend(['AAPL','MSFT','NVDA'],
103
- start='MRQ',
104
- indicator='Adj Close',
105
- preprocess='scaling', #use scaling drawing method to avoid loss of details
106
- mark_top=True, mark_bottom=True,
107
- annotate=True, annotate_value=True)
108
- ```
109
-
110
- ## Example 4: Bollinger band for Apple in the recent quarter
111
-
112
-
113
- ```python
114
- # security_technical only supports 4 popular technical indicators: MACD, Bollinger, KDJ and RSI.
115
- apple=security_technical("AAPL",
116
- technical="Bollinger",
117
- start="MRQ",
118
- facecolor="white",
119
- loc1="upper left", loc2="lower right")
120
- ```
121
-
122
- ## Example 5: CCI for Apple in recent quarter
123
-
124
-
125
- ```python
126
- # security_technical2 supports up to 14 popular technical indicators.
127
- # security_technical2 uses a simplied drawing method (Dehong graph) to avoid trypophobia [ˌtrɪpəu'fəʊbjə]
128
- apple=security_technical2("AAPL",
129
- technical="CCI",
130
- start="MRM",
131
- loc1="upper left", loc2="lower right")
132
- ```
133
-
134
- # What security products does siat support?
135
- 1. Public company profile: world-wide
136
- 2. Stock & stock market index: world-wide
137
- 3. Stock valuation: primarily in China (mainland and HK) and the U.S.
138
- 4. Stock option chain: primarily in the U.S.
139
- 5. Bond: primarily in China and the U.S.
140
- 6. Markowitz portfolio: with all the supported stocks and bonds
141
- 7. Fund: primarily in China and the U.S.
142
- 8. Futures: primarily in China and the U.S.
143
- 9. Options: primarily in China and the U.S.
144
- 10. Digital currency: world-wide (some may be restricted by data sources)
145
- 11. Balance sheet: in China (full function) and world-wide (basic function)
146
- 12. Income statement: in China mainland (full function) and world-wide (basic function)
147
- 13. Cash flow statement: in China mainland (full function) and world-wide (basic function)
148
- 14. DuPont Identity: world-wide
149
- 15. Sector trend and valuation: primarily in China
150
- # What analytical methods does siat support?
151
- 1. Trend analysis
152
- 2. Panel comparation
153
- 3. Return analysis: rolling returns, holding period returns
154
- 4. Risk analysis: rolling volatility, holding period volatility, LPSD
155
- 5. Technical analysis: more than 15 indicators
156
- 6. Risk-adjusted return: Sharpe ratio, Sortino ratio, Treynor ratio, Jensen alpha
157
- 7. Portfolio optimization: four risk-adjusted returns
158
- 8. CAPM beta trend
159
- 9. Beta adjustments: simple adjustment, Scholes-Williams, Dimson
160
- 10. Beta leverage: Hamada Model
161
- 11. Fama-French three-factor model
162
- 12. Fama-French-Carhart four-factor model
163
- 13. Fama-French five-factor model
164
- 14. Future pricing
165
- 15. Option pricing: European style, American style, with/without dividends
166
- 16. VaR & ES: variance-covariance, historic simulation, Monte Carlo, multiple periods
167
- 17. Liquidity risk: Roll spread, Amihud, Pastor-Stambaugh
168
- 18. ESG: basic functions
169
- # Do I have to download data first before using siat?
170
- NO!
171
- siat will search the internet data sources for all the required data during analysis.
172
- The main data sources siat uses:
173
- 1. Yahoo Finance
174
- 2. Sina Finance
175
- 3. East Money
176
- 4. Stooq (Polish)
177
- 5. FRED
178
- 6. OECD
179
- 7. IMF
180
- 8. Shanghai Stock Exchange
181
- 9. Shenzhen Stock Exchange
182
- 10. Hong Kong Stock Exchange
183
- 11. Beijing Stock Exchange
184
- 12. Tokyo Stock Exchange
185
- 13. London Stock Exchange
186
- 14. New York Stock Exchange
187
- 15. NASDAQ
188
- 16. Sustainalytics
189
-
190
- Thanks the above websites for their valuable data!
191
- # How to install siat?
192
- The author strongly recommends using siat together with Jupyter Notebook or Jupyter Lab in Anaconda.
193
- In order to install siat for the very first time, open a Jupyter Notebook, and type in the following command:
194
-
195
- !pip install siat
196
-
197
- If the above method does not work, something might be wrong in your Python path settings. Try to open an Anaconda Prompt in Windows or a Terminal App in Mac or Linux, and type in the following command:
198
-
199
- pip install siat
200
- # How to upgrade siat?
201
- In Jupyter Notebook or Jupyter Lab:
202
-
203
- upgrade_siat()
204
-
205
- If you suffer from slow internet connection (often in campus classrooms with many students), try to use alternative sources, such as:
206
-
207
- upgrade_siat(alternative="tsinghua")
208
-
209
- upgrade_siat(alternative="alibaba")
210
-
211
- If the above methods do not work for your environment, you have to goto the traditional ways to use command-line script, such as:
212
-
213
- pip install --upgrade siat
214
-
215
- *** For users in China
216
- The pypi mirror websites may provide siat installing and upgrading in a much faster speed in the following commands: taking aliyun as an example
217
-
218
- pip install siat -i https://mirrors.aliyun.com/pypi/simple/
219
-
220
- pip install --upgrade siat https://mirrors.aliyun.com/pypi/simple/
221
-
222
- *** Warning
223
- 1. The pip command itself may need upgrade as well.
224
- 2. The pip command sometimes may have conflicts with some vpn programs.
225
- If in this case, try quit vpn program first, and try again.
226
- # Are there more detailed case studies on using siat?
227
- YES!
228
-
229
- There are hundreds of video case studies in the author's channel (most in Chinese, some in English).
230
-
231
- https://space.bilibili.com/284812153
232
-
233
- Welcome to follow the channel!
234
- # How to report a bug or look for help?
235
- Write to the author, Prof. WANG Dehong, wdehong2000@163.com
1
+ Metadata-Version: 2.1
2
+ Name: siat
3
+ Version: 3.10.131
4
+ Summary: Securities Investment Analysis Tools (siat)
5
+ Home-page: https://pypi.org/project/siat/
6
+ Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
7
+ Author-email: wdehong2000@163.com
8
+ License: Copyright (C) WANG Dehong, 2025. For educational purpose only!
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: pandas-datareader
12
+ Requires-Dist: yfinance
13
+ Requires-Dist: tqdm
14
+ Requires-Dist: plotly-express
15
+ Requires-Dist: akshare
16
+ Requires-Dist: urllib3
17
+ Requires-Dist: mplfinance
18
+ Requires-Dist: statsmodels
19
+ Requires-Dist: yahoo-earnings-calendar
20
+ Requires-Dist: pypinyin
21
+ Requires-Dist: seaborn
22
+ Requires-Dist: scipy
23
+ Requires-Dist: pandas
24
+ Requires-Dist: scikit-learn
25
+ Requires-Dist: baostock
26
+ Requires-Dist: pyproject.toml
27
+ Requires-Dist: pathlib
28
+ Requires-Dist: ruamel-yaml
29
+ Requires-Dist: prettytable
30
+ Requires-Dist: graphviz
31
+ Requires-Dist: luddite
32
+ Requires-Dist: pendulum
33
+ Requires-Dist: itables
34
+ Requires-Dist: py-trans
35
+ Requires-Dist: bottleneck
36
+ Requires-Dist: translate
37
+ Requires-Dist: translators
38
+ Requires-Dist: nbconvert
39
+ Requires-Dist: ipywidgets ==8.1.6
40
+ Requires-Dist: yahooquery ==2.3.7
41
+ Requires-Dist: lxml ==4.9.4
42
+ Requires-Dist: alpha-vantage
43
+ Requires-Dist: tiingo[pandas]
44
+ Requires-Dist: numpy <2
45
+ Requires-Dist: playwright
46
+
47
+
48
+ # What is siat?
49
+ siat is a Python 3 plug-in for security investment analysis, primarily designed for teaching and learning purposes in universities for undergraduate and postgraduate programs.
50
+
51
+ siat is recommended to run in Jupyter Notebook or Jupyter Lab, and most of its results are in the forms of figures and/or tables.
52
+ # Version naming
53
+ Version structure: X.Y.Z
54
+
55
+ X is the major version for architecture upgrade only.
56
+ Y is the functional version for functional enhancements.
57
+ Z is the minor version just for bug fixing.
58
+
59
+ # Quick examples of using siat
60
+
61
+
62
+ ```python
63
+ # Enable siat
64
+ from siat import *
65
+ ```
66
+
67
+
68
+ ```python
69
+ # Set language to English, default is Chinese
70
+ set_language("English")
71
+ ```
72
+
73
+ ## Example 1: Apple stock price for the recent month
74
+
75
+
76
+ ```python
77
+ # Simple way: show Apple's stock price in recent month
78
+ apple=security_trend("AAPL")
79
+ ```
80
+ You may expect more information, such as price trend in a recent year (MRY), with the high/low point, current price and average price, like below:
81
+
82
+ ```python
83
+ apple=security_trend("AAPL", start="MRY",
84
+ mark_top=True, mark_bottom=True, mark_end=True,
85
+ average_value=True)
86
+ ```
87
+
88
+ ## Example 2: Comparing Price changes among Apple, Microsoft and NVidia
89
+ You may expect compare the price changes for the recent quarter (MRQ) for the three stocks.
90
+
91
+ Since there is a major stock split for NVidia in 2024 by 1:10, it is necessary to use adjusted prices (Adj Close) to compare these stock prices.
92
+
93
+ ```python
94
+ comp=security_trend(['AAPL','MSFT','NVDA'],
95
+ start='MRQ',
96
+ indicator='Adj Close',
97
+ preprocess='scaling', #use scaling drawing method to avoid loss of details
98
+ mark_top=True, mark_bottom=True,
99
+ annotate=True, annotate_value=True)
100
+ ```
101
+
102
+ ## Example 4: Bollinger band for Apple in the recent quarter
103
+
104
+
105
+ ```python
106
+ # security_technical only supports 4 popular technical indicators: MACD, Bollinger, KDJ and RSI.
107
+ apple=security_technical("AAPL",
108
+ technical="Bollinger",
109
+ start="MRQ",
110
+ facecolor="white",
111
+ loc1="upper left", loc2="lower right")
112
+ ```
113
+
114
+ ## Example 5: CCI for Apple in recent quarter
115
+
116
+
117
+ ```python
118
+ # security_technical2 supports up to 14 popular technical indicators.
119
+ # security_technical2 uses a simplied drawing method (Dehong graph) to avoid trypophobia [藢tr瑟p蓹u'f蓹蕣bj蓹]
120
+ apple=security_technical2("AAPL",
121
+ technical="CCI",
122
+ start="MRM",
123
+ loc1="upper left", loc2="lower right")
124
+ ```
125
+
126
+ # What security products does siat support?
127
+ 1. Public company profile: world-wide
128
+ 2. Stock & stock market index: world-wide
129
+ 3. Stock valuation: primarily in China (mainland and HK) and the U.S.
130
+ 4. Stock option chain: primarily in the U.S.
131
+ 5. Bond: primarily in China and the U.S.
132
+ 6. Markowitz portfolio: with all the supported stocks and bonds
133
+ 7. Fund: primarily in China and the U.S.
134
+ 8. Futures: primarily in China and the U.S.
135
+ 9. Options: primarily in China and the U.S.
136
+ 10. Digital currency: world-wide (some may be restricted by data sources)
137
+ 11. Balance sheet: in China (full function) and world-wide (basic function)
138
+ 12. Income statement: in China mainland (full function) and world-wide (basic function)
139
+ 13. Cash flow statement: in China mainland (full function) and world-wide (basic function)
140
+ 14. DuPont Identity: world-wide
141
+ 15. Sector trend and valuation: primarily in China
142
+ # What analytical methods does siat support?
143
+ 1. Trend analysis
144
+ 2. Panel comparation
145
+ 3. Return analysis: rolling returns, holding period returns
146
+ 4. Risk analysis: rolling volatility, holding period volatility, LPSD
147
+ 5. Technical analysis: more than 15 indicators
148
+ 6. Risk-adjusted return: Sharpe ratio, Sortino ratio, Treynor ratio, Jensen alpha
149
+ 7. Portfolio optimization: four risk-adjusted returns
150
+ 8. CAPM beta trend
151
+ 9. Beta adjustments: simple adjustment, Scholes-Williams, Dimson
152
+ 10. Beta leverage: Hamada Model
153
+ 11. Fama-French three-factor model
154
+ 12. Fama-French-Carhart four-factor model
155
+ 13. Fama-French five-factor model
156
+ 14. Future pricing
157
+ 15. Option pricing: European style, American style, with/without dividends
158
+ 16. VaR & ES: variance-covariance, historic simulation, Monte Carlo, multiple periods
159
+ 17. Liquidity risk: Roll spread, Amihud, Pastor-Stambaugh
160
+ 18. ESG: basic functions
161
+ # Do I have to download data first before using siat?
162
+ NO!
163
+ siat will search the internet data sources for all the required data during analysis.
164
+ The main data sources siat uses:
165
+ 1. Yahoo Finance
166
+ 2. Sina Finance
167
+ 3. East Money
168
+ 4. Stooq (Polish)
169
+ 5. FRED
170
+ 6. OECD
171
+ 7. IMF
172
+ 8. Shanghai Stock Exchange
173
+ 9. Shenzhen Stock Exchange
174
+ 10. Hong Kong Stock Exchange
175
+ 11. Beijing Stock Exchange
176
+ 12. Tokyo Stock Exchange
177
+ 13. London Stock Exchange
178
+ 14. New York Stock Exchange
179
+ 15. NASDAQ
180
+ 16. Sustainalytics
181
+
182
+ Thanks the above websites for their valuable data!
183
+ # How to install siat?
184
+ The author strongly recommends using siat together with Jupyter Notebook or Jupyter Lab in Anaconda.
185
+ In order to install siat for the very first time, open a Jupyter Notebook, and type in the following command:
186
+
187
+ !pip install siat
188
+
189
+ If the above method does not work, something might be wrong in your Python path settings. Try to open an Anaconda Prompt in Windows or a Terminal App in Mac or Linux, and type in the following command:
190
+
191
+ pip install siat
192
+ # How to upgrade siat?
193
+ In Jupyter Notebook or Jupyter Lab:
194
+
195
+ upgrade_siat()
196
+
197
+ If you suffer from slow internet connection (often in campus classrooms with many students), try to use alternative sources, such as:
198
+
199
+ upgrade_siat(alternative="tsinghua")
200
+
201
+ upgrade_siat(alternative="alibaba")
202
+
203
+ If the above methods do not work for your environment, you have to goto the traditional ways to use command-line script, such as:
204
+
205
+ pip install --upgrade siat
206
+
207
+ *** For users in China
208
+ The pypi mirror websites may provide siat installing and upgrading in a much faster speed in the following commands: taking aliyun as an example
209
+
210
+ pip install siat -i https://mirrors.aliyun.com/pypi/simple/
211
+
212
+ pip install --upgrade siat https://mirrors.aliyun.com/pypi/simple/
213
+
214
+ *** Warning
215
+ 1. The pip command itself may need upgrade as well.
216
+ 2. The pip command sometimes may have conflicts with some vpn programs.
217
+ If in this case, try quit vpn program first, and try again.
218
+ # Are there more detailed case studies on using siat?
219
+ YES!
220
+
221
+ There are hundreds of video case studies in the author's channel (most in Chinese, some in English).
222
+
223
+ https://space.bilibili.com/284812153
224
+
225
+ Welcome to follow the channel!
226
+ # How to report a bug or look for help?
227
+ Write to the author, Prof. WANG Dehong, wdehong2000@163.com
@@ -10,7 +10,7 @@ siat/bond_china.py,sha256=WzUhjYYk8tsr3BDWLQcpuj9DqNxTzBSIi_wuAOZ48kY,3082
10
10
  siat/bond_zh_sina.py,sha256=26BohGcS120utwqg9dJvdGm5OkuNpNu5bco80uOuQpU,4423
11
11
  siat/capm_beta.py,sha256=t8-xr90II0JzbjsTOZNpRze_mKTvBRXjwN2o0N0tgD8,30521
12
12
  siat/capm_beta2.py,sha256=4g8pOFCwFrEpLx2NJbhL2nl_nrWaOwgbPCHx1G6P_tI,35949
13
- siat/common.py,sha256=sml-hCMfC4mSkdpURrI5UbkUudvq2FpFlsilwTO3ojw,191049
13
+ siat/common.py,sha256=x2NeGGST15qG42oLo2R9r1LyZOPxMIMTnzjLe6z6rdc,188811
14
14
  siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
15
15
  siat/copyrights.py,sha256=YMLjZb328YpFMR-s_GUu0HBgeGce3pV7DgRut8S3I7w,690
16
16
  siat/cryptocurrency.py,sha256=QSc4jK9VFlqBWVu-0th1BIMt8wC-5R5sWky3EaNupy0,27940
@@ -35,7 +35,7 @@ siat/google_authenticator.py,sha256=ZUbZR8OW0IAKDbcYtlqGqIpZdERpFor9NccFELxg9yI,
35
35
  siat/grafix.py,sha256=HSCBSAvoYpP-WcuThvwiQ1--bba9_mtPu4y5X5WBk4A,145099
36
36
  siat/holding_risk.py,sha256=SCHVxRBEhseUrgMpsnvR9Pt6ns-V-voRl3hCuK1p5y4,31114
37
37
  siat/luchy_draw.py,sha256=8Ue-NKnvSVqINPY1eXat0NJat5MR-gex_K62aOYFdmA,20486
38
- siat/market_china.py,sha256=6UcOdLl842Mkwwg8wPW9rPyq6On0UJxpdAC431KkK10,51441
38
+ siat/market_china.py,sha256=d8bHryhMJti5dqz7-XfuVgbOIoqo5dBg-UWz6-f82UE,51757
39
39
  siat/markowitz.py,sha256=PtQ_6rLyh5SEXyO7SCDyYChcgXl6ddcdgQ06HETjDVE,97990
40
40
  siat/markowitz2.py,sha256=wjmfvsFYXPz3nhnhDi7S9D_V6iCyXniquW2uvxgpe5c,125857
41
41
  siat/markowitz_simple.py,sha256=aJVvx669ngcCsqoQtA9kvFOQVjsuipYt2fyTc4yMItE,14286
@@ -69,8 +69,8 @@ siat/valuation.py,sha256=xGizcKJZ3ADLWWHm2TFQub18FxiDv2doQwBwbEqyqz0,51980
69
69
  siat/valuation_china.py,sha256=eSKIDckyjG8QkENlW_OKkqbQHno8pzDcomBO9iGNJVM,83079
70
70
  siat/var_model_validation.py,sha256=loqziBYO2p0xkeWm3Rb1rJsDhbcgAZ5aR9rBLRwLU5E,17624
71
71
  siat/yf_name.py,sha256=laNKMTZ9hdenGX3IZ7G0a2RLBKEWtUQJFY9CWuk_fp8,24058
72
- siat-3.10.130.dist-info/licenses/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
73
- siat-3.10.130.dist-info/METADATA,sha256=UtaFN9zzPG7iEXV5vwZOaTnYBD6r3PIPsrAj_x3LjWI,8176
74
- siat-3.10.130.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
- siat-3.10.130.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
76
- siat-3.10.130.dist-info/RECORD,,
72
+ siat-3.10.131.dist-info/LICENSE,sha256=NTEMMROY9_4U1szoKC3N2BLHcDd_o5uTgqdVH8tbApw,1071
73
+ siat-3.10.131.dist-info/METADATA,sha256=dn1zkJ9eec1lfHFwSuzpXGmJEBUfXtFHFB68R7iRnlY,8255
74
+ siat-3.10.131.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
75
+ siat-3.10.131.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
76
+ siat-3.10.131.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5