analyser_hj3415 2.9.10__py3-none-any.whl → 2.9.11__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
@@ -2,9 +2,9 @@ import argparse
2
2
  import os
3
3
  import pprint
4
4
 
5
- from utils_hj3415 import noti, utils
5
+ from utils_hj3415 import utils
6
6
  from utils_hj3415.helpers import SettingsManager
7
- from db_hj3415 import myredis, mypeewee
7
+ from db_hj3415 import myredis, mymongo
8
8
 
9
9
  class AnalyserSettingsManager(SettingsManager):
10
10
  DEFAULT_SETTINGS = {
@@ -33,8 +33,6 @@ class AnalyserSettingsManager(SettingsManager):
33
33
  print(f"{title}이 기본값 ({self.DEFAULT_SETTINGS[title]}) 으로 초기화 되었습니다.")
34
34
 
35
35
 
36
- log_cli = mypeewee.LogManager('cli')
37
-
38
36
  def analyser_manager():
39
37
  settings_manager = AnalyserSettingsManager()
40
38
  expect_earn_from_setting = settings_manager.get_value('EXPECT_EARN')
@@ -151,10 +149,10 @@ def analyser_manager():
151
149
 
152
150
  # 원래 저장되었던 기대수익률로 다시 복원
153
151
  eval.Red.expect_earn = ee_orig
154
- log_cli.save('INFO', f'run >> analyser red get {args.code}')
152
+ mymongo.Logs.save('cli','INFO', f'run >> analyser red get {args.code}')
155
153
 
156
154
  elif args.command == 'ranking':
157
- log_cli.save('INFO', 'run >> analyser red ranking')
155
+ mymongo.Logs.save('cli','INFO', 'run >> analyser red ranking')
158
156
  result = eval.Red.ranking(expect_earn=args.expect_earn, refresh=args.refresh)
159
157
  print(result)
160
158
 
@@ -172,7 +170,7 @@ def analyser_manager():
172
170
  mil = eval.Mil(args.code)
173
171
  print(f"*** Mil - {mil} ***")
174
172
  pprint.pprint(mil.get(args.refresh))
175
- log_cli.save('INFO', f'run >> analyser mil get {args.code}')
173
+ mymongo.Logs.save('cli','INFO', f'run >> analyser mil get {args.code}')
176
174
 
177
175
  elif args.type == 'blue':
178
176
  if args.command == 'get':
@@ -188,7 +186,7 @@ def analyser_manager():
188
186
  blue = eval.Blue(args.code)
189
187
  print(f"*** Blue - {blue} ***")
190
188
  pprint.pprint(blue.get(args.refresh))
191
- log_cli.save('INFO', f'run >> analyser blue get {args.code}')
189
+ mymongo.Logs.save('cli','INFO', f'run >> analyser blue get {args.code}')
192
190
 
193
191
  elif args.type == 'growth':
194
192
  if args.command == 'get':
@@ -204,27 +202,27 @@ def analyser_manager():
204
202
  growth = eval.Growth(args.code)
205
203
  print(f"*** growth - {growth} ***")
206
204
  pprint.pprint(growth.get(args.refresh))
207
- log_cli.save('INFO', f'run >> analyser growth get {args.code}')
205
+ mymongo.Logs.save('cli','INFO', f'run >> analyser growth get {args.code}')
208
206
 
209
207
  elif args.type == 'prophet':
210
208
  if args.command == 'ranking':
211
209
  myprophet = tsa.MyProphet
212
210
  result = myprophet.ranking(refresh=args.refresh, expire_time_h=24)
213
211
  print(result)
214
- log_cli.save('INFO', 'run >> analyser prophet ranking')
212
+ mymongo.Logs.save('cli','INFO', 'run >> analyser prophet ranking')
215
213
 
216
214
  elif args.type == 'lstm':
217
215
  mylstm = tsa.MyLSTM
218
216
  if args.command == 'caching':
219
217
  if args.top:
220
- mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=24, top=args.top)
218
+ mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=48, top=args.top)
221
219
  else:
222
- mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=24)
223
- log_cli.save('INFO', f'run >> analyser lstm caching / top={args.top if args.top else 20})')
220
+ mylstm.caching_based_on_prophet_ranking(refresh=args.refresh, expire_time_h=48)
221
+ mymongo.Logs.save('cli','INFO', f'run >> analyser lstm caching / top={args.top if args.top else 20})')
224
222
  elif args.command == 'get':
225
223
  assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
226
- result = mylstm(args.code).get_final_predictions(refresh=args.refresh, expire_time_h=24)
227
- log_cli.save('INFO', f'run >> analyser lstm get {args.code}')
224
+ result = mylstm(args.code).get_final_predictions(refresh=args.refresh, expire_time_h=48)
225
+ mymongo.Logs.save('cli','INFO', f'run >> analyser lstm get {args.code}')
228
226
 
229
227
  elif args.type == 'setting':
230
228
  if args.command == 'set':
@@ -237,5 +235,3 @@ def analyser_manager():
237
235
 
238
236
  else:
239
237
  parser.print_help()
240
-
241
- log_cli.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: analyser_hj3415
3
- Version: 2.9.10
3
+ Version: 2.9.11
4
4
  Summary: Stock analyser and database processing programs
5
5
  Requires-Python: >=3.6
6
6
  Description-Content-Type: text/markdown
@@ -1,5 +1,5 @@
1
1
  analyser_hj3415/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- analyser_hj3415/cli.py,sha256=X7GRhmrWRdHfp84gCjkRjl2wjlOHx1ft82dLe-bnoBI,12514
2
+ analyser_hj3415/cli.py,sha256=90i1haDFNGpTNf-lnQKUARsN0lPFJgv_qXFSIsl1Sa4,12541
3
3
  analyser_hj3415/eval.py,sha256=WWIvB4BebjW9GNGcF8rMd-MLL-lPXUBOH01_FpSq95I,38811
4
4
  analyser_hj3415/tsa.py,sha256=8JSAdLLApcRDIjrTo8pveHliBUObzpGWlq-yxZNsIZw,26984
5
5
  analyser_hj3415/workroom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -7,7 +7,7 @@ analyser_hj3415/workroom/mysklearn.py,sha256=wJXKz5MqqTzADdG2mqRMMzc_G9RzwYjj5_j
7
7
  analyser_hj3415/workroom/mysklearn2.py,sha256=1lIy6EWEQHkOzDS-av8U0zQH6DuCLKWMI73dnJx5KRs,1495
8
8
  analyser_hj3415/workroom/score.py,sha256=P6nHBJYmyhigGtT4qna4BmNtvt4B93b7SKyzdstJK24,17376
9
9
  analyser_hj3415/workroom/trash.py,sha256=zF-W0piqkGr66UP6-iybo9EXh2gO0RP6R1FnIpsGkl8,12262
10
- analyser_hj3415-2.9.10.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
11
- analyser_hj3415-2.9.10.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
12
- analyser_hj3415-2.9.10.dist-info/METADATA,sha256=WUsWOQrGgiBwKWOOdGKnd2eBxDWCnJhHXZgJSQuqx4s,6777
13
- analyser_hj3415-2.9.10.dist-info/RECORD,,
10
+ analyser_hj3415-2.9.11.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
11
+ analyser_hj3415-2.9.11.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
12
+ analyser_hj3415-2.9.11.dist-info/METADATA,sha256=LA5DUuaj3BQQaZ2fdw_Q7RYaKefyJHHbZXY0qgsaRkE,6777
13
+ analyser_hj3415-2.9.11.dist-info/RECORD,,