siat 3.0.20__py3-none-any.whl → 3.0.25__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
@@ -3755,35 +3755,60 @@ def df_display_CSS(df,titletxt='',footnote='',facecolor='papayawhip',decimals=2,
3755
3755
  return
3756
3756
 
3757
3757
  #==============================================================================
3758
- def upgrade_siat():
3758
+ if __name__=='__main__':
3759
+ upgrade_siat()
3760
+
3761
+ def upgrade_siat(module_list=['siat','akshare','pandas','pandas_datareader', \
3762
+ 'yfinance','yahooquery','urllib3','twine'], \
3763
+ pipcmd="pip install --upgrade"):
3759
3764
  """
3760
3765
  功能:一次性升级siat及其相关插件
3761
3766
 
3762
- 注意:在Spyder中可用,但在Jupyter中不能用,可能是路径问题!
3767
+ 注意:pip的路径问题!
3763
3768
  """
3764
- #系统路径
3769
+ print(" Try upgrading siat and related modules, please wait ... ...")
3770
+ #获取系统目录
3765
3771
  import sys
3766
- python_dir=sys.path
3772
+ syspath=sys.path
3773
+
3774
+ #判断目录分隔符号
3775
+ win_sep='\\'; win_flag=False
3776
+ mac_sep='//'; mac_flag=False
3777
+
3778
+ sp_list=syspath[0].split(win_sep)
3779
+ if len(sp_list) > 1:
3780
+ win_flag=True
3781
+
3782
+ sp_list=syspath[0].split(mac_sep)
3783
+ if len(sp_list) > 1:
3784
+ win_flag=True
3767
3785
 
3768
- #插件列表
3769
- pip_list=['siat','akshare','pandas','pandas_datareader','yfinance','yahooquery']
3770
- pip_cmd='pip install --upgrade '
3786
+ if win_flag:
3787
+ sep_flag=win_sep
3788
+ else:
3789
+ sep_flag=mac_sep
3790
+
3791
+ #寻找anaconda3的安装目录
3792
+ for sp in syspath:
3793
+ sp_list=sp.split(sep_flag)
3794
+ if sp_list[-1] == 'anaconda3': break
3795
+
3796
+ #生成pip命令字符串前半段,仅缺插件名
3797
+ cmdstr=sp+sep_flag+'Scripts'+sep_flag+pipcmd+' '
3771
3798
 
3799
+ #逐个升级插件
3772
3800
  import subprocess
3773
- for p in pip_list:
3774
- print(" Upgrading",p,"\b, please wait ... ...")
3775
- command = pip_cmd + p
3776
- #result = subprocess.run(command, shell=True, text=True, capture_output=True)
3777
- result = subprocess.run(command.split(' '), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
3778
-
3779
- if result.returncode == 0:
3780
- print(' Successfully upgraded', p)
3781
- else:
3782
- print(' Upgrade failed:', result.returncode)
3783
- print(' Error message:', result.stderr)
3801
+ for m in module_list:
3802
+ cmdstr1=cmdstr+m
3803
+ #print(cmdstr1)
3804
+ #proc=subprocess.run(cmdstr1.split(' '),stdout=subprocess.PIPE)
3805
+ proc=subprocess.run(cmdstr1.split(' '))
3806
+ rcode=proc.returncode
3807
+ if rcode==0: result='successfully upgraded:-)'
3808
+ else: result='failed to upgrade, try alternative method:-('
3809
+ print(" Module:",m,'\b,',result)
3784
3810
 
3785
3811
  return
3786
-
3787
3812
  #==============================================================================
3788
3813
  #==============================================================================
3789
3814
  #==============================================================================
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.0.20
3
+ Version: 3.0.25
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
@@ -17,7 +17,7 @@ siat/capm_beta.py,sha256=cxXdRVBQBllhbfz1LeTJAIWvyRYhW54nhtNUXv4HwS0,29063
17
17
  siat/capm_beta2.py,sha256=hta-X1iWPjNbG1YYIVlQF-YvKA8An3KuEyLmUEZ3hH8,25562
18
18
  siat/capm_beta_test.py,sha256=ImR0c5mc4hIl714XmHztdl7qg8v1E2lycKyiqnFj6qs,1745
19
19
  siat/cmat_commons.py,sha256=Nj9Kf0alywaztVoMVeVVL_EZk5jRERJy8R8kBw88_Tg,38116
20
- siat/common.py,sha256=egDH2ihlNYMC8hAMQq2JRrJH8_52VenHTYeMBPnVJdI,139936
20
+ siat/common.py,sha256=s9itecI3JgX5dfrodiFHKcjs5HsOihAMVW8yaETlHMQ,140584
21
21
  siat/compare_cross.py,sha256=3iP9TH2h3w27F2ARZc7FjKcErYCzWRc-TPiymOyoVtw,24171
22
22
  siat/compare_cross_test.py,sha256=xra5XYmQGEtfIZL2h-GssdH2hLdFIhG3eoCrkDrL3gY,3473
23
23
  siat/concepts_iwencai.py,sha256=m1YEDtECRT6FqtzlKm91pt2I9d3Z_XoP59BtWdRdu8I,3061
@@ -132,7 +132,7 @@ siat/valuation.py,sha256=NKfeZMdDJOW42oLVHob6eSVBXUqlN1OCnnzwyGAst8c,48855
132
132
  siat/valuation_china.py,sha256=Tde2LzPDQy3Z7xOQQDw4ckQMPdROp_z0-GjFE6Z5_lI,67639
133
133
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
134
134
  siat/var_model_validation.py,sha256=f-oDewg7bPzyNanz_Y_jLH68NowAA3gXFehW_weKGG0,14898
135
- siat-3.0.20.dist-info/METADATA,sha256=ovHOM235JnIy97atHOdoHLFImQgA_5mlE0OP_8dEGZk,1448
136
- siat-3.0.20.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
137
- siat-3.0.20.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
138
- siat-3.0.20.dist-info/RECORD,,
135
+ siat-3.0.25.dist-info/METADATA,sha256=AiUF8-PiZRMcVtJ3k7R-oCgYu9C5Hg1wE5WTNxOZ1qk,1448
136
+ siat-3.0.25.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
137
+ siat-3.0.25.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
138
+ siat-3.0.25.dist-info/RECORD,,
File without changes