analyser_hj3415 2.9.7__py3-none-any.whl → 2.9.8__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
analyser_hj3415/cli.py CHANGED
@@ -219,23 +219,27 @@ def analyser_manager():
219
219
  noti.telegram_to('manager', f"오늘의 Growth({args.code})를 레디스 캐시에 저장했습니다.(유효 12시간)")
220
220
  elif args.type == 'prophet':
221
221
  if args.command == 'ranking':
222
- result = tsa.MyProphet.ranking(refresh=args.refresh)
222
+ myprophet = tsa.MyProphet
223
+ myprophet.expire_time_h = 72
224
+ result = myprophet.ranking(refresh=args.refresh)
223
225
  print(result)
224
226
  if args.noti:
225
- noti.telegram_to('manager', "오늘의 prophet ranking을 레디스캐시에 저장했습니다.(유효 24시간)")
227
+ noti.telegram_to('manager', f"오늘의 prophet ranking을 레디스캐시에 저장했습니다.(유효 {myprophet.expire_time_h}시간)")
226
228
  elif args.type == 'lstm':
229
+ mylstm = tsa.MyLSTM
230
+ mylstm.expire_time_h = 72
227
231
  if args.command == 'caching':
228
232
  if args.top:
229
- tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh, top=args.top)
233
+ mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, top=args.top)
230
234
  else:
231
- tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh)
235
+ mylstm.caching_based_on_prophet_ranking(refresh=args.refresh)
232
236
  if args.noti:
233
- noti.telegram_to('manager', f"오늘의 lstm caching(top={args.top if args.top else 20})을 레디스캐시에 저장했습니다.(유효 24시간)")
237
+ noti.telegram_to('manager', f"오늘의 lstm caching(top={args.top if args.top else 20})을 레디스캐시에 저장했습니다.(유효 {mylstm.expire_time_h}시간)")
234
238
  elif args.command == 'get':
235
239
  assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
236
- result = tsa.MyLSTM(args.code).get_final_predictions(refresh=args.refresh)
240
+ result = mylstm(args.code).get_final_predictions(refresh=args.refresh)
237
241
  if args.noti:
238
- noti.telegram_to('manager', f"LSTM 분석을({args.code})를 레디스 캐시에 저장했습니다.(유효 12시간)")
242
+ noti.telegram_to('manager', f"LSTM 분석을({args.code})를 레디스 캐시에 저장했습니다.(유효 {mylstm.expire_time_h}시간)")
239
243
  elif args.type == 'setting':
240
244
  if args.command == 'set':
241
245
  settings_manager.set_value(args.title, args.value)
analyser_hj3415/tsa.py CHANGED
@@ -33,6 +33,7 @@ tsa_logger = helpers.setup_logger('tsa_logger', logging.WARNING)
33
33
  expire_time = 3600 * 24
34
34
 
35
35
  class MyProphet:
36
+ expire_time_h = 24
36
37
  def __init__(self, code: str):
37
38
  assert utils.is_6digit(code), f'Invalid value : {code}'
38
39
  self.scaler = StandardScaler()
@@ -204,7 +205,7 @@ class MyProphet:
204
205
  redis_name = 'myprophet_ranking'
205
206
 
206
207
  print(
207
- f"redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time / 3600}h")
208
+ f"redisname: '{redis_name}' / refresh : {refresh} / expire_time : {MyProphet.expire_time_h}h")
208
209
 
209
210
  def fetch_ranking() -> dict:
210
211
  data = {}
@@ -223,7 +224,7 @@ class MyProphet:
223
224
  print(f"{i}.{p.code}/{p.name} date: {recent_date} 가격:{recent_price} 기대하한값:{yhat_lower} 편차:{deviation}")
224
225
  return data
225
226
 
226
- data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, timer=expire_time)
227
+ data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, timer=MyProphet.expire_time_h * 3600)
227
228
 
228
229
  return OrderedDict(sorted(data_dict.items(), key=lambda item: item[1], reverse=True))
229
230
 
@@ -264,6 +265,7 @@ class MyLSTM:
264
265
  """
265
266
  # 미래 몇일을 예측할 것인가?
266
267
  future_days = 30
268
+ expire_time_h = 24
267
269
 
268
270
  def __init__(self, code: str):
269
271
  assert utils.is_6digit(code), f'Invalid value : {code}'
@@ -498,7 +500,7 @@ class MyLSTM:
498
500
  redis_name = f'{self.code}_mylstm_predictions'
499
501
 
500
502
  print(
501
- f"redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time / 3600}h")
503
+ f"redisname: '{redis_name}' / refresh : {refresh} / expire_time : {MyLSTM.expire_time_h}h")
502
504
 
503
505
  def fetch_final_predictions(num_in) -> tuple:
504
506
  """
@@ -529,7 +531,7 @@ class MyLSTM:
529
531
 
530
532
  return future_dates_str, final_future_predictions.tolist()
531
533
 
532
- future_dates_str, final_future_predictions = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_final_predictions, num, timer=expire_time)
534
+ future_dates_str, final_future_predictions = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_final_predictions, num, timer=MyLSTM.expire_time_h * 3600)
533
535
 
534
536
  # 문자열을 날짜 형식으로 변환
535
537
  future_dates = [datetime.strptime(date, '%Y-%m-%d') for date in future_dates_str]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: analyser_hj3415
3
- Version: 2.9.7
3
+ Version: 2.9.8
4
4
  Summary: Stock analyser and database processing programs
5
5
  Requires-Python: >=3.6
6
6
  Description-Content-Type: text/markdown
@@ -1,14 +1,14 @@
1
1
  analyser_hj3415/.DS_Store,sha256=S5yjTP1issWmV5kF2CFjGHm5OJHgkuTaZHuxjIwSkfc,6148
2
2
  analyser_hj3415/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- analyser_hj3415/cli.py,sha256=92vcSQG150RbcIOcCBhta5hq6iC0d68ZK2TeDOIQhMU,13989
3
+ analyser_hj3415/cli.py,sha256=ZxrpF0BOduFp30JPM6SfPxm5yhun1LoYRBYLFhj7BGM,14178
4
4
  analyser_hj3415/eval.py,sha256=WWIvB4BebjW9GNGcF8rMd-MLL-lPXUBOH01_FpSq95I,38811
5
- analyser_hj3415/tsa.py,sha256=XXmFfCpVMZKjVGebB4yGl5WM0TqfW_VueFpS17Wz_OA,26828
5
+ analyser_hj3415/tsa.py,sha256=XEVYDjOTj8LXr0_wk0DzK9QQXZj2HU0FNhncAfaGy00,26916
6
6
  analyser_hj3415/workroom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  analyser_hj3415/workroom/mysklearn.py,sha256=wJXKz5MqqTzADdG2mqRMMzc_G9RzwYjj5_j4gyOopxQ,2030
8
8
  analyser_hj3415/workroom/mysklearn2.py,sha256=1lIy6EWEQHkOzDS-av8U0zQH6DuCLKWMI73dnJx5KRs,1495
9
9
  analyser_hj3415/workroom/score.py,sha256=P6nHBJYmyhigGtT4qna4BmNtvt4B93b7SKyzdstJK24,17376
10
10
  analyser_hj3415/workroom/trash.py,sha256=zF-W0piqkGr66UP6-iybo9EXh2gO0RP6R1FnIpsGkl8,12262
11
- analyser_hj3415-2.9.7.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
12
- analyser_hj3415-2.9.7.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
13
- analyser_hj3415-2.9.7.dist-info/METADATA,sha256=C0x6TlTEVB-Af3mY4yi6PFeTWoVq5VIEBejyzc681wA,6524
14
- analyser_hj3415-2.9.7.dist-info/RECORD,,
11
+ analyser_hj3415-2.9.8.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
12
+ analyser_hj3415-2.9.8.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
13
+ analyser_hj3415-2.9.8.dist-info/METADATA,sha256=wGpIR0YUDxZbzVxnCxQLDF7qmMkVgT8T0quDwRJha2A,6524
14
+ analyser_hj3415-2.9.8.dist-info/RECORD,,