kiwoom-cli 0.6.0__tar.gz → 0.6.2__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.0 → kiwoom_cli-0.6.2}/PKG-INFO +26 -23
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/README.md +25 -22
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/__init__.py +1 -1
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/main.py +26 -9
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/PKG-INFO +26 -23
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/pyproject.toml +1 -1
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/tests/test_cli.py +1 -1
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/LICENSE +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/api_spec.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/auth.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/client.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/__init__.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/account.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/dashboard.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/market.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/order.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/stock.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/stream.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/commands/watch.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/config.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/formatters.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/output.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/secure_store.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli/streaming.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/SOURCES.txt +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/dependency_links.txt +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/entry_points.txt +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/requires.txt +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/kiwoom_cli.egg-info/top_level.txt +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/setup.cfg +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/tests/test_client.py +0 -0
- {kiwoom_cli-0.6.0 → kiwoom_cli-0.6.2}/tests/test_formatters.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiwoom-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: User-friendly CLI for the Kiwoom Securities REST API (키움증권)
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/gejyn14/kiwoom-cli
|
|
@@ -91,18 +91,21 @@ appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다.
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# 프로필별 설정
|
|
94
|
-
kiwoom config setup --profile
|
|
95
|
-
kiwoom config setup --profile
|
|
94
|
+
kiwoom config setup --profile default # 메인계좌
|
|
95
|
+
kiwoom config setup --profile isa # ISA계좌
|
|
96
96
|
|
|
97
|
-
#
|
|
98
|
-
kiwoom config
|
|
97
|
+
# 프로필 설정 변경
|
|
98
|
+
kiwoom config set domain prod # 도메인 변경
|
|
99
|
+
kiwoom config set account 1234567 # 계좌번호 설정
|
|
100
|
+
kiwoom -p isa config set domain mock # 특정 프로필
|
|
99
101
|
|
|
100
|
-
# 프로필 목록
|
|
102
|
+
# 프로필 전환 / 목록
|
|
103
|
+
kiwoom config use isa
|
|
101
104
|
kiwoom config profiles
|
|
102
105
|
|
|
103
106
|
# 특정 프로필로 사용
|
|
104
|
-
kiwoom -p
|
|
105
|
-
kiwoom -p
|
|
107
|
+
kiwoom -p isa account balance
|
|
108
|
+
kiwoom -p isa auth login
|
|
106
109
|
```
|
|
107
110
|
|
|
108
111
|
## 명령어 구조
|
|
@@ -439,17 +442,17 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
439
442
|
|
|
440
443
|
## 참고
|
|
441
444
|
|
|
442
|
-
| 항목
|
|
443
|
-
|
|
|
444
|
-
| 항목
|
|
445
|
-
| ---------------
|
|
446
|
-
| 설정 파일
|
|
447
|
-
| appkey/secretkey | OS 키체인 (암호화 저장)
|
|
448
|
-
| 토큰
|
|
449
|
-
| 캐시 디렉터리
|
|
450
|
-
| 운영 도메인
|
|
451
|
-
| 모의투자 도메인
|
|
452
|
-
| WebSocket
|
|
445
|
+
| 항목 | 값 |
|
|
446
|
+
| ---------------- | ---------------------------------------- |
|
|
447
|
+
| 항목 | 값 |
|
|
448
|
+
| --------------- | ---------------------------- |
|
|
449
|
+
| 설정 파일 | `~/.kiwoom/config.toml` (도메인, 계좌만) |
|
|
450
|
+
| appkey/secretkey | OS 키체인 (암호화 저장) |
|
|
451
|
+
| 토큰 | OS 키체인 |
|
|
452
|
+
| 캐시 디렉터리 | `~/.kiwoom/cache/` |
|
|
453
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
454
|
+
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
455
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
453
456
|
|
|
454
457
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
455
458
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
@@ -461,11 +464,11 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
461
464
|
|
|
462
465
|
인증정보(appkey, secretkey)는 **OS 키체인에 암호화되어 저장**됩니다. 파일로 존재하지 않으며, 비밀번호 없이는 복호화할 수 없습니다.
|
|
463
466
|
|
|
464
|
-
| 항목
|
|
465
|
-
|
|
467
|
+
| 항목 | 저장 방식 | 비밀번호 필요 |
|
|
468
|
+
| ------------------ | ------------------ | :---------------------------------: |
|
|
466
469
|
| appkey / secretkey | 암호화 + OS 키체인 | O (`config setup`, `auth login` 시) |
|
|
467
|
-
| 토큰
|
|
468
|
-
| config.toml
|
|
470
|
+
| 토큰 | OS 키체인 (평문) | X (만료되는 값) |
|
|
471
|
+
| config.toml | 도메인, 계좌번호만 | X |
|
|
469
472
|
|
|
470
473
|
- `config setup` 시 설정한 비밀번호로 appkey/secretkey를 암호화
|
|
471
474
|
- `auth login/logout` 시 비밀번호 확인 후 키체인 접근
|
|
@@ -57,18 +57,21 @@ appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다.
|
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
59
|
# 프로필별 설정
|
|
60
|
-
kiwoom config setup --profile
|
|
61
|
-
kiwoom config setup --profile
|
|
60
|
+
kiwoom config setup --profile default # 메인계좌
|
|
61
|
+
kiwoom config setup --profile isa # ISA계좌
|
|
62
62
|
|
|
63
|
-
#
|
|
64
|
-
kiwoom config
|
|
63
|
+
# 프로필 설정 변경
|
|
64
|
+
kiwoom config set domain prod # 도메인 변경
|
|
65
|
+
kiwoom config set account 1234567 # 계좌번호 설정
|
|
66
|
+
kiwoom -p isa config set domain mock # 특정 프로필
|
|
65
67
|
|
|
66
|
-
# 프로필 목록
|
|
68
|
+
# 프로필 전환 / 목록
|
|
69
|
+
kiwoom config use isa
|
|
67
70
|
kiwoom config profiles
|
|
68
71
|
|
|
69
72
|
# 특정 프로필로 사용
|
|
70
|
-
kiwoom -p
|
|
71
|
-
kiwoom -p
|
|
73
|
+
kiwoom -p isa account balance
|
|
74
|
+
kiwoom -p isa auth login
|
|
72
75
|
```
|
|
73
76
|
|
|
74
77
|
## 명령어 구조
|
|
@@ -405,17 +408,17 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
405
408
|
|
|
406
409
|
## 참고
|
|
407
410
|
|
|
408
|
-
| 항목
|
|
409
|
-
|
|
|
410
|
-
| 항목
|
|
411
|
-
| ---------------
|
|
412
|
-
| 설정 파일
|
|
413
|
-
| appkey/secretkey | OS 키체인 (암호화 저장)
|
|
414
|
-
| 토큰
|
|
415
|
-
| 캐시 디렉터리
|
|
416
|
-
| 운영 도메인
|
|
417
|
-
| 모의투자 도메인
|
|
418
|
-
| WebSocket
|
|
411
|
+
| 항목 | 값 |
|
|
412
|
+
| ---------------- | ---------------------------------------- |
|
|
413
|
+
| 항목 | 값 |
|
|
414
|
+
| --------------- | ---------------------------- |
|
|
415
|
+
| 설정 파일 | `~/.kiwoom/config.toml` (도메인, 계좌만) |
|
|
416
|
+
| appkey/secretkey | OS 키체인 (암호화 저장) |
|
|
417
|
+
| 토큰 | OS 키체인 |
|
|
418
|
+
| 캐시 디렉터리 | `~/.kiwoom/cache/` |
|
|
419
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
420
|
+
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
421
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
419
422
|
|
|
420
423
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
421
424
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
@@ -427,11 +430,11 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
427
430
|
|
|
428
431
|
인증정보(appkey, secretkey)는 **OS 키체인에 암호화되어 저장**됩니다. 파일로 존재하지 않으며, 비밀번호 없이는 복호화할 수 없습니다.
|
|
429
432
|
|
|
430
|
-
| 항목
|
|
431
|
-
|
|
433
|
+
| 항목 | 저장 방식 | 비밀번호 필요 |
|
|
434
|
+
| ------------------ | ------------------ | :---------------------------------: |
|
|
432
435
|
| appkey / secretkey | 암호화 + OS 키체인 | O (`config setup`, `auth login` 시) |
|
|
433
|
-
| 토큰
|
|
434
|
-
| config.toml
|
|
436
|
+
| 토큰 | OS 키체인 (평문) | X (만료되는 값) |
|
|
437
|
+
| config.toml | 도메인, 계좌번호만 | X |
|
|
435
438
|
|
|
436
439
|
- `config setup` 시 설정한 비밀번호로 appkey/secretkey를 암호화
|
|
437
440
|
- `auth login/logout` 시 비밀번호 확인 후 키체인 접근
|
|
@@ -150,16 +150,30 @@ def config_show(ctx):
|
|
|
150
150
|
console.print(f" 보안: [bold]{'SecureStore 활성' if initialized else '미초기화'}[/]")
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
@config_cmd.command("
|
|
154
|
-
@click.argument("
|
|
153
|
+
@config_cmd.command("set")
|
|
154
|
+
@click.argument("key", type=click.Choice(["domain", "account"]))
|
|
155
|
+
@click.argument("value")
|
|
155
156
|
@click.pass_context
|
|
156
|
-
def
|
|
157
|
-
"""
|
|
157
|
+
def config_set(ctx, key: str, value: str):
|
|
158
|
+
"""프로필 설정 변경. (예: kiwoom config set domain prod)"""
|
|
158
159
|
profile = config.resolve_profile(ctx.obj.get("profile") if ctx.obj else None)
|
|
160
|
+
if key == "domain" and value not in ("prod", "mock"):
|
|
161
|
+
console.print("[red]domain은 prod 또는 mock만 가능합니다.[/]")
|
|
162
|
+
raise SystemExit(1)
|
|
159
163
|
cfg = config.load_config()
|
|
160
|
-
cfg.setdefault("profiles", {}).setdefault(profile, {})[
|
|
164
|
+
cfg.setdefault("profiles", {}).setdefault(profile, {})[key] = value
|
|
161
165
|
config.save_config(cfg)
|
|
162
|
-
|
|
166
|
+
display = config.DOMAINS[value] if key == "domain" else value
|
|
167
|
+
console.print(f"[green]{key} 변경:[/] {display} (프로필: {profile})")
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# Backward compatibility: keep 'domain' as alias
|
|
171
|
+
@config_cmd.command("domain", hidden=True)
|
|
172
|
+
@click.argument("domain", type=click.Choice(["prod", "mock"]))
|
|
173
|
+
@click.pass_context
|
|
174
|
+
def config_domain(ctx, domain: str):
|
|
175
|
+
"""도메인 변경 (config set domain의 별칭)."""
|
|
176
|
+
ctx.invoke(config_set, key="domain", value=domain)
|
|
163
177
|
|
|
164
178
|
|
|
165
179
|
@config_cmd.command("use")
|
|
@@ -183,11 +197,14 @@ def config_profiles():
|
|
|
183
197
|
if not profiles:
|
|
184
198
|
console.print("[yellow]등록된 프로필이 없습니다.[/]")
|
|
185
199
|
return
|
|
200
|
+
console.print(f" 현재 프로필: [bold green]{default}[/]")
|
|
201
|
+
console.print()
|
|
186
202
|
for name, settings in profiles.items():
|
|
187
|
-
marker = " [green]
|
|
203
|
+
marker = " [green]*[/]" if name == default else " "
|
|
188
204
|
domain = settings.get("domain", "mock")
|
|
189
|
-
account = settings.get("account", "
|
|
190
|
-
|
|
205
|
+
account = settings.get("account", "")
|
|
206
|
+
account_str = f" 계좌={account}" if account else ""
|
|
207
|
+
console.print(f" {marker} {name:15s} 도메인={domain}{account_str}")
|
|
191
208
|
|
|
192
209
|
|
|
193
210
|
# ── Auth ──────────────────────────────────────────────
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiwoom-cli
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: User-friendly CLI for the Kiwoom Securities REST API (키움증권)
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/gejyn14/kiwoom-cli
|
|
@@ -91,18 +91,21 @@ appkey/secretkey는 보안을 위해 환경변수를 지원하지 않습니다.
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# 프로필별 설정
|
|
94
|
-
kiwoom config setup --profile
|
|
95
|
-
kiwoom config setup --profile
|
|
94
|
+
kiwoom config setup --profile default # 메인계좌
|
|
95
|
+
kiwoom config setup --profile isa # ISA계좌
|
|
96
96
|
|
|
97
|
-
#
|
|
98
|
-
kiwoom config
|
|
97
|
+
# 프로필 설정 변경
|
|
98
|
+
kiwoom config set domain prod # 도메인 변경
|
|
99
|
+
kiwoom config set account 1234567 # 계좌번호 설정
|
|
100
|
+
kiwoom -p isa config set domain mock # 특정 프로필
|
|
99
101
|
|
|
100
|
-
# 프로필 목록
|
|
102
|
+
# 프로필 전환 / 목록
|
|
103
|
+
kiwoom config use isa
|
|
101
104
|
kiwoom config profiles
|
|
102
105
|
|
|
103
106
|
# 특정 프로필로 사용
|
|
104
|
-
kiwoom -p
|
|
105
|
-
kiwoom -p
|
|
107
|
+
kiwoom -p isa account balance
|
|
108
|
+
kiwoom -p isa auth login
|
|
106
109
|
```
|
|
107
110
|
|
|
108
111
|
## 명령어 구조
|
|
@@ -439,17 +442,17 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
439
442
|
|
|
440
443
|
## 참고
|
|
441
444
|
|
|
442
|
-
| 항목
|
|
443
|
-
|
|
|
444
|
-
| 항목
|
|
445
|
-
| ---------------
|
|
446
|
-
| 설정 파일
|
|
447
|
-
| appkey/secretkey | OS 키체인 (암호화 저장)
|
|
448
|
-
| 토큰
|
|
449
|
-
| 캐시 디렉터리
|
|
450
|
-
| 운영 도메인
|
|
451
|
-
| 모의투자 도메인
|
|
452
|
-
| WebSocket
|
|
445
|
+
| 항목 | 값 |
|
|
446
|
+
| ---------------- | ---------------------------------------- |
|
|
447
|
+
| 항목 | 값 |
|
|
448
|
+
| --------------- | ---------------------------- |
|
|
449
|
+
| 설정 파일 | `~/.kiwoom/config.toml` (도메인, 계좌만) |
|
|
450
|
+
| appkey/secretkey | OS 키체인 (암호화 저장) |
|
|
451
|
+
| 토큰 | OS 키체인 |
|
|
452
|
+
| 캐시 디렉터리 | `~/.kiwoom/cache/` |
|
|
453
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
454
|
+
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
455
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
453
456
|
|
|
454
457
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
455
458
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
@@ -461,11 +464,11 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
461
464
|
|
|
462
465
|
인증정보(appkey, secretkey)는 **OS 키체인에 암호화되어 저장**됩니다. 파일로 존재하지 않으며, 비밀번호 없이는 복호화할 수 없습니다.
|
|
463
466
|
|
|
464
|
-
| 항목
|
|
465
|
-
|
|
467
|
+
| 항목 | 저장 방식 | 비밀번호 필요 |
|
|
468
|
+
| ------------------ | ------------------ | :---------------------------------: |
|
|
466
469
|
| appkey / secretkey | 암호화 + OS 키체인 | O (`config setup`, `auth login` 시) |
|
|
467
|
-
| 토큰
|
|
468
|
-
| config.toml
|
|
470
|
+
| 토큰 | OS 키체인 (평문) | X (만료되는 값) |
|
|
471
|
+
| config.toml | 도메인, 계좌번호만 | X |
|
|
469
472
|
|
|
470
473
|
- `config setup` 시 설정한 비밀번호로 appkey/secretkey를 암호화
|
|
471
474
|
- `auth login/logout` 시 비밀번호 확인 후 키체인 접근
|
|
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
|