siat 3.7.28__py3-none-any.whl → 3.8.1__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/__init__.py CHANGED
@@ -19,17 +19,39 @@ current_version=pkg_resources.get_distribution("siat").version
19
19
  #==============================================================================
20
20
  # 处理stooq.py修复问题
21
21
  restart=False
22
+ tagfile='fix_package.pkl'
23
+
24
+ #判断操作系统
25
+ import sys; czxt=sys.platform
26
+ if czxt in ['win32','win64']:
27
+ os='windows'
28
+ elif czxt in ['darwin']: #MacOSX
29
+ os='mac'
30
+ elif czxt in ['linux']: #linux
31
+ os='linux'
32
+ else:
33
+ os='windows'
34
+
35
+ # 确定标记文件存放地址
36
+ import pandas
37
+ srcpath=pandas.__path__[0]
38
+ if os == 'windows':
39
+ srcpath1=srcpath.replace("\\",'/')
40
+ srcfile=srcpath1+'/'+tagfile
41
+ else:
42
+ srcpath1=srcpath
43
+ srcfile=srcpath1+'/'+file
44
+
22
45
  try:
23
- with open('fix_package.pkl','rb') as file:
46
+ with open(srcfile,'rb') as file:
24
47
  siat_ver=pickle.load(file)
25
48
  if siat_ver != current_version:
26
49
  restart=True
27
- with open('fix_package.pkl','wb') as file:
50
+ with open(srcfile,'wb') as file:
28
51
  pickle.dump(current_version,file)
29
-
30
52
  except:
31
53
  restart=True
32
- with open('fix_package.pkl','wb') as file:
54
+ with open(srcfile,'wb') as file:
33
55
  pickle.dump(current_version,file)
34
56
 
35
57
  #屏蔽函数内print信息输出的类
@@ -48,6 +70,6 @@ if not restart:
48
70
  else:
49
71
  with HiddenPrints():
50
72
  fix_package()
51
- print("Please RESTART Python kernel and run this command again after installed or upgraded siat")
73
+ print("Please RESTART Python kernel and run this command again")
52
74
 
53
75
  #==============================================================================
siat/allin.py CHANGED
@@ -25,6 +25,8 @@ from siat.cryptocurrency import *
25
25
 
26
26
  # 宏观经济
27
27
  from siat.economy import *
28
+ from siat.economy2 import *
29
+
28
30
 
29
31
  # ESG
30
32
  from siat.esg import *
siat/common.py CHANGED
@@ -3371,16 +3371,34 @@ def start_end_preprocess(start,end='today'):
3371
3371
  fromdate=date_adjust2(todate,adjust_year=-2,to_prev_month_end=True)
3372
3372
  elif start in ['l3y']: # 近三年以来
3373
3373
  fromdate=date_adjust2(todate,adjust_year=-3,to_prev_month_end=True)
3374
+ elif start in ['l4y']: # 近三年以来
3375
+ fromdate=date_adjust2(todate,adjust_year=-4,to_prev_month_end=True)
3376
+
3374
3377
  elif start in ['l5y']: # 近五年以来
3375
3378
  fromdate=date_adjust2(todate,adjust_year=-5,to_prev_year_end=True)
3379
+ elif start in ['l6y']: # 近五年以来
3380
+ fromdate=date_adjust2(todate,adjust_year=-6,to_prev_year_end=True)
3381
+ elif start in ['l7y']: # 近五年以来
3382
+ fromdate=date_adjust2(todate,adjust_year=-7,to_prev_year_end=True)
3383
+
3376
3384
  elif start in ['l8y']: # 近八年以来
3377
3385
  fromdate=date_adjust2(todate,adjust_year=-8,to_prev_year_end=True)
3378
3386
  elif start in ['l10y']: # 近十年以来
3379
3387
  fromdate=date_adjust2(todate,adjust_year=-10,to_prev_year_end=True)
3380
3388
  elif start in ['l20y']: # 近20年以来
3381
3389
  fromdate=date_adjust2(todate,adjust_year=-20,to_prev_year_end=True)
3390
+ elif start in ['l15y']: # 近五年以来
3391
+ fromdate=date_adjust2(todate,adjust_year=-15,to_prev_year_end=True)
3392
+ elif start in ['l25y']: # 近五年以来
3393
+ fromdate=date_adjust2(todate,adjust_year=-25,to_prev_year_end=True)
3394
+
3382
3395
  elif start in ['l30y']: # 近30年以来
3383
- fromdate=date_adjust2(todate,adjust_year=-30,to_prev_year_end=True)
3396
+ fromdate=date_adjust2(todate,adjust_year=-30,to_prev_year_end=True)
3397
+ elif start in ['l40y']: # 近五年以来
3398
+ fromdate=date_adjust2(todate,adjust_year=-40,to_prev_year_end=True)
3399
+ elif start in ['l50y']: # 近五年以来
3400
+ fromdate=date_adjust2(todate,adjust_year=-50,to_prev_year_end=True)
3401
+
3384
3402
  elif start in ['ytd']: # 今年以来
3385
3403
  fromdate=str(todaydt.year-1)+'-12-31'
3386
3404
  else: