kiwoom-cli 0.6.2__tar.gz → 0.6.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/PKG-INFO +1 -1
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/__init__.py +1 -1
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/dashboard.py +15 -7
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/formatters.py +29 -6
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/PKG-INFO +1 -1
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/pyproject.toml +1 -1
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/tests/test_cli.py +1 -1
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/LICENSE +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/README.md +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/api_spec.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/auth.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/client.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/__init__.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/account.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/market.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/order.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/stock.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/stream.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/commands/watch.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/config.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/main.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/output.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/secure_store.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli/streaming.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/SOURCES.txt +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/dependency_links.txt +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/entry_points.txt +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/requires.txt +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/kiwoom_cli.egg-info/top_level.txt +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/setup.cfg +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/tests/test_client.py +0 -0
- {kiwoom_cli-0.6.2 → kiwoom_cli-0.6.3}/tests/test_formatters.py +0 -0
|
@@ -31,13 +31,21 @@ def _build_account_panel(data: dict[str, Any]) -> Panel:
|
|
|
31
31
|
t.add_row("유가잔고평가액", _fmt_number(data.get("tot_est_amt", "")))
|
|
32
32
|
t.add_row("예탁자산평가액", _fmt_number(data.get("aset_evlt_amt", "")))
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
# 평가손익 = 유가잔고평가액 - 총매입금액
|
|
35
|
+
try:
|
|
36
|
+
evlt = int(data.get("tot_est_amt", "0").lstrip("0") or "0")
|
|
37
|
+
pur = int(data.get("tot_pur_amt", "0").lstrip("0") or "0")
|
|
38
|
+
eval_pl = evlt - pur
|
|
39
|
+
eval_pl_rt = (eval_pl / pur * 100) if pur else 0
|
|
40
|
+
eval_pl_str = f"+{eval_pl:,}" if eval_pl > 0 else f"{eval_pl:,}"
|
|
41
|
+
eval_pl_rt_str = f"{eval_pl_rt:+.2f}"
|
|
42
|
+
except (ValueError, ZeroDivisionError):
|
|
43
|
+
eval_pl_str = "-"
|
|
44
|
+
eval_pl_rt_str = "0.00"
|
|
45
|
+
eval_pl = 0
|
|
46
|
+
eval_color = "red" if eval_pl > 0 else ("blue" if eval_pl < 0 else "white")
|
|
47
|
+
t.add_row("평가손익", Text(eval_pl_str, style=eval_color))
|
|
48
|
+
t.add_row("평가손익율", Text(eval_pl_rt_str + "%", style=eval_color))
|
|
41
49
|
|
|
42
50
|
return Panel(t, title="계좌 요약", border_style="green")
|
|
43
51
|
|
|
@@ -240,11 +240,24 @@ def print_account_eval(data: dict[str, Any]) -> None:
|
|
|
240
240
|
summary.add_row("예탁자산평가액", _fmt_number(data.get("aset_evlt_amt", "")))
|
|
241
241
|
summary.add_row("추정예탁자산", _fmt_number(data.get("prsm_dpst_aset_amt", "")))
|
|
242
242
|
|
|
243
|
+
# 평가손익 = 유가잔고평가액 - 총매입금액
|
|
244
|
+
try:
|
|
245
|
+
evlt = int(data.get("tot_est_amt", "0").lstrip("0") or "0")
|
|
246
|
+
pur = int(data.get("tot_pur_amt", "0").lstrip("0") or "0")
|
|
247
|
+
eval_pl = evlt - pur
|
|
248
|
+
eval_pl_rt = (eval_pl / pur * 100) if pur else 0
|
|
249
|
+
eval_pl_str = f"+{eval_pl:,}" if eval_pl > 0 else f"{eval_pl:,}"
|
|
250
|
+
eval_pl_rt_str = f"{eval_pl_rt:+.2f}"
|
|
251
|
+
except (ValueError, ZeroDivisionError):
|
|
252
|
+
eval_pl_str = "-"
|
|
253
|
+
eval_pl_rt_str = "0.00"
|
|
254
|
+
eval_pl = 0
|
|
255
|
+
eval_color = "red" if eval_pl > 0 else ("blue" if eval_pl < 0 else "white")
|
|
256
|
+
summary.add_row("평가손익", Text(eval_pl_str, style=eval_color))
|
|
257
|
+
summary.add_row("평가손익율", Text(eval_pl_rt_str + "%", style=eval_color))
|
|
243
258
|
pl_color = _sign_color(data.get("tdy_lspft", "0"))
|
|
244
|
-
summary.add_row("
|
|
245
|
-
summary.add_row("
|
|
246
|
-
summary.add_row("누적손익", Text(_fmt_number(data.get("lspft", "")), style=_sign_color(data.get("lspft", "0"))))
|
|
247
|
-
summary.add_row("누적손익율", data.get("lspft_rt", "0") + "%")
|
|
259
|
+
summary.add_row("당일실현손익", Text(_fmt_number(data.get("tdy_lspft", "")), style=pl_color))
|
|
260
|
+
summary.add_row("당일실현손익율", Text(data.get("tdy_lspft_rt", "0") + "%", style=pl_color))
|
|
248
261
|
console.print(summary)
|
|
249
262
|
|
|
250
263
|
holdings = data.get("stk_acnt_evlt_prst", [])
|
|
@@ -410,16 +423,25 @@ _FIELD_LABELS: dict[str, str] = {
|
|
|
410
423
|
"acnt_nm": "계좌명", "rmnd_qty": "보유수량", "avg_prc": "평균단가",
|
|
411
424
|
"evlt_amt": "평가금액", "pl_amt": "손익금액", "pl_rt": "손익율",
|
|
412
425
|
"evltv_prft": "평가손익", "prft_rt": "수익률", "tot_prft_rt": "수익률",
|
|
413
|
-
"dt_prft_rt": "기간수익률",
|
|
426
|
+
"tot_evlt_pl": "총평가손익", "dt_prft_rt": "기간수익률",
|
|
414
427
|
"entr": "예수금", "d2_entra": "D+2추정예수금",
|
|
415
428
|
"tot_pur_amt": "총매입금액", "tot_est_amt": "유가잔고평가액",
|
|
416
429
|
"prsm_dpst_aset_amt": "추정예탁자산", "tot_evlt_amt": "총평가금액",
|
|
417
430
|
"pur_amt": "매입금액", "pur_pric": "매입가", "buy_uv": "매입단가",
|
|
431
|
+
"pur_cmsn": "매입수수료", "sell_cmsn": "매도수수료", "sum_cmsn": "총수수료",
|
|
418
432
|
"repl_amt": "대용금", "pymn_alow_amt": "출금가능금액",
|
|
419
433
|
"rmnd": "잔고주수", "remn_amt": "잔고금액", "setl_remn": "결제잔고",
|
|
434
|
+
"trde_able_qty": "매매가능수량", "poss_rt": "보유비중",
|
|
420
435
|
"cmsn": "수수료", "tax": "세금",
|
|
421
436
|
"tdy_trde_cmsn": "당일매매수수료", "tdy_trde_tax": "당일매매세금",
|
|
422
437
|
"tdy_sel_pl": "당일매도손익", "profa_ch": "증거금현금",
|
|
438
|
+
"tot_loan_amt": "총대출금액", "tot_crd_loan_amt": "총신용대출금액",
|
|
439
|
+
"tot_crd_ls_amt": "총신용이자금액",
|
|
440
|
+
"crd_tp_nm": "신용구분명", "crd_loan_dt": "신용대출일",
|
|
441
|
+
"pred_buyq": "전일매수수량", "pred_sellq": "전일매도수량",
|
|
442
|
+
"tdy_buyq": "당일매수수량", "tdy_sellq": "당일매도수량",
|
|
443
|
+
"aset_evlt_amt": "예탁자산평가액", "acnt_evlt_remn_indv_tot": "계좌평가잔고상세",
|
|
444
|
+
"stk_acnt_evlt_prst": "보유종목",
|
|
423
445
|
# 매수/매도
|
|
424
446
|
"buy_qty": "매수수량", "sell_qty": "매도수량",
|
|
425
447
|
"buy_amt": "매수금액", "sell_amt": "매도금액",
|
|
@@ -543,7 +565,8 @@ def print_generic_table(data: dict[str, Any] | list, title: str = "결과") -> N
|
|
|
543
565
|
console.print(t)
|
|
544
566
|
|
|
545
567
|
for list_key, list_val in lists.items():
|
|
546
|
-
|
|
568
|
+
list_title = _FIELD_LABELS.get(list_key, list_key)
|
|
569
|
+
print_generic_table(list_val, title=list_title)
|
|
547
570
|
|
|
548
571
|
|
|
549
572
|
def print_deposit(data: dict[str, Any]) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|