analyser_hj3415 2.9.5__py3-none-any.whl → 2.9.7__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
@@ -55,7 +55,13 @@ def analyser_manager():
55
55
  # caching 파서
56
56
  caching_parser = lstm_subparser.add_parser('caching', help='lstm 랭킹 책정 및 레디스 저장')
57
57
  caching_parser.add_argument('-r', '--refresh', action='store_true', help='래디스 캐시를 사용하지 않고 강제로 재계산 할지')
58
+ caching_parser.add_argument('-t', '--top', type=int, help='prophet ranking 몇위까지 작업을 할지')
58
59
  caching_parser.add_argument('-n', '--noti', action='store_true', help='작업 완료 후 메시지 전송 여부')
60
+ # red - get 파서
61
+ lstm_get_parser = lstm_subparser.add_parser('get', help='lstm get 책정 및 레디스 저장')
62
+ lstm_get_parser.add_argument('code', type=str, help='종목코드')
63
+ lstm_get_parser.add_argument('-r', '--refresh', action='store_true', help='래디스 캐시를 사용하지 않고 강제로 재계산 할지')
64
+ lstm_get_parser.add_argument('-n', '--noti', action='store_true', help='작업 완료 후 메시지 전송 여부')
59
65
 
60
66
  # red 명령어 서브파서
61
67
  red_parser = type_subparsers.add_parser('red', help='red 타입')
@@ -219,9 +225,17 @@ def analyser_manager():
219
225
  noti.telegram_to('manager', "오늘의 prophet ranking을 레디스캐시에 저장했습니다.(유효 24시간)")
220
226
  elif args.type == 'lstm':
221
227
  if args.command == 'caching':
222
- result = tsa.MyLSTM('005930').caching_based_on_prophet_ranking(refresh=args.refresh)
228
+ if args.top:
229
+ tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh, top=args.top)
230
+ else:
231
+ tsa.MyLSTM.caching_based_on_prophet_ranking(refresh=args.refresh)
232
+ if args.noti:
233
+ noti.telegram_to('manager', f"오늘의 lstm caching(top={args.top if args.top else 20})을 레디스캐시에 저장했습니다.(유효 24시간)")
234
+ elif args.command == 'get':
235
+ assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
236
+ result = tsa.MyLSTM(args.code).get_final_predictions(refresh=args.refresh)
223
237
  if args.noti:
224
- noti.telegram_to('manager', "오늘의 lstm caching을 레디스캐시에 저장했습니다.(유효 24시간)")
238
+ noti.telegram_to('manager', f"LSTM 분석을({args.code})를 레디스 캐시에 저장했습니다.(유효 12시간)")
225
239
  elif args.type == 'setting':
226
240
  if args.command == 'set':
227
241
  settings_manager.set_value(args.title, args.value)
analyser_hj3415/tsa.py CHANGED
@@ -661,14 +661,16 @@ class MyLSTM:
661
661
  plt.title('Stock Price Prediction with LSTM Ensemble')
662
662
  plt.show()"""
663
663
 
664
- def caching_based_on_prophet_ranking(self, refresh: bool, top=20):
664
+ @staticmethod
665
+ def caching_based_on_prophet_ranking(refresh: bool, top=20):
665
666
  ranking_topn = OrderedDict(itertools.islice(MyProphet.ranking().items(), top))
666
667
  tsa_logger.info(ranking_topn)
668
+ mylstm = MyLSTM('005930')
667
669
  print(f"*** LSTM prediction redis cashing top{top} items ***")
668
670
  for i, (code, _) in enumerate(ranking_topn.items()):
669
- print(f"{i+1}. {self.code}/{self.name}")
670
- self.code = code
671
- self.get_final_predictions(refresh=refresh, num=5)
671
+ mylstm.code = code
672
+ print(f"{i+1}. {mylstm.code}/{mylstm.name}")
673
+ mylstm.get_final_predictions(refresh=refresh, num=5)
672
674
 
673
675
 
674
676
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: analyser_hj3415
3
- Version: 2.9.5
3
+ Version: 2.9.7
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=EW0-lIrpZHNNeDKksxC4qDBCiHPkYMGMHsZhAg6VsS8,12870
3
+ analyser_hj3415/cli.py,sha256=92vcSQG150RbcIOcCBhta5hq6iC0d68ZK2TeDOIQhMU,13989
4
4
  analyser_hj3415/eval.py,sha256=WWIvB4BebjW9GNGcF8rMd-MLL-lPXUBOH01_FpSq95I,38811
5
- analyser_hj3415/tsa.py,sha256=BsuyLZQcQE_VV7xOlw6_xpRAhwfY5FU_J-jBWTai7lg,26774
5
+ analyser_hj3415/tsa.py,sha256=XXmFfCpVMZKjVGebB4yGl5WM0TqfW_VueFpS17Wz_OA,26828
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.5.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
12
- analyser_hj3415-2.9.5.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
13
- analyser_hj3415-2.9.5.dist-info/METADATA,sha256=sogq-Kp9Zy8p4qHIUf-JHbitveSk2SbW5ZhV5QVAYP8,6524
14
- analyser_hj3415-2.9.5.dist-info/RECORD,,
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,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.9.0
2
+ Generator: flit 3.10.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any