kiwoom-cli 0.2.2__tar.gz → 0.2.4__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.2.2 → kiwoom_cli-0.2.4}/PKG-INFO +92 -94
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/README.md +91 -93
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/__init__.py +1 -1
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/auth.py +3 -1
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/PKG-INFO +92 -94
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/pyproject.toml +1 -1
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/tests/test_cli.py +1 -1
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/LICENSE +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/api_spec.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/client.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/__init__.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/account.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/dashboard.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/market.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/order.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/stock.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/stream.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/commands/watch.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/config.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/formatters.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/main.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/output.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli/streaming.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/SOURCES.txt +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/dependency_links.txt +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/entry_points.txt +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/requires.txt +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/kiwoom_cli.egg-info/top_level.txt +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/setup.cfg +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/tests/test_client.py +0 -0
- {kiwoom_cli-0.2.2 → kiwoom_cli-0.2.4}/tests/test_formatters.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiwoom-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
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
|
|
@@ -44,9 +44,7 @@ Dynamic: license-file
|
|
|
44
44
|
## 설치
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
|
|
48
|
-
cd kiwoom-cli
|
|
49
|
-
pip install -e .
|
|
47
|
+
pip install kiwoom-cli
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
## 시작하기
|
|
@@ -148,34 +146,34 @@ kiwoom stock credit trend 005930 --date 20260301 --type loan
|
|
|
148
146
|
<details>
|
|
149
147
|
<summary>전체 stock 하위 명령어</summary>
|
|
150
148
|
|
|
151
|
-
| 명령
|
|
152
|
-
|
|
153
|
-
| `info`
|
|
154
|
-
| `price`
|
|
155
|
-
| `detail`
|
|
156
|
-
| `orderbook`
|
|
157
|
-
| `daily`
|
|
158
|
-
| `timeprice`
|
|
159
|
-
| `daily-price`
|
|
160
|
-
| `after-hours`
|
|
161
|
-
| `quote-info`
|
|
162
|
-
| `exec`
|
|
163
|
-
| `trader`
|
|
164
|
-
| `today-exec`
|
|
165
|
-
| `today-volume`
|
|
166
|
-
| `tick-strength`
|
|
167
|
-
| `daily-strength` | 체결강도 일별
|
|
168
|
-
| `foreign`
|
|
169
|
-
| `institution`
|
|
170
|
-
| `short`
|
|
171
|
-
| `search`
|
|
172
|
-
| `watchlist`
|
|
173
|
-
| `brokers`
|
|
174
|
-
| `chart *`
|
|
175
|
-
| `investor *`
|
|
176
|
-
| `analysis *`
|
|
177
|
-
| `lending *`
|
|
178
|
-
| `credit *`
|
|
149
|
+
| 명령 | 설명 |
|
|
150
|
+
| ---------------- | ----------------------------------------------------- |
|
|
151
|
+
| `info` | 종목 기본정보 |
|
|
152
|
+
| `price` | 현재가 한 줄 |
|
|
153
|
+
| `detail` | 종목정보 상세 |
|
|
154
|
+
| `orderbook` | 10단계 호가창 |
|
|
155
|
+
| `daily` | 일/주/월별 시세 |
|
|
156
|
+
| `timeprice` | 시분 시세 |
|
|
157
|
+
| `daily-price` | 일별주가 |
|
|
158
|
+
| `after-hours` | 시간외단일가 |
|
|
159
|
+
| `quote-info` | 시세표성정보 |
|
|
160
|
+
| `exec` | 체결정보 |
|
|
161
|
+
| `trader` | 거래원 |
|
|
162
|
+
| `today-exec` | 당일/전일 체결 |
|
|
163
|
+
| `today-volume` | 당일/전일 체결량 |
|
|
164
|
+
| `tick-strength` | 체결강도 시간별 |
|
|
165
|
+
| `daily-strength` | 체결강도 일별 |
|
|
166
|
+
| `foreign` | 외국인 매매동향 |
|
|
167
|
+
| `institution` | 기관 매매동향 |
|
|
168
|
+
| `short` | 공매도 추이 |
|
|
169
|
+
| `search` | 종목 리스트/검색 |
|
|
170
|
+
| `watchlist` | 관심종목 |
|
|
171
|
+
| `brokers` | 회원사 리스트 |
|
|
172
|
+
| `chart *` | 틱/분봉/일봉/주봉/월봉/년봉, 투자자별 차트 |
|
|
173
|
+
| `investor *` | 기관매매, 투자자별매매, 프로그램매매 등 10개 |
|
|
174
|
+
| `analysis *` | 거래상세, 거래량갱신, 매물대, PER, VI, 증권사 등 10개 |
|
|
175
|
+
| `lending *` | 대차거래 추이/상위/종목별/내역 |
|
|
176
|
+
| `credit *` | 신용매매동향, 신용융자 가능 |
|
|
179
177
|
|
|
180
178
|
</details>
|
|
181
179
|
|
|
@@ -200,35 +198,35 @@ kiwoom account orderable amount 005930 --side buy --price 70000
|
|
|
200
198
|
<details>
|
|
201
199
|
<summary>전체 account 하위 명령어</summary>
|
|
202
200
|
|
|
203
|
-
| 그룹
|
|
204
|
-
|
|
205
|
-
| -
|
|
206
|
-
| -
|
|
207
|
-
| -
|
|
208
|
-
| -
|
|
209
|
-
| -
|
|
210
|
-
| -
|
|
211
|
-
| `returns`
|
|
212
|
-
| `returns`
|
|
213
|
-
| `returns`
|
|
214
|
-
| `returns`
|
|
215
|
-
| `pnl`
|
|
216
|
-
| `pnl`
|
|
217
|
-
| `pnl`
|
|
218
|
-
| `pnl`
|
|
219
|
-
| `orders`
|
|
220
|
-
| `orders`
|
|
221
|
-
| `orders`
|
|
222
|
-
| `orders`
|
|
223
|
-
| `orders`
|
|
224
|
-
| `holdings`
|
|
225
|
-
| `holdings`
|
|
226
|
-
| `holdings`
|
|
227
|
-
| `orderable` | `amount`
|
|
228
|
-
| `orderable` | `margin-qty`
|
|
229
|
-
| `orderable` | `credit-qty`
|
|
230
|
-
| `history`
|
|
231
|
-
| `history`
|
|
201
|
+
| 그룹 | 명령 | 설명 |
|
|
202
|
+
| ----------- | --------------- | ------------------- |
|
|
203
|
+
| - | `list` | 계좌번호 조회 |
|
|
204
|
+
| - | `balance` | 계좌 평가현황 |
|
|
205
|
+
| - | `deposit` | 예수금 상세 |
|
|
206
|
+
| - | `asset` | 추정자산 |
|
|
207
|
+
| - | `today` | 당일현황 |
|
|
208
|
+
| - | `margin-detail` | 증거금 세부내역 |
|
|
209
|
+
| `returns` | `summary` | 계좌 수익률 |
|
|
210
|
+
| `returns` | `daily-balance` | 일별 잔고수익률 |
|
|
211
|
+
| `returns` | `daily-detail` | 일별 수익률 상세 |
|
|
212
|
+
| `returns` | `daily-asset` | 일별 예탁자산 |
|
|
213
|
+
| `pnl` | `today` | 당일 실현손익 |
|
|
214
|
+
| `pnl` | `by-date` | 일자별 실현손익 |
|
|
215
|
+
| `pnl` | `by-period` | 기간별 실현손익 |
|
|
216
|
+
| `pnl` | `daily` | 일자별 실현손익 |
|
|
217
|
+
| `orders` | `pending` | 미체결 주문 |
|
|
218
|
+
| `orders` | `executed` | 체결 내역 |
|
|
219
|
+
| `orders` | `detail` | 주문체결 상세 |
|
|
220
|
+
| `orders` | `status` | 주문체결 현황 |
|
|
221
|
+
| `orders` | `split-detail` | 분할주문 상세 |
|
|
222
|
+
| `holdings` | `eval` | 계좌평가 잔고 |
|
|
223
|
+
| `holdings` | `settled` | 체결잔고 |
|
|
224
|
+
| `holdings` | `next-settle` | 익일결제예정 |
|
|
225
|
+
| `orderable` | `amount` | 주문가능 금액 |
|
|
226
|
+
| `orderable` | `margin-qty` | 증거금율별 수량 |
|
|
227
|
+
| `orderable` | `credit-qty` | 신용보증금율별 수량 |
|
|
228
|
+
| `history` | `transactions` | 위탁종합 거래내역 |
|
|
229
|
+
| `history` | `journal` | 당일 매매일지 |
|
|
232
230
|
|
|
233
231
|
</details>
|
|
234
232
|
|
|
@@ -327,27 +325,27 @@ kiwoom stream custom 0B,0D 005930 # 타입 직접 지정
|
|
|
327
325
|
kiwoom stream types # 타입 코드 목록
|
|
328
326
|
```
|
|
329
327
|
|
|
330
|
-
| 코드 | 명령
|
|
331
|
-
|
|
332
|
-
| 00
|
|
333
|
-
| 04
|
|
334
|
-
| 0A
|
|
335
|
-
| 0B
|
|
336
|
-
| 0C
|
|
337
|
-
| 0D
|
|
338
|
-
| 0E
|
|
339
|
-
| 0F
|
|
340
|
-
| 0G
|
|
341
|
-
| 0H
|
|
342
|
-
| 0I
|
|
343
|
-
| 0J
|
|
344
|
-
| 0U
|
|
345
|
-
| 0g
|
|
346
|
-
| 0m
|
|
347
|
-
| 0s
|
|
348
|
-
| 0u
|
|
349
|
-
| 0w
|
|
350
|
-
| 1h
|
|
328
|
+
| 코드 | 명령 | 설명 |
|
|
329
|
+
| ---- | --------------- | ------------ |
|
|
330
|
+
| 00 | `order` | 주문체결 |
|
|
331
|
+
| 04 | `balance` | 잔고 |
|
|
332
|
+
| 0A | `price` | 주식기세 |
|
|
333
|
+
| 0B | `quote` | 주식체결 |
|
|
334
|
+
| 0C | `best-bid` | 우선호가 |
|
|
335
|
+
| 0D | `orderbook` | 호가잔량 |
|
|
336
|
+
| 0E | `after-hours` | 시간외호가 |
|
|
337
|
+
| 0F | `trader` | 당일거래원 |
|
|
338
|
+
| 0G | `etf-nav` | ETF NAV |
|
|
339
|
+
| 0H | `expected` | 예상체결 |
|
|
340
|
+
| 0I | `gold` | 국제금환산 |
|
|
341
|
+
| 0J | `sector-index` | 업종지수 |
|
|
342
|
+
| 0U | `sector-change` | 업종등락 |
|
|
343
|
+
| 0g | `stock-info` | 종목정보 |
|
|
344
|
+
| 0m | `elw-theory` | ELW 이론가 |
|
|
345
|
+
| 0s | `market-time` | 장시작시간 |
|
|
346
|
+
| 0u | `elw-indicator` | ELW 지표 |
|
|
347
|
+
| 0w | `program` | 프로그램매매 |
|
|
348
|
+
| 1h | `vi` | VI발동/해제 |
|
|
351
349
|
|
|
352
350
|
---
|
|
353
351
|
|
|
@@ -410,22 +408,22 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
410
408
|
|
|
411
409
|
## Exit Codes
|
|
412
410
|
|
|
413
|
-
| 코드 | 의미
|
|
414
|
-
|
|
415
|
-
| 0
|
|
416
|
-
| 1
|
|
417
|
-
| 2
|
|
418
|
-
| 3
|
|
411
|
+
| 코드 | 의미 |
|
|
412
|
+
| ---- | ----------------------- |
|
|
413
|
+
| 0 | 성공 |
|
|
414
|
+
| 1 | 입력 오류 (잘못된 인자) |
|
|
415
|
+
| 2 | API/네트워크 오류 |
|
|
416
|
+
| 3 | 인증 필요 (토큰 만료) |
|
|
419
417
|
|
|
420
418
|
## 참고
|
|
421
419
|
|
|
422
|
-
| 항목
|
|
423
|
-
|
|
424
|
-
| 설정 파일
|
|
425
|
-
| 토큰 파일
|
|
426
|
-
| 운영 도메인
|
|
420
|
+
| 항목 | 값 |
|
|
421
|
+
| --------------- | ---------------------------- |
|
|
422
|
+
| 설정 파일 | `~/.kiwoom/config.toml` |
|
|
423
|
+
| 토큰 파일 | `~/.kiwoom/token` |
|
|
424
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
427
425
|
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
428
|
-
| WebSocket
|
|
426
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
429
427
|
|
|
430
428
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
431
429
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
## 설치
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
15
|
-
cd kiwoom-cli
|
|
16
|
-
pip install -e .
|
|
14
|
+
pip install kiwoom-cli
|
|
17
15
|
```
|
|
18
16
|
|
|
19
17
|
## 시작하기
|
|
@@ -115,34 +113,34 @@ kiwoom stock credit trend 005930 --date 20260301 --type loan
|
|
|
115
113
|
<details>
|
|
116
114
|
<summary>전체 stock 하위 명령어</summary>
|
|
117
115
|
|
|
118
|
-
| 명령
|
|
119
|
-
|
|
120
|
-
| `info`
|
|
121
|
-
| `price`
|
|
122
|
-
| `detail`
|
|
123
|
-
| `orderbook`
|
|
124
|
-
| `daily`
|
|
125
|
-
| `timeprice`
|
|
126
|
-
| `daily-price`
|
|
127
|
-
| `after-hours`
|
|
128
|
-
| `quote-info`
|
|
129
|
-
| `exec`
|
|
130
|
-
| `trader`
|
|
131
|
-
| `today-exec`
|
|
132
|
-
| `today-volume`
|
|
133
|
-
| `tick-strength`
|
|
134
|
-
| `daily-strength` | 체결강도 일별
|
|
135
|
-
| `foreign`
|
|
136
|
-
| `institution`
|
|
137
|
-
| `short`
|
|
138
|
-
| `search`
|
|
139
|
-
| `watchlist`
|
|
140
|
-
| `brokers`
|
|
141
|
-
| `chart *`
|
|
142
|
-
| `investor *`
|
|
143
|
-
| `analysis *`
|
|
144
|
-
| `lending *`
|
|
145
|
-
| `credit *`
|
|
116
|
+
| 명령 | 설명 |
|
|
117
|
+
| ---------------- | ----------------------------------------------------- |
|
|
118
|
+
| `info` | 종목 기본정보 |
|
|
119
|
+
| `price` | 현재가 한 줄 |
|
|
120
|
+
| `detail` | 종목정보 상세 |
|
|
121
|
+
| `orderbook` | 10단계 호가창 |
|
|
122
|
+
| `daily` | 일/주/월별 시세 |
|
|
123
|
+
| `timeprice` | 시분 시세 |
|
|
124
|
+
| `daily-price` | 일별주가 |
|
|
125
|
+
| `after-hours` | 시간외단일가 |
|
|
126
|
+
| `quote-info` | 시세표성정보 |
|
|
127
|
+
| `exec` | 체결정보 |
|
|
128
|
+
| `trader` | 거래원 |
|
|
129
|
+
| `today-exec` | 당일/전일 체결 |
|
|
130
|
+
| `today-volume` | 당일/전일 체결량 |
|
|
131
|
+
| `tick-strength` | 체결강도 시간별 |
|
|
132
|
+
| `daily-strength` | 체결강도 일별 |
|
|
133
|
+
| `foreign` | 외국인 매매동향 |
|
|
134
|
+
| `institution` | 기관 매매동향 |
|
|
135
|
+
| `short` | 공매도 추이 |
|
|
136
|
+
| `search` | 종목 리스트/검색 |
|
|
137
|
+
| `watchlist` | 관심종목 |
|
|
138
|
+
| `brokers` | 회원사 리스트 |
|
|
139
|
+
| `chart *` | 틱/분봉/일봉/주봉/월봉/년봉, 투자자별 차트 |
|
|
140
|
+
| `investor *` | 기관매매, 투자자별매매, 프로그램매매 등 10개 |
|
|
141
|
+
| `analysis *` | 거래상세, 거래량갱신, 매물대, PER, VI, 증권사 등 10개 |
|
|
142
|
+
| `lending *` | 대차거래 추이/상위/종목별/내역 |
|
|
143
|
+
| `credit *` | 신용매매동향, 신용융자 가능 |
|
|
146
144
|
|
|
147
145
|
</details>
|
|
148
146
|
|
|
@@ -167,35 +165,35 @@ kiwoom account orderable amount 005930 --side buy --price 70000
|
|
|
167
165
|
<details>
|
|
168
166
|
<summary>전체 account 하위 명령어</summary>
|
|
169
167
|
|
|
170
|
-
| 그룹
|
|
171
|
-
|
|
172
|
-
| -
|
|
173
|
-
| -
|
|
174
|
-
| -
|
|
175
|
-
| -
|
|
176
|
-
| -
|
|
177
|
-
| -
|
|
178
|
-
| `returns`
|
|
179
|
-
| `returns`
|
|
180
|
-
| `returns`
|
|
181
|
-
| `returns`
|
|
182
|
-
| `pnl`
|
|
183
|
-
| `pnl`
|
|
184
|
-
| `pnl`
|
|
185
|
-
| `pnl`
|
|
186
|
-
| `orders`
|
|
187
|
-
| `orders`
|
|
188
|
-
| `orders`
|
|
189
|
-
| `orders`
|
|
190
|
-
| `orders`
|
|
191
|
-
| `holdings`
|
|
192
|
-
| `holdings`
|
|
193
|
-
| `holdings`
|
|
194
|
-
| `orderable` | `amount`
|
|
195
|
-
| `orderable` | `margin-qty`
|
|
196
|
-
| `orderable` | `credit-qty`
|
|
197
|
-
| `history`
|
|
198
|
-
| `history`
|
|
168
|
+
| 그룹 | 명령 | 설명 |
|
|
169
|
+
| ----------- | --------------- | ------------------- |
|
|
170
|
+
| - | `list` | 계좌번호 조회 |
|
|
171
|
+
| - | `balance` | 계좌 평가현황 |
|
|
172
|
+
| - | `deposit` | 예수금 상세 |
|
|
173
|
+
| - | `asset` | 추정자산 |
|
|
174
|
+
| - | `today` | 당일현황 |
|
|
175
|
+
| - | `margin-detail` | 증거금 세부내역 |
|
|
176
|
+
| `returns` | `summary` | 계좌 수익률 |
|
|
177
|
+
| `returns` | `daily-balance` | 일별 잔고수익률 |
|
|
178
|
+
| `returns` | `daily-detail` | 일별 수익률 상세 |
|
|
179
|
+
| `returns` | `daily-asset` | 일별 예탁자산 |
|
|
180
|
+
| `pnl` | `today` | 당일 실현손익 |
|
|
181
|
+
| `pnl` | `by-date` | 일자별 실현손익 |
|
|
182
|
+
| `pnl` | `by-period` | 기간별 실현손익 |
|
|
183
|
+
| `pnl` | `daily` | 일자별 실현손익 |
|
|
184
|
+
| `orders` | `pending` | 미체결 주문 |
|
|
185
|
+
| `orders` | `executed` | 체결 내역 |
|
|
186
|
+
| `orders` | `detail` | 주문체결 상세 |
|
|
187
|
+
| `orders` | `status` | 주문체결 현황 |
|
|
188
|
+
| `orders` | `split-detail` | 분할주문 상세 |
|
|
189
|
+
| `holdings` | `eval` | 계좌평가 잔고 |
|
|
190
|
+
| `holdings` | `settled` | 체결잔고 |
|
|
191
|
+
| `holdings` | `next-settle` | 익일결제예정 |
|
|
192
|
+
| `orderable` | `amount` | 주문가능 금액 |
|
|
193
|
+
| `orderable` | `margin-qty` | 증거금율별 수량 |
|
|
194
|
+
| `orderable` | `credit-qty` | 신용보증금율별 수량 |
|
|
195
|
+
| `history` | `transactions` | 위탁종합 거래내역 |
|
|
196
|
+
| `history` | `journal` | 당일 매매일지 |
|
|
199
197
|
|
|
200
198
|
</details>
|
|
201
199
|
|
|
@@ -294,27 +292,27 @@ kiwoom stream custom 0B,0D 005930 # 타입 직접 지정
|
|
|
294
292
|
kiwoom stream types # 타입 코드 목록
|
|
295
293
|
```
|
|
296
294
|
|
|
297
|
-
| 코드 | 명령
|
|
298
|
-
|
|
299
|
-
| 00
|
|
300
|
-
| 04
|
|
301
|
-
| 0A
|
|
302
|
-
| 0B
|
|
303
|
-
| 0C
|
|
304
|
-
| 0D
|
|
305
|
-
| 0E
|
|
306
|
-
| 0F
|
|
307
|
-
| 0G
|
|
308
|
-
| 0H
|
|
309
|
-
| 0I
|
|
310
|
-
| 0J
|
|
311
|
-
| 0U
|
|
312
|
-
| 0g
|
|
313
|
-
| 0m
|
|
314
|
-
| 0s
|
|
315
|
-
| 0u
|
|
316
|
-
| 0w
|
|
317
|
-
| 1h
|
|
295
|
+
| 코드 | 명령 | 설명 |
|
|
296
|
+
| ---- | --------------- | ------------ |
|
|
297
|
+
| 00 | `order` | 주문체결 |
|
|
298
|
+
| 04 | `balance` | 잔고 |
|
|
299
|
+
| 0A | `price` | 주식기세 |
|
|
300
|
+
| 0B | `quote` | 주식체결 |
|
|
301
|
+
| 0C | `best-bid` | 우선호가 |
|
|
302
|
+
| 0D | `orderbook` | 호가잔량 |
|
|
303
|
+
| 0E | `after-hours` | 시간외호가 |
|
|
304
|
+
| 0F | `trader` | 당일거래원 |
|
|
305
|
+
| 0G | `etf-nav` | ETF NAV |
|
|
306
|
+
| 0H | `expected` | 예상체결 |
|
|
307
|
+
| 0I | `gold` | 국제금환산 |
|
|
308
|
+
| 0J | `sector-index` | 업종지수 |
|
|
309
|
+
| 0U | `sector-change` | 업종등락 |
|
|
310
|
+
| 0g | `stock-info` | 종목정보 |
|
|
311
|
+
| 0m | `elw-theory` | ELW 이론가 |
|
|
312
|
+
| 0s | `market-time` | 장시작시간 |
|
|
313
|
+
| 0u | `elw-indicator` | ELW 지표 |
|
|
314
|
+
| 0w | `program` | 프로그램매매 |
|
|
315
|
+
| 1h | `vi` | VI발동/해제 |
|
|
318
316
|
|
|
319
317
|
---
|
|
320
318
|
|
|
@@ -377,22 +375,22 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
377
375
|
|
|
378
376
|
## Exit Codes
|
|
379
377
|
|
|
380
|
-
| 코드 | 의미
|
|
381
|
-
|
|
382
|
-
| 0
|
|
383
|
-
| 1
|
|
384
|
-
| 2
|
|
385
|
-
| 3
|
|
378
|
+
| 코드 | 의미 |
|
|
379
|
+
| ---- | ----------------------- |
|
|
380
|
+
| 0 | 성공 |
|
|
381
|
+
| 1 | 입력 오류 (잘못된 인자) |
|
|
382
|
+
| 2 | API/네트워크 오류 |
|
|
383
|
+
| 3 | 인증 필요 (토큰 만료) |
|
|
386
384
|
|
|
387
385
|
## 참고
|
|
388
386
|
|
|
389
|
-
| 항목
|
|
390
|
-
|
|
391
|
-
| 설정 파일
|
|
392
|
-
| 토큰 파일
|
|
393
|
-
| 운영 도메인
|
|
387
|
+
| 항목 | 값 |
|
|
388
|
+
| --------------- | ---------------------------- |
|
|
389
|
+
| 설정 파일 | `~/.kiwoom/config.toml` |
|
|
390
|
+
| 토큰 파일 | `~/.kiwoom/token` |
|
|
391
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
394
392
|
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
395
|
-
| WebSocket
|
|
393
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
396
394
|
|
|
397
395
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
398
396
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
@@ -5,6 +5,7 @@ Tokens are stored in ~/.kiwoom/token and loaded automatically by the client.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
+
import os
|
|
8
9
|
|
|
9
10
|
from . import config
|
|
10
11
|
|
|
@@ -14,7 +15,8 @@ TOKEN_FILE = config.CONFIG_DIR / "token"
|
|
|
14
15
|
def save_token(token: str) -> None:
|
|
15
16
|
config.ensure_config_dir()
|
|
16
17
|
TOKEN_FILE.write_text(token)
|
|
17
|
-
|
|
18
|
+
if os.name != "nt":
|
|
19
|
+
TOKEN_FILE.chmod(0o600)
|
|
18
20
|
|
|
19
21
|
|
|
20
22
|
def load_token() -> str | None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kiwoom-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
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
|
|
@@ -44,9 +44,7 @@ Dynamic: license-file
|
|
|
44
44
|
## 설치
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
|
|
48
|
-
cd kiwoom-cli
|
|
49
|
-
pip install -e .
|
|
47
|
+
pip install kiwoom-cli
|
|
50
48
|
```
|
|
51
49
|
|
|
52
50
|
## 시작하기
|
|
@@ -148,34 +146,34 @@ kiwoom stock credit trend 005930 --date 20260301 --type loan
|
|
|
148
146
|
<details>
|
|
149
147
|
<summary>전체 stock 하위 명령어</summary>
|
|
150
148
|
|
|
151
|
-
| 명령
|
|
152
|
-
|
|
153
|
-
| `info`
|
|
154
|
-
| `price`
|
|
155
|
-
| `detail`
|
|
156
|
-
| `orderbook`
|
|
157
|
-
| `daily`
|
|
158
|
-
| `timeprice`
|
|
159
|
-
| `daily-price`
|
|
160
|
-
| `after-hours`
|
|
161
|
-
| `quote-info`
|
|
162
|
-
| `exec`
|
|
163
|
-
| `trader`
|
|
164
|
-
| `today-exec`
|
|
165
|
-
| `today-volume`
|
|
166
|
-
| `tick-strength`
|
|
167
|
-
| `daily-strength` | 체결강도 일별
|
|
168
|
-
| `foreign`
|
|
169
|
-
| `institution`
|
|
170
|
-
| `short`
|
|
171
|
-
| `search`
|
|
172
|
-
| `watchlist`
|
|
173
|
-
| `brokers`
|
|
174
|
-
| `chart *`
|
|
175
|
-
| `investor *`
|
|
176
|
-
| `analysis *`
|
|
177
|
-
| `lending *`
|
|
178
|
-
| `credit *`
|
|
149
|
+
| 명령 | 설명 |
|
|
150
|
+
| ---------------- | ----------------------------------------------------- |
|
|
151
|
+
| `info` | 종목 기본정보 |
|
|
152
|
+
| `price` | 현재가 한 줄 |
|
|
153
|
+
| `detail` | 종목정보 상세 |
|
|
154
|
+
| `orderbook` | 10단계 호가창 |
|
|
155
|
+
| `daily` | 일/주/월별 시세 |
|
|
156
|
+
| `timeprice` | 시분 시세 |
|
|
157
|
+
| `daily-price` | 일별주가 |
|
|
158
|
+
| `after-hours` | 시간외단일가 |
|
|
159
|
+
| `quote-info` | 시세표성정보 |
|
|
160
|
+
| `exec` | 체결정보 |
|
|
161
|
+
| `trader` | 거래원 |
|
|
162
|
+
| `today-exec` | 당일/전일 체결 |
|
|
163
|
+
| `today-volume` | 당일/전일 체결량 |
|
|
164
|
+
| `tick-strength` | 체결강도 시간별 |
|
|
165
|
+
| `daily-strength` | 체결강도 일별 |
|
|
166
|
+
| `foreign` | 외국인 매매동향 |
|
|
167
|
+
| `institution` | 기관 매매동향 |
|
|
168
|
+
| `short` | 공매도 추이 |
|
|
169
|
+
| `search` | 종목 리스트/검색 |
|
|
170
|
+
| `watchlist` | 관심종목 |
|
|
171
|
+
| `brokers` | 회원사 리스트 |
|
|
172
|
+
| `chart *` | 틱/분봉/일봉/주봉/월봉/년봉, 투자자별 차트 |
|
|
173
|
+
| `investor *` | 기관매매, 투자자별매매, 프로그램매매 등 10개 |
|
|
174
|
+
| `analysis *` | 거래상세, 거래량갱신, 매물대, PER, VI, 증권사 등 10개 |
|
|
175
|
+
| `lending *` | 대차거래 추이/상위/종목별/내역 |
|
|
176
|
+
| `credit *` | 신용매매동향, 신용융자 가능 |
|
|
179
177
|
|
|
180
178
|
</details>
|
|
181
179
|
|
|
@@ -200,35 +198,35 @@ kiwoom account orderable amount 005930 --side buy --price 70000
|
|
|
200
198
|
<details>
|
|
201
199
|
<summary>전체 account 하위 명령어</summary>
|
|
202
200
|
|
|
203
|
-
| 그룹
|
|
204
|
-
|
|
205
|
-
| -
|
|
206
|
-
| -
|
|
207
|
-
| -
|
|
208
|
-
| -
|
|
209
|
-
| -
|
|
210
|
-
| -
|
|
211
|
-
| `returns`
|
|
212
|
-
| `returns`
|
|
213
|
-
| `returns`
|
|
214
|
-
| `returns`
|
|
215
|
-
| `pnl`
|
|
216
|
-
| `pnl`
|
|
217
|
-
| `pnl`
|
|
218
|
-
| `pnl`
|
|
219
|
-
| `orders`
|
|
220
|
-
| `orders`
|
|
221
|
-
| `orders`
|
|
222
|
-
| `orders`
|
|
223
|
-
| `orders`
|
|
224
|
-
| `holdings`
|
|
225
|
-
| `holdings`
|
|
226
|
-
| `holdings`
|
|
227
|
-
| `orderable` | `amount`
|
|
228
|
-
| `orderable` | `margin-qty`
|
|
229
|
-
| `orderable` | `credit-qty`
|
|
230
|
-
| `history`
|
|
231
|
-
| `history`
|
|
201
|
+
| 그룹 | 명령 | 설명 |
|
|
202
|
+
| ----------- | --------------- | ------------------- |
|
|
203
|
+
| - | `list` | 계좌번호 조회 |
|
|
204
|
+
| - | `balance` | 계좌 평가현황 |
|
|
205
|
+
| - | `deposit` | 예수금 상세 |
|
|
206
|
+
| - | `asset` | 추정자산 |
|
|
207
|
+
| - | `today` | 당일현황 |
|
|
208
|
+
| - | `margin-detail` | 증거금 세부내역 |
|
|
209
|
+
| `returns` | `summary` | 계좌 수익률 |
|
|
210
|
+
| `returns` | `daily-balance` | 일별 잔고수익률 |
|
|
211
|
+
| `returns` | `daily-detail` | 일별 수익률 상세 |
|
|
212
|
+
| `returns` | `daily-asset` | 일별 예탁자산 |
|
|
213
|
+
| `pnl` | `today` | 당일 실현손익 |
|
|
214
|
+
| `pnl` | `by-date` | 일자별 실현손익 |
|
|
215
|
+
| `pnl` | `by-period` | 기간별 실현손익 |
|
|
216
|
+
| `pnl` | `daily` | 일자별 실현손익 |
|
|
217
|
+
| `orders` | `pending` | 미체결 주문 |
|
|
218
|
+
| `orders` | `executed` | 체결 내역 |
|
|
219
|
+
| `orders` | `detail` | 주문체결 상세 |
|
|
220
|
+
| `orders` | `status` | 주문체결 현황 |
|
|
221
|
+
| `orders` | `split-detail` | 분할주문 상세 |
|
|
222
|
+
| `holdings` | `eval` | 계좌평가 잔고 |
|
|
223
|
+
| `holdings` | `settled` | 체결잔고 |
|
|
224
|
+
| `holdings` | `next-settle` | 익일결제예정 |
|
|
225
|
+
| `orderable` | `amount` | 주문가능 금액 |
|
|
226
|
+
| `orderable` | `margin-qty` | 증거금율별 수량 |
|
|
227
|
+
| `orderable` | `credit-qty` | 신용보증금율별 수량 |
|
|
228
|
+
| `history` | `transactions` | 위탁종합 거래내역 |
|
|
229
|
+
| `history` | `journal` | 당일 매매일지 |
|
|
232
230
|
|
|
233
231
|
</details>
|
|
234
232
|
|
|
@@ -327,27 +325,27 @@ kiwoom stream custom 0B,0D 005930 # 타입 직접 지정
|
|
|
327
325
|
kiwoom stream types # 타입 코드 목록
|
|
328
326
|
```
|
|
329
327
|
|
|
330
|
-
| 코드 | 명령
|
|
331
|
-
|
|
332
|
-
| 00
|
|
333
|
-
| 04
|
|
334
|
-
| 0A
|
|
335
|
-
| 0B
|
|
336
|
-
| 0C
|
|
337
|
-
| 0D
|
|
338
|
-
| 0E
|
|
339
|
-
| 0F
|
|
340
|
-
| 0G
|
|
341
|
-
| 0H
|
|
342
|
-
| 0I
|
|
343
|
-
| 0J
|
|
344
|
-
| 0U
|
|
345
|
-
| 0g
|
|
346
|
-
| 0m
|
|
347
|
-
| 0s
|
|
348
|
-
| 0u
|
|
349
|
-
| 0w
|
|
350
|
-
| 1h
|
|
328
|
+
| 코드 | 명령 | 설명 |
|
|
329
|
+
| ---- | --------------- | ------------ |
|
|
330
|
+
| 00 | `order` | 주문체결 |
|
|
331
|
+
| 04 | `balance` | 잔고 |
|
|
332
|
+
| 0A | `price` | 주식기세 |
|
|
333
|
+
| 0B | `quote` | 주식체결 |
|
|
334
|
+
| 0C | `best-bid` | 우선호가 |
|
|
335
|
+
| 0D | `orderbook` | 호가잔량 |
|
|
336
|
+
| 0E | `after-hours` | 시간외호가 |
|
|
337
|
+
| 0F | `trader` | 당일거래원 |
|
|
338
|
+
| 0G | `etf-nav` | ETF NAV |
|
|
339
|
+
| 0H | `expected` | 예상체결 |
|
|
340
|
+
| 0I | `gold` | 국제금환산 |
|
|
341
|
+
| 0J | `sector-index` | 업종지수 |
|
|
342
|
+
| 0U | `sector-change` | 업종등락 |
|
|
343
|
+
| 0g | `stock-info` | 종목정보 |
|
|
344
|
+
| 0m | `elw-theory` | ELW 이론가 |
|
|
345
|
+
| 0s | `market-time` | 장시작시간 |
|
|
346
|
+
| 0u | `elw-indicator` | ELW 지표 |
|
|
347
|
+
| 0w | `program` | 프로그램매매 |
|
|
348
|
+
| 1h | `vi` | VI발동/해제 |
|
|
351
349
|
|
|
352
350
|
---
|
|
353
351
|
|
|
@@ -410,22 +408,22 @@ eval (env _KIWOOM_COMPLETE=fish_source kiwoom)
|
|
|
410
408
|
|
|
411
409
|
## Exit Codes
|
|
412
410
|
|
|
413
|
-
| 코드 | 의미
|
|
414
|
-
|
|
415
|
-
| 0
|
|
416
|
-
| 1
|
|
417
|
-
| 2
|
|
418
|
-
| 3
|
|
411
|
+
| 코드 | 의미 |
|
|
412
|
+
| ---- | ----------------------- |
|
|
413
|
+
| 0 | 성공 |
|
|
414
|
+
| 1 | 입력 오류 (잘못된 인자) |
|
|
415
|
+
| 2 | API/네트워크 오류 |
|
|
416
|
+
| 3 | 인증 필요 (토큰 만료) |
|
|
419
417
|
|
|
420
418
|
## 참고
|
|
421
419
|
|
|
422
|
-
| 항목
|
|
423
|
-
|
|
424
|
-
| 설정 파일
|
|
425
|
-
| 토큰 파일
|
|
426
|
-
| 운영 도메인
|
|
420
|
+
| 항목 | 값 |
|
|
421
|
+
| --------------- | ---------------------------- |
|
|
422
|
+
| 설정 파일 | `~/.kiwoom/config.toml` |
|
|
423
|
+
| 토큰 파일 | `~/.kiwoom/token` |
|
|
424
|
+
| 운영 도메인 | `https://api.kiwoom.com` |
|
|
427
425
|
| 모의투자 도메인 | `https://mockapi.kiwoom.com` |
|
|
428
|
-
| WebSocket
|
|
426
|
+
| WebSocket | `wss://api.kiwoom.com:10000` |
|
|
429
427
|
|
|
430
428
|
- `kiwoom <명령> --help`로 상세 옵션 확인
|
|
431
429
|
- 모의투자 먼저 테스트: `kiwoom config domain mock`
|
|
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
|