analyser_hj3415 2.7.4__tar.gz → 2.7.6__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/PKG-INFO +1 -1
  2. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/eval.py +16 -12
  3. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/pyproject.toml +1 -1
  4. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.DS_Store +0 -0
  5. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.gitattributes +0 -0
  6. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.gitignore +0 -0
  7. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/.gitignore +0 -0
  8. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/analyser-hj3415.iml +0 -0
  9. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  10. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/misc.xml +0 -0
  11. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/modules.xml +0 -0
  12. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/.idea/vcs.xml +0 -0
  13. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/LICENSE +0 -0
  14. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/README.md +0 -0
  15. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/.DS_Store +0 -0
  16. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/__init__.py +0 -0
  17. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/cli.py +0 -0
  18. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/__init__.py +0 -0
  19. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/lstm.py +0 -0
  20. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/myprophet.py +0 -0
  21. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/mysklearn.py +0 -0
  22. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/mysklearn2.py +0 -0
  23. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/score.py +0 -0
  24. {analyser_hj3415-2.7.4 → analyser_hj3415-2.7.6}/analyser_hj3415/workroom/trash.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: analyser_hj3415
3
- Version: 2.7.4
3
+ Version: 2.7.6
4
4
  Summary: Stock analyser and database processing programs
5
5
  Author-email: Hyungjin Kim <hj3415@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -10,6 +10,7 @@ import logging
10
10
 
11
11
  analyser_logger = helpers.setup_logger('analyser_logger', logging.WARNING)
12
12
 
13
+ expire_time = 3600 * 12
13
14
 
14
15
  class Tools:
15
16
  @staticmethod
@@ -331,17 +332,18 @@ class Red:
331
332
  """
332
333
  redis_name = f"{self.code}_red"
333
334
  analyser_logger.info(f"{self} RedData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
334
- print(f"{self} redisname: '{redis_name}' / expect_earn: {Red.expect_earn} / refresh : {refresh}")
335
+ expire_time = 3600 * 12
336
+ print(f"{self} redisname: '{redis_name}' / expect_earn: {Red.expect_earn} / refresh : {refresh} / expire_time : {expire_time/3600}h")
335
337
 
336
338
  def fetch_generate_data(refresh_in: bool) -> dict:
337
339
  return asdict(self._generate_data(refresh_in))
338
340
 
339
- return RedData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
341
+ return RedData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
340
342
 
341
343
  @classmethod
342
344
  def ranking(cls, expect_earn: float = None, refresh = False) -> OrderedDict:
343
345
  """
344
- redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.(캐시 유효시간 12시간)
346
+ redis를 사용하며 red score를 계산해서 0이상의 값을 가지는 종목을 순서대로 저장하여 반환한다.
345
347
  :param expect_earn: 기대수익률(일반적으로 0.06 - 0.10)
346
348
  :param refresh: 캐시를 사용하지 않고 강제로 다시 계산
347
349
  :return: OrderedDict([('023590', 101),
@@ -360,7 +362,8 @@ class Red:
360
362
  refresh = True
361
363
 
362
364
  redis_name = 'red_ranking'
363
- print(f"redisname: '{redis_name}' / expect_earn: {expect_earn} / refresh : {refresh}")
365
+
366
+ print(f"redisname: '{redis_name}' / expect_earn: {expect_earn} / refresh : {refresh} / expire_time : {expire_time/3600}h")
364
367
 
365
368
  def fetch_ranking(expect_earn_in: float, refresh_in: bool) -> dict:
366
369
  data = {}
@@ -369,8 +372,9 @@ class Red:
369
372
  # 원하는 기대수익률로 클래스 세팅
370
373
  Red.expect_earn = expect_earn_in
371
374
  AnalyserSettingsManager().set_value('RED_RANKING_EXPECT_EARN', str(expect_earn_in))
375
+ red = Red('005930')
372
376
  for i, code in enumerate(myredis.Corps.list_all_codes()):
373
- red = Red(code)
377
+ red.code = code
374
378
  red_score = red.get(refresh=refresh_in).score
375
379
  if red_score > 0:
376
380
  data[code] = red_score
@@ -379,7 +383,7 @@ class Red:
379
383
  Red.expect_earn = ee_orig
380
384
  return data
381
385
 
382
- data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, expect_earn, refresh, timer=3600 * 12)
386
+ data_dict = myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_ranking, expect_earn, refresh, timer=expire_time)
383
387
 
384
388
  return OrderedDict(sorted(data_dict.items(), key=lambda item: item[1], reverse=True))
385
389
 
@@ -636,12 +640,12 @@ class Mil:
636
640
  """
637
641
  redis_name = f"{self.code}_mil"
638
642
  analyser_logger.info(f"{self} MilData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
639
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
643
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
640
644
 
641
645
  def fetch_generate_data(refresh_in: bool) -> dict:
642
646
  return asdict(self._generate_data(refresh_in))
643
647
 
644
- return MilData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
648
+ return MilData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
645
649
 
646
650
 
647
651
  @dataclass()
@@ -808,12 +812,12 @@ class Blue:
808
812
  """
809
813
  redis_name = f"{self.code}_blue"
810
814
  analyser_logger.info(f"{self} BlueData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
811
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
815
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
812
816
 
813
817
  def fetch_generate_data(refresh_in: bool) -> dict:
814
818
  return asdict(self._generate_data(refresh_in))
815
819
 
816
- return BlueData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
820
+ return BlueData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
817
821
 
818
822
 
819
823
 
@@ -907,12 +911,12 @@ class Growth:
907
911
  """
908
912
  redis_name = f"{self.code}_growth"
909
913
  analyser_logger.info(f"{self} GrowthData를 레디스캐시에서 가져오거나 새로 생성합니다.. refresh : {refresh}")
910
- print(f"{self} redisname: '{redis_name}' / refresh : {refresh}")
914
+ print(f"{self} redisname: '{redis_name}' / refresh : {refresh} / expire_time : {expire_time/3600}h")
911
915
 
912
916
  def fetch_generate_data(refresh_in: bool) -> dict:
913
917
  return asdict(self._generate_data(refresh_in))
914
918
 
915
- return GrowthData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh))
919
+ return GrowthData(**myredis.Base.fetch_and_cache_data(redis_name, refresh, fetch_generate_data, refresh, timer=expire_time))
916
920
 
917
921
 
918
922
 
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "analyser_hj3415"
7
- version = "2.7.4"
7
+ version = "2.7.6"
8
8
  authors = [{name = "Hyungjin Kim", email = "hj3415@gmail.com"}]
9
9
  description = "Stock analyser and database processing programs"
10
10
  readme = "README.md"
File without changes