analyser_hj3415 2.10.2__py3-none-any.whl → 2.10.4__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
analyser_hj3415/score.py CHANGED
@@ -53,16 +53,12 @@ class Score:
53
53
 
54
54
  Returns:
55
55
  dict: A dictionary containing the following key-value pairs:
56
-
57
- - 'code': str - 종목코드
58
56
  - 'name': str - 종목명
59
57
  - '시가총액': str - 시가총액
60
58
  - 'is_update_c108': bool - 최근 3일 이내에 c108이 없데이트 되었는가
61
- - 'is_update_dart': bool - 최근 3일 이내에 Dart가 없데이트 되었는가
62
59
  - 'red_score': float - Red score
63
60
  - '이익지표': float - Mil의 이익지표
64
61
  - '주주수익률': float - Mil의 주주수익률
65
- - 'is_lstm_up': Union[bool, None] - lstm 예측치가 상승인지 아닌지, returns None - 데이터가 없으면..
66
62
  - 'prophet_score': int - prophet score
67
63
  """
68
64
  print(f"{self.code}/{self.name}의 scoring을 시작합니다.")
@@ -83,40 +79,22 @@ class Score:
83
79
  else:
84
80
  is_update_c108 = is_within_last_three_days(c108_recent_date.date())
85
81
 
86
- score_logger.info("Dart 최근 데이터 추출중..")
87
- # dart가 최근에 업데이트 되었는지...
88
- dart_recent_date = self.dart.get_recent_date()
89
- # print('code - ', code, ' | dart recent date - ', dart_recent_date.date())
90
- if dart_recent_date is None:
91
- is_update_dart = False
92
- else:
93
- is_update_dart = is_within_last_three_days(dart_recent_date.date())
94
-
95
82
  score_logger.info("Red score 계산중..")
96
83
  red_score = self.red.get(verbose=False).score
97
84
 
98
85
  score_logger.info("Mil data 계산중..")
99
86
  mil_data = self.mil.get(verbose=False)
100
87
 
101
- score_logger.info("Lstm 최근 데이터 조회중..")
102
- if myredis.Base.exists(f'{self.code}_mylstm_predictions'):
103
- is_lstm_up = self.lstm.is_up()
104
- else:
105
- is_lstm_up = None
106
-
107
88
  score_logger.info("\tProphet 최근 데이터 조회중..")
108
89
  prophet_score = self.prophet.scoring()
109
90
 
110
91
  return {
111
- 'code': self.code,
112
92
  'name': self.name,
113
93
  '시가총액': 시가총액,
114
94
  'is_update_c108': is_update_c108,
115
- 'is_update_dart': is_update_dart,
116
95
  'red_score': red_score,
117
96
  '이익지표': mil_data.이익지표,
118
97
  '주주수익률': mil_data.주주수익률,
119
- 'is_lstm_up': is_lstm_up,
120
98
  'prophet_score': prophet_score,
121
99
  }
122
100
  data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_score, timer=expire_time_h * 3600)
@@ -124,6 +102,26 @@ class Score:
124
102
 
125
103
  @classmethod
126
104
  def ranking(self, refresh=False, expire_time_h=24, top='all') -> OrderedDict:
105
+ """
106
+ prophet score 기준으로 정렬하여 ordered dict로 반환함
107
+
108
+ Parameters:
109
+ refresh (bool): Specifies whether to refresh the ranking data. Defaults
110
+ to `False`.
111
+ expire_time_h (int): Time in hours after which the cached data should
112
+ expire. Defaults to `24` hours.
113
+ top (Union[str, int]): Determines how many top rankings to return.
114
+ Defaults to `'all'`. If an integer is provided, it limits the
115
+ ranking to the specified count.
116
+
117
+ Returns:
118
+ OrderedDict: A dictionary containing the rankings, sorted in
119
+ descending order by `prophet_score`.
120
+
121
+ Raises:
122
+ ValueError: Raised if the parameter `top` is neither `'all'` nor an
123
+ integer.
124
+ """
127
125
  print("**** Start score_ranking... ****")
128
126
  redis_name = 'score_ranking'
129
127
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: analyser_hj3415
3
- Version: 2.10.2
3
+ Version: 2.10.4
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/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  analyser_hj3415/cli.py,sha256=eRaFtkioooe2Rgzq5J3Lxd2oX17OnIwDZPo2msutjM0,12497
3
3
  analyser_hj3415/eval.py,sha256=9rWNTa3vbUnegOfpfVtWLXmt8cxU2zWZD5yEsFlfTzQ,38796
4
- analyser_hj3415/score.py,sha256=ZEbkP_utCinaLCJeCw71ER3Ed1tCs0mH7FVS5TIcjGk,6310
4
+ analyser_hj3415/score.py,sha256=f1I4wmGNoL4dkhHsGk9vVAVSLae0AeG_zaHP4hZexBg,6100
5
5
  analyser_hj3415/tsa.py,sha256=X62ypwSWRMAAU72IJoBdEeyU8rVaaMRqZ3XsslziBfM,28111
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.10.2.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
12
- analyser_hj3415-2.10.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
13
- analyser_hj3415-2.10.2.dist-info/METADATA,sha256=k-rEXIyDhOMG4k5niqEudEZ5g0pYOkvgGjx_7a3zkzY,6777
14
- analyser_hj3415-2.10.2.dist-info/RECORD,,
11
+ analyser_hj3415-2.10.4.dist-info/entry_points.txt,sha256=ZfjPnJuH8SzvhE9vftIPMBIofsc65IAWYOhqOC_L5ck,65
12
+ analyser_hj3415-2.10.4.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
13
+ analyser_hj3415-2.10.4.dist-info/METADATA,sha256=h056S-8o7ZPibpsH8yI5gONBO5VJcFjLHx-3xIn7Sys,6777
14
+ analyser_hj3415-2.10.4.dist-info/RECORD,,