kabukit 0.7.3__py3-none-any.whl → 0.7.5__py3-none-any.whl
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.
@@ -0,0 +1,260 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: kabukit
|
3
|
+
Version: 0.7.5
|
4
|
+
Summary: A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs.
|
5
|
+
Keywords: J-Quants,EDINET,financial data,stock market,investment,toolkit,finance,trading,data analysis,polars
|
6
|
+
Author: daizutabi
|
7
|
+
Author-email: daizutabi <daizutabi@gmail.com>
|
8
|
+
License: MIT License
|
9
|
+
|
10
|
+
Copyright (c) 2025 Daizu
|
11
|
+
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
14
|
+
in the Software without restriction, including without limitation the rights
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
17
|
+
furnished to do so, subject to the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
20
|
+
copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28
|
+
SOFTWARE.
|
29
|
+
Classifier: Development Status :: 4 - Beta
|
30
|
+
Classifier: Programming Language :: Python
|
31
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
32
|
+
Classifier: Programming Language :: Python :: 3.13
|
33
|
+
Classifier: Programming Language :: Python :: 3.14
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
35
|
+
Classifier: Operating System :: OS Independent
|
36
|
+
Classifier: Intended Audience :: Developers
|
37
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
38
|
+
Classifier: Intended Audience :: Science/Research
|
39
|
+
Classifier: Topic :: Office/Business :: Financial
|
40
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
41
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
42
|
+
Classifier: Topic :: Utilities
|
43
|
+
Requires-Dist: async-typer>=0.1.10
|
44
|
+
Requires-Dist: httpx>=0.28.1
|
45
|
+
Requires-Dist: platformdirs>=4.5.0
|
46
|
+
Requires-Dist: polars>=1.34.0
|
47
|
+
Requires-Dist: python-dotenv>=1.1.1
|
48
|
+
Requires-Dist: rich>=14.2.0
|
49
|
+
Requires-Dist: tenacity>=9.1.2
|
50
|
+
Requires-Dist: tqdm>=4.67.1
|
51
|
+
Requires-Dist: typer>=0.19.2
|
52
|
+
Requires-Dist: tzdata ; sys_platform == 'win32'
|
53
|
+
Requires-Python: >=3.13
|
54
|
+
Project-URL: Changelog, https://github.com/daizutabi/kabukit/releases
|
55
|
+
Project-URL: Documentation, https://daizutabi.github.io/kabukit/
|
56
|
+
Project-URL: Homepage, https://daizutabi.github.io/kabukit/
|
57
|
+
Project-URL: Issues, https://github.com/daizutabi/kabukit/issues
|
58
|
+
Project-URL: Source, https://github.com/daizutabi/kabukit
|
59
|
+
Description-Content-Type: text/markdown
|
60
|
+
|
61
|
+
# kabukit
|
62
|
+
|
63
|
+
A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs.
|
64
|
+
|
65
|
+
[![PyPI Version][pypi-v-image]][pypi-v-link]
|
66
|
+
[![Python Version][python-v-image]][python-v-link]
|
67
|
+
[![Build Status][GHAction-image]][GHAction-link]
|
68
|
+
[![Coverage Status][codecov-image]][codecov-link]
|
69
|
+
[![Documentation Status][docs-image]][docs-link]
|
70
|
+
|
71
|
+
kabukitは、高速なデータ処理ライブラリである [Polars](https://pola.rs/) と、モダンな非同期HTTPクライアントである [httpx](https://www.python-httpx.org/) を基盤として構築されており、パフォーマンスを重視しています。
|
72
|
+
|
73
|
+
## インストール
|
74
|
+
|
75
|
+
`uv` または `pip` を使って、[Python Package Index (PyPI)](https://pypi.org/) からインストールします。Pythonバージョンは3.13以上が必要です。
|
76
|
+
|
77
|
+
```bash
|
78
|
+
uv pip install kabukit
|
79
|
+
```
|
80
|
+
|
81
|
+
## コマンドラインから使う
|
82
|
+
|
83
|
+
kabukitは、 [J-Quants](https://jpx-jquants.com/) および [EDINET](https://disclosure2.edinet-fsa.go.jp/) からデータを取得するための便利なコマンドラインインターフェース(CLI)を提供します。
|
84
|
+
|
85
|
+
コマンド名は `kabu` です。
|
86
|
+
|
87
|
+
### 認証
|
88
|
+
|
89
|
+
#### J-Quants
|
90
|
+
|
91
|
+
J-Quants APIを利用するにはユーザー登録が必要です。`auth jquants` サブコマンドを使い、登録したメールアドレスとパスワードで認証し、IDトークンを取得します。IDトークンはユーザーの設定ディレクトリに保存されます。
|
92
|
+
|
93
|
+
```bash
|
94
|
+
❯ kabu auth jquants
|
95
|
+
Mailaddress: your_email@example.com
|
96
|
+
Password: your_password
|
97
|
+
J-QuantsのIDトークンを保存しました。
|
98
|
+
```
|
99
|
+
|
100
|
+
#### EDINET
|
101
|
+
|
102
|
+
EDINET APIを利用するには、事前にAPIキーの取得が必要です。取得したAPIキーを `auth edinet` サブコマンドで保存します。
|
103
|
+
|
104
|
+
```bash
|
105
|
+
❯ kabu auth edinet
|
106
|
+
Api key: your_api_key
|
107
|
+
EDINETのAPIキーを保存しました。
|
108
|
+
```
|
109
|
+
|
110
|
+
#### 認証データで確認
|
111
|
+
|
112
|
+
認証データの保存先と内容は、`auth show` サブコマンドで確認できます。
|
113
|
+
|
114
|
+
```bash
|
115
|
+
❯ kabu auth show
|
116
|
+
Configuration file: /home/your_name/.config/kabukit/.env
|
117
|
+
JQUANTS_ID_TOKEN: ******
|
118
|
+
EDINET_API_KEY: ******
|
119
|
+
```
|
120
|
+
|
121
|
+
### データ取得
|
122
|
+
|
123
|
+
`get` サブコマンドは、J-QuantsおよびEDINETから各種データを取得します。以下に、一例を示します。
|
124
|
+
|
125
|
+
#### 銘柄情報
|
126
|
+
|
127
|
+
```bash
|
128
|
+
❯ kabu get info 7203
|
129
|
+
shape: (1, 8)
|
130
|
+
┌────────────┬───────┬──────────────┬──────────────────┬─
|
131
|
+
│ Date ┆ Code ┆ CompanyName ┆ Sector17CodeName ┆
|
132
|
+
│ --- ┆ --- ┆ --- ┆ --- ┆
|
133
|
+
│ date ┆ str ┆ str ┆ cat ┆
|
134
|
+
╞════════════╪═══════╪══════════════╪══════════════════╪═
|
135
|
+
│ 2025-10-14 ┆ 72030 ┆ トヨタ自動車 ┆ 自動車・輸送機 ┆
|
136
|
+
└────────────┴───────┴──────────────┴──────────────────┴─
|
137
|
+
```
|
138
|
+
|
139
|
+
#### 財務情報
|
140
|
+
|
141
|
+
```bash
|
142
|
+
❯ kabu get statements 7203
|
143
|
+
shape: (41, 105)
|
144
|
+
(略)
|
145
|
+
```
|
146
|
+
|
147
|
+
#### 株価情報
|
148
|
+
|
149
|
+
```bash
|
150
|
+
❯ kabu get prices 7203
|
151
|
+
shape: (2_444, 16)
|
152
|
+
(略)
|
153
|
+
```
|
154
|
+
|
155
|
+
#### 全銘柄のデータ一括取得
|
156
|
+
|
157
|
+
各コマンドで銘柄コードを省力すると、全銘柄のデータを一度に取得できます。財務情報の場合は以下の通りです。
|
158
|
+
|
159
|
+
```bash
|
160
|
+
> kabu get statements
|
161
|
+
100%|███████████████████████████| 3787/3787 [01:18<00:00, 48.24it/s]
|
162
|
+
shape: (165_891, 105)
|
163
|
+
(略)
|
164
|
+
```
|
165
|
+
|
166
|
+
`get all` サブコマンドを使うと、全銘柄の各種データを一度に取得できます。
|
167
|
+
|
168
|
+
```bash
|
169
|
+
> kabu get all
|
170
|
+
```
|
171
|
+
|
172
|
+
これらのデータはキャッシュディレクトリに保存され、後で再利用できます。キャッシュデータを確認するには、`cache tree` サブコマンドを使います。
|
173
|
+
|
174
|
+
```bash
|
175
|
+
> kabu cache tree
|
176
|
+
/home/your_name/.cache/kabukit
|
177
|
+
├── info
|
178
|
+
│ └── 20251011.parquet
|
179
|
+
├── list
|
180
|
+
│ └── 20251011.parquet
|
181
|
+
├── prices
|
182
|
+
│ └── 20251011.parquet
|
183
|
+
├── reports
|
184
|
+
│ └── 20251011.parquet
|
185
|
+
└── statements
|
186
|
+
└── 20251011.parquet
|
187
|
+
```
|
188
|
+
|
189
|
+
キャッシュデータは、`cache clean` サブコマンドで消去できます。
|
190
|
+
|
191
|
+
## ノートブックから使う
|
192
|
+
|
193
|
+
kabukitは、コマンドラインだけでなく、PythonコードからもAPIとして利用できます。httpxを使って非同期でデータを取得するため、[Jupyter](https://jupyter.org/) や [marimo](https://marimo.io/) のような非同期処理を直接扱えるノートブック環境と非常に相性が良いです。
|
194
|
+
|
195
|
+
### データ取得
|
196
|
+
|
197
|
+
J-Quantsの例を示します。まず、`JQuantsClient`のインスタンスを作成します。事前に、コマンドラインで認証を済ませてください。
|
198
|
+
|
199
|
+
```python
|
200
|
+
from kabukit import JQuantsClient
|
201
|
+
|
202
|
+
client = JQuantsClient()
|
203
|
+
```
|
204
|
+
|
205
|
+
#### 銘柄情報
|
206
|
+
|
207
|
+
```python
|
208
|
+
info = await client.get_info("7203")
|
209
|
+
```
|
210
|
+
|
211
|
+
#### 財務情報
|
212
|
+
|
213
|
+
```python
|
214
|
+
statements = await client.get_statements("7203")
|
215
|
+
```
|
216
|
+
|
217
|
+
#### 株価情報
|
218
|
+
|
219
|
+
```python
|
220
|
+
prices = await client.get_prices("7203")
|
221
|
+
```
|
222
|
+
|
223
|
+
#### 全銘柄のデータ一括取得
|
224
|
+
|
225
|
+
`fetch_all`関数を使うと、全銘柄のデータを一度に取得できます。marimoノートブックを使っていれば、プログレスバーを簡単に表示できます。財務情報の場合は以下の通りです。
|
226
|
+
|
227
|
+
```python
|
228
|
+
import marimo as mo
|
229
|
+
from kabukit.jquants import fetch_all
|
230
|
+
|
231
|
+
statements = await fetch_all("statements", progress=mo.status.progress_bar)
|
232
|
+
```
|
233
|
+
|
234
|
+
株価情報の場合は、上記の `"statements"` を `"prices"` に変更してください。
|
235
|
+
|
236
|
+
### キャッシュデータの利用
|
237
|
+
|
238
|
+
コマンドラインで事前に保存しておいたキャッシュデータを再利用できます。ノートブックの起動ごとに、APIアクセスを行ってデータをダウンロードする必要がなくなります。
|
239
|
+
|
240
|
+
```python
|
241
|
+
from kabukit import Info, Statements, Prices
|
242
|
+
|
243
|
+
# data属性で、Polars DataFrameを取得できます。
|
244
|
+
info = Info.read().data
|
245
|
+
statements = Statements.read().data
|
246
|
+
prices = Prices.read().data
|
247
|
+
```
|
248
|
+
|
249
|
+
<!-- Badges -->
|
250
|
+
|
251
|
+
[pypi-v-image]: https://img.shields.io/pypi/v/kabukit.svg
|
252
|
+
[pypi-v-link]: https://pypi.org/project/kabukit/
|
253
|
+
[python-v-image]: https://img.shields.io/pypi/pyversions/kabukit.svg
|
254
|
+
[python-v-link]: https://pypi.org/project/kabukit
|
255
|
+
[GHAction-image]: https://github.com/daizutabi/kabukit/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
|
256
|
+
[GHAction-link]: https://github.com/daizutabi/kabukit/actions?query=event%3Apush+branch%3Amain
|
257
|
+
[codecov-image]: https://codecov.io/github/daizutabi/kabukit/graph/badge.svg?token=Yu6lAdVVnd
|
258
|
+
[codecov-link]: https://codecov.io/github/daizutabi/kabukit?branch=main
|
259
|
+
[docs-image]: https://img.shields.io/badge/docs-latest-blue.svg
|
260
|
+
[docs-link]: https://daizutabi.github.io/kabukit/
|
@@ -38,7 +38,7 @@ kabukit/utils/concurrent.py,sha256=qR3gvhUBYOjwtVT_Hluy1g-XaaFL9ysHvZz3WUE8G1k,4
|
|
38
38
|
kabukit/utils/config.py,sha256=fqUdlhVjgiWEcsLFmPckp-dXUleVz8Ypdy_NnrMIBfY,708
|
39
39
|
kabukit/utils/date.py,sha256=eB5ONCkqnvOiAg1Hvg1pN4OkrxLR47urvOAD5BF5yL0,982
|
40
40
|
kabukit/utils/params.py,sha256=qcaJbf6CWPUoZAZsYDTaZSnBUWeAersbWnR_iiYW9GM,1108
|
41
|
-
kabukit-0.7.
|
42
|
-
kabukit-0.7.
|
43
|
-
kabukit-0.7.
|
44
|
-
kabukit-0.7.
|
41
|
+
kabukit-0.7.5.dist-info/WHEEL,sha256=X16MKk8bp2DRsAuyteHJ-9qOjzmnY0x1aj0P1ftqqWA,78
|
42
|
+
kabukit-0.7.5.dist-info/entry_points.txt,sha256=vvX771TemoM-35vVizW3JJ70HvRXnd2tX4P1Btzyoxs,46
|
43
|
+
kabukit-0.7.5.dist-info/METADATA,sha256=bUnMIesFtUoTIAOTd_D9IMYZAc6eLipbcJl3CLe3wns,10111
|
44
|
+
kabukit-0.7.5.dist-info/RECORD,,
|
kabukit-0.7.3.dist-info/METADATA
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.3
|
2
|
-
Name: kabukit
|
3
|
-
Version: 0.7.3
|
4
|
-
Summary: A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs.
|
5
|
-
Keywords: J-Quants,EDINET,financial data,stock market,investment,toolkit,finance,trading,data analysis,polars
|
6
|
-
Author: daizutabi
|
7
|
-
Author-email: daizutabi <daizutabi@gmail.com>
|
8
|
-
License: MIT License
|
9
|
-
|
10
|
-
Copyright (c) 2025 Daizu
|
11
|
-
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
-
of this software and associated documentation files (the "Software"), to deal
|
14
|
-
in the Software without restriction, including without limitation the rights
|
15
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
-
copies of the Software, and to permit persons to whom the Software is
|
17
|
-
furnished to do so, subject to the following conditions:
|
18
|
-
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
20
|
-
copies or substantial portions of the Software.
|
21
|
-
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28
|
-
SOFTWARE.
|
29
|
-
Classifier: Development Status :: 4 - Beta
|
30
|
-
Classifier: Programming Language :: Python
|
31
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
32
|
-
Classifier: Programming Language :: Python :: 3.13
|
33
|
-
Classifier: Programming Language :: Python :: 3.14
|
34
|
-
Classifier: License :: OSI Approved :: MIT License
|
35
|
-
Classifier: Operating System :: OS Independent
|
36
|
-
Classifier: Intended Audience :: Developers
|
37
|
-
Classifier: Intended Audience :: Financial and Insurance Industry
|
38
|
-
Classifier: Intended Audience :: Science/Research
|
39
|
-
Classifier: Topic :: Office/Business :: Financial
|
40
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
41
|
-
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
42
|
-
Classifier: Topic :: Utilities
|
43
|
-
Requires-Dist: async-typer>=0.1.10
|
44
|
-
Requires-Dist: httpx>=0.28.1
|
45
|
-
Requires-Dist: platformdirs>=4.5.0
|
46
|
-
Requires-Dist: polars>=1.34.0
|
47
|
-
Requires-Dist: python-dotenv>=1.1.1
|
48
|
-
Requires-Dist: rich>=14.2.0
|
49
|
-
Requires-Dist: tenacity>=9.1.2
|
50
|
-
Requires-Dist: tqdm>=4.67.1
|
51
|
-
Requires-Dist: typer>=0.19.2
|
52
|
-
Requires-Dist: tzdata ; sys_platform == 'win32'
|
53
|
-
Requires-Python: >=3.13
|
54
|
-
Project-URL: Changelog, https://github.com/daizutabi/kabukit/releases
|
55
|
-
Project-URL: Documentation, https://daizutabi.github.io/kabukit/
|
56
|
-
Project-URL: Homepage, https://daizutabi.github.io/kabukit/
|
57
|
-
Project-URL: Issues, https://github.com/daizutabi/kabukit/issues
|
58
|
-
Project-URL: Source, https://github.com/daizutabi/kabukit
|
59
|
-
Description-Content-Type: text/markdown
|
60
|
-
|
61
|
-
# kabukit
|
62
|
-
|
63
|
-
A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs.
|
64
|
-
|
65
|
-
[![PyPI Version][pypi-v-image]][pypi-v-link]
|
66
|
-
[![Python Version][python-v-image]][python-v-link]
|
67
|
-
[![Build Status][GHAction-image]][GHAction-link]
|
68
|
-
[![Coverage Status][codecov-image]][codecov-link]
|
69
|
-
[![Documentation Status][docs-image]][docs-link]
|
70
|
-
|
71
|
-
## Installation
|
72
|
-
|
73
|
-
```bash
|
74
|
-
pip install kabukit
|
75
|
-
```
|
76
|
-
|
77
|
-
<!-- Badges -->
|
78
|
-
|
79
|
-
[pypi-v-image]: https://img.shields.io/pypi/v/kabukit.svg
|
80
|
-
[pypi-v-link]: https://pypi.org/project/kabukit/
|
81
|
-
[python-v-image]: https://img.shields.io/pypi/pyversions/kabukit.svg
|
82
|
-
[python-v-link]: https://pypi.org/project/kabukit
|
83
|
-
[GHAction-image]: https://github.com/daizutabi/kabukit/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
|
84
|
-
[GHAction-link]: https://github.com/daizutabi/kabukit/actions?query=event%3Apush+branch%3Amain
|
85
|
-
[codecov-image]: https://codecov.io/github/daizutabi/kabukit/graph/badge.svg?token=Yu6lAdVVnd
|
86
|
-
[codecov-link]: https://codecov.io/github/daizutabi/kabukit?branch=main
|
87
|
-
[docs-image]: https://img.shields.io/badge/docs-latest-blue.svg
|
88
|
-
[docs-link]: https://daizutabi.github.io/kabukit/
|
File without changes
|
File without changes
|