analyser_hj3415 2.10.2__tar.gz → 2.10.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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
 
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
 
6
6
  [project]
7
7
  name = "analyser_hj3415"
8
- version = "2.10.2"
8
+ version = "2.10.4"
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.6"