analyser_hj3415 2.5.3__tar.gz → 2.5.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/PKG-INFO +1 -1
  2. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/analysers/eval.py +4 -6
  3. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/analysers/score.py +3 -1
  4. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/cli.py +17 -2
  5. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/pyproject.toml +1 -1
  6. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.DS_Store +0 -0
  7. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.gitattributes +0 -0
  8. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.gitignore +0 -0
  9. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/.gitignore +0 -0
  10. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/analyser-hj3415.iml +0 -0
  11. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  12. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/misc.xml +0 -0
  13. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/modules.xml +0 -0
  14. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/.idea/vcs.xml +0 -0
  15. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/LICENSE +0 -0
  16. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/README.md +0 -0
  17. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/.DS_Store +0 -0
  18. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/__init__.py +0 -0
  19. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/analysers/report.py +0 -0
  20. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/myredis.py +0 -0
  21. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/tools.py +0 -0
  22. {analyser_hj3415-2.5.3 → analyser_hj3415-2.5.5}/analyser_hj3415/trash.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: analyser_hj3415
3
- Version: 2.5.3
3
+ Version: 2.5.5
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
@@ -2,7 +2,7 @@
2
2
  """
3
3
  import math
4
4
 
5
- from analyser_hj3415 import tools, cli
5
+ from analyser_hj3415 import tools
6
6
  from utils_hj3415 import utils
7
7
  from db_hj3415 import myredis
8
8
 
@@ -16,11 +16,6 @@ logger.addHandler(ch)
16
16
  logger.setLevel(logging.WARNING)
17
17
 
18
18
 
19
- # 주식을 통한 기대수익률 - 금리가 3%일 경우 두배인 6% 정도로 잡는다.
20
- EXPECT_EARN = cli.AnalyserSettingsManager(cli.SETTINGS_FILE).get_value('EXPECT_EARN')
21
- print("EXPECT_EARN: ", EXPECT_EARN)
22
-
23
-
24
19
  def red(code: str) -> dict:
25
20
  """
26
21
  리턴값
@@ -46,6 +41,8 @@ def red(code: str) -> dict:
46
41
  d6, 투자부동산 = c103q.latest_value_pop2('투자부동산')
47
42
 
48
43
  # 사업가치 계산 - 지배주주지분 당기순이익 / 기대수익률
44
+ from analyser_hj3415 import cli
45
+ EXPECT_EARN = cli.AnalyserSettingsManager(cli.SETTINGS_FILE).get_value('EXPECT_EARN')
49
46
  사업가치 = round(utils.nan_to_zero(지배주주당기순이익) / EXPECT_EARN, 2)
50
47
 
51
48
  # 재산가치 계산 - 유동자산 - (유동부채*1.2) + 고정자산중 투자자산
@@ -74,6 +71,7 @@ def red(code: str) -> dict:
74
71
  '재산가치': 재산가치,
75
72
  '부채평가': 부채평가,
76
73
  '발행주식수': 발행주식수,
74
+ 'EXPECT_EARN': EXPECT_EARN,
77
75
  'date': tools.set_data(d1, d2, d3, d4, d5, d6), # ''값을 제거하고 리스트로 바꾼다.
78
76
  }
79
77
 
@@ -93,7 +93,9 @@ def mil(code: str) -> Tuple[int, int, int, int]:
93
93
  if math.isnan(mil_dict['주주수익률']):
94
94
  score1 = 0
95
95
  else:
96
- 주주수익률평가 = math.ceil(mil_dict['주주수익률'] - (eval.EXPECT_EARN * 100))
96
+ from analyser_hj3415 import cli
97
+ EXPECT_EARN = cli.AnalyserSettingsManager(cli.SETTINGS_FILE).get_value('EXPECT_EARN')
98
+ 주주수익률평가 = math.ceil(mil_dict['주주수익률'] - (EXPECT_EARN * 100))
97
99
  score1 = 0 if 0 > 주주수익률평가 else 주주수익률평가
98
100
 
99
101
  # 이익지표 평가
@@ -3,7 +3,7 @@ import os
3
3
 
4
4
  from utils_hj3415 import noti, utils
5
5
  from utils_hj3415.utils import SettingsManager
6
- from analyser_hj3415.myredis import red_ranking, mil_n_score
6
+ from analyser_hj3415.myredis import red_ranking, mil_n_score, red_n_score
7
7
  from db_hj3415 import myredis
8
8
 
9
9
 
@@ -45,6 +45,10 @@ def analyser_manager():
45
45
  # red - ranking 파서
46
46
  ranking_parser = red_subparser.add_parser('ranking', help='red 랭킹 책정 및 레디스 저장')
47
47
  ranking_parser.add_argument('--noti', action='store_true', help='작업 완료 후 메시지 전송 여부')
48
+ # mil - score 파서
49
+ score_parser = red_subparser.add_parser('score', help='red score 책정 및 레디스 저장')
50
+ score_parser.add_argument('code', type=str, help='종목코드 or all')
51
+ score_parser.add_argument('--noti', action='store_true', help='작업 완료 후 메시지 전송 여부')
48
52
 
49
53
  # mil 명령어 서브파서
50
54
  mil_parser = type_subparsers.add_parser('mil', help='millennial 타입')
@@ -70,7 +74,18 @@ def analyser_manager():
70
74
  args = parser.parse_args()
71
75
 
72
76
  if args.type == 'red':
73
- if args.command == 'ranking':
77
+ if args.command == 'score':
78
+ if args.code == 'all':
79
+ print("**** red_n_score all code ****")
80
+ for i, code in enumerate(myredis.Corps.list_all_codes()):
81
+ print(f'{i} / {code}')
82
+ red_n_score(code)
83
+ else:
84
+ assert utils.is_6digit(args.code), "code 인자는 6자리 숫자이어야 합니다."
85
+ print(args.code, red_n_score(args.code))
86
+ if args.noti:
87
+ noti.telegram_to('manager', f"오늘의 red and score({args.code})를 레디스캐시에 저장했습니다.(유효 12시간)")
88
+ elif args.command == 'ranking':
74
89
  result = red_ranking()
75
90
  print(result)
76
91
  if args.noti:
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "analyser_hj3415"
7
- version = "2.5.3"
7
+ version = "2.5.5"
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