siat 2.13.40__py3-none-any.whl → 2.13.41__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/stock.py CHANGED
@@ -2544,7 +2544,7 @@ def stock_info(symbol):
2544
2544
  if result & (suffix=='HK'):
2545
2545
  symbol=prefix[-4:]+'.'+suffix
2546
2546
 
2547
- from yahooquery import Ticker
2547
+ from yahooquery import Ticker #如果出现类似于{'AAPL': 'Invalid Cookie'}错误,则需要升级
2548
2548
  stock = Ticker(symbol)
2549
2549
 
2550
2550
  """
@@ -2559,6 +2559,7 @@ def stock_info(symbol):
2559
2559
  shareHolderRightRisk:股权风险
2560
2560
  """
2561
2561
  try:
2562
+ #如果出现类似于{'AAPL': 'Invalid Cookie'}错误,则需要升级yahooquery
2562
2563
  adict=stock.asset_profile
2563
2564
  except:
2564
2565
  print(" #Error(stock_info): failed to get the profile of",symbol)
@@ -2566,7 +2567,7 @@ def stock_info(symbol):
2566
2567
  return None
2567
2568
 
2568
2569
  if adict[symbol] == 'Invalid Cookie':
2569
- print(" #Error(stock_info): failed in retrieving info of",symbol)
2570
+ print(" #Error(stock_info): failed in retrieving info of",symbol,"\b. Try upgrade yahooquery and do again")
2570
2571
  return None
2571
2572
 
2572
2573
  keylist=list(adict[symbol].keys())
@@ -3186,11 +3187,11 @@ if __name__=='__main__':
3186
3187
 
3187
3188
  #==============================================================================
3188
3189
 
3189
- def stock_snapshot(ticker='AAPL'):
3190
+ def stock_snapshot(ticker='AAPL',info_type="all"):
3190
3191
  """
3191
- 功能:一次性打印所有选项,套壳函数get_stock_profile
3192
+ 功能:打印指定选项,套壳函数get_stock_profile
3192
3193
  """
3193
- print(" Try connecting to Yahoo Finance ... ...")
3194
+ print(" Connecting to Yahoo Finance ... ...")
3194
3195
  typelist=['basic',
3195
3196
  'officers',
3196
3197
  'fin_rates',
@@ -3198,10 +3199,23 @@ def stock_snapshot(ticker='AAPL'):
3198
3199
  'market_rates',
3199
3200
  'risk_general',
3200
3201
  'risk_esg']
3201
- for t in typelist:
3202
- info=get_stock_profile(ticker,info_type=t)
3202
+
3203
+ if info_type.lower() !="all" and info_type.lower() in typelist:
3204
+ info=get_stock_profile(ticker,info_type=info_type)
3205
+ return
3206
+
3207
+ if info_type.lower() =="all":
3208
+ for t in typelist:
3209
+ info=get_stock_profile(ticker,info_type=t)
3210
+
3211
+ if info is None:
3212
+ break
3213
+ return
3214
+ else:
3215
+ print(" #Error(stock_snapshot): unsupported info type",info_type)
3216
+ print(" Supporting",typelist)
3217
+ return
3203
3218
 
3204
- return
3205
3219
 
3206
3220
  def security_snapshot(ticker='AAPL'):
3207
3221
  """
@@ -3218,6 +3232,9 @@ def security_snapshot(ticker='AAPL'):
3218
3232
  for t in typelist:
3219
3233
  info=get_stock_profile(ticker,info_type=t)
3220
3234
 
3235
+ if info is None:
3236
+ break
3237
+
3221
3238
  return
3222
3239
  #==============================================================================
3223
3240
  if __name__=='__main__':
siat/translate.py CHANGED
@@ -1611,6 +1611,8 @@ def codetranslate0(code):
1611
1611
  ['CLPUSD=X','智利比索/美元汇率'],['CLPUSD','智利比索/美元汇率'],
1612
1612
  ['BRLUSD=X','巴西雷亚尔/美元汇率'],['BRLUSD','巴西雷亚尔/美元汇率'],
1613
1613
 
1614
+ ['INRTUS.M','美联储基准利率'],['USDCNY','美元/人民币汇率'],
1615
+
1614
1616
  ['EUR_I','STOOQ欧元指数'],
1615
1617
  ['EURUSD=X','欧元/美元汇率'],['EURUSD','欧元/美元汇率'],
1616
1618
  ['GBPUSD=X','英镑/美元汇率'],['GBPUSD','英镑/美元汇率'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 2.13.40
3
+ Version: 2.13.41
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
@@ -95,7 +95,7 @@ siat/security_prices_test.py,sha256=OEphoJ87NPKoNow1QA8EU_5MUYrJF-qKoWKNapVfZNI,
95
95
  siat/security_trend.py,sha256=DQ9hwAioTg0R_9XTqT5jywLWSmMK1GAvOtiPJVFQPZA,15911
96
96
  siat/setup.py,sha256=up65rQGLmTBkhtaMLowjoQXYmIsnycnm4g1SYmeQS6o,1335
97
97
  siat/shenwan index history test.py,sha256=JCVAzOSEldHalhSFa3pqD8JI_8_djPMQOxpkuYU-Esg,1418
98
- siat/stock.py,sha256=1tUAzgcfouhyeA5TElytICgyhUmsgKz5p3N8xVuoAc8,140831
98
+ siat/stock.py,sha256=ejCrOoslRzhjA7wNHsLggYw3fWiL-3r3G0PSF06OHw8,141510
99
99
  siat/stock_advice_linear.py,sha256=-twT7IGP-NEplkL1WPSACcNJjggRB2j4mlAQCkzOAuo,31655
100
100
  siat/stock_base.py,sha256=uISvbRyOGy8p9QREA96CVydgflBkn5L3OXOGKl8oanc,1312
101
101
  siat/stock_china.py,sha256=B1hbZCxJuE5GVvGGmf_rSmQodYHmEFuyiDrUvxHhg4w,83969
@@ -120,13 +120,13 @@ siat/transaction_test.py,sha256=Z8g1LJCN4-mnUByXMUMoFmN0t105cbmsz2QmvSuIkbU,1858
120
120
  siat/translate-20230125.py,sha256=NPPSXhT38s5t9fzMvl_fvi4ckSB73ThLmZetVI-xGdU,117953
121
121
  siat/translate-20230206.py,sha256=-vtI125WyaJhmPotOpDAmclt_XnYVaWU9ByLWZ6FyYE,118133
122
122
  siat/translate-20230215.py,sha256=TJgtPE3n8IjljmZ4Pefy8dmHoNdFF-1zpML6BhA9FKE,121657
123
- siat/translate.py,sha256=GWIw0q8jEYDAEYs9CsqNtn_ELZdcG0BOB_af-X7Svok,166954
123
+ siat/translate.py,sha256=aOn3GVMkdFcKvbL0T5gRn-uPA6vj93BCITkyn30H9SA,167047
124
124
  siat/universal_test.py,sha256=CDAOffW1Rvs-TcNN5giWVvHMlch1w4dp-w5SIV9jXL0,3936
125
125
  siat/valuation.py,sha256=7_jBnthig4kAWrE4iAQ2vOKAkhnFsvXi8lDdAC0kWZY,47105
126
126
  siat/valuation_china.py,sha256=oEQRrktJNHiOG1mJSQN1aSSQAQrwrg-ppIHyNVjMjNg,67603
127
127
  siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
128
128
  siat/var_model_validation.py,sha256=zB_Skk_tmzIR15l6oAW3am4HBGVIG-eZ8gJhCdXZ8Qw,14859
129
- siat-2.13.40.dist-info/METADATA,sha256=oG28X3x3gKvkVFui0pCHMW8Suiv80F-MLjEJzLwIiBA,1449
130
- siat-2.13.40.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
- siat-2.13.40.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
- siat-2.13.40.dist-info/RECORD,,
129
+ siat-2.13.41.dist-info/METADATA,sha256=7kf2jAQHnIJBJCds9iDD_kpmdGfSZzUvZMzL3B-vIF0,1449
130
+ siat-2.13.41.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
131
+ siat-2.13.41.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
132
+ siat-2.13.41.dist-info/RECORD,,
File without changes