kabukit 0.5.4__py3-none-any.whl → 0.6.0__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.
- kabukit/jquants/client.py +30 -1
- kabukit/jquants/topix.py +16 -0
- {kabukit-0.5.4.dist-info → kabukit-0.6.0.dist-info}/METADATA +1 -1
- {kabukit-0.5.4.dist-info → kabukit-0.6.0.dist-info}/RECORD +6 -5
- {kabukit-0.5.4.dist-info → kabukit-0.6.0.dist-info}/WHEEL +0 -0
- {kabukit-0.5.4.dist-info → kabukit-0.6.0.dist-info}/entry_points.txt +0 -0
kabukit/jquants/client.py
CHANGED
@@ -12,7 +12,7 @@ from kabukit.core.client import Client
|
|
12
12
|
from kabukit.utils.config import load_dotenv, set_key
|
13
13
|
from kabukit.utils.params import get_params
|
14
14
|
|
15
|
-
from . import info, prices, statements
|
15
|
+
from . import info, prices, statements, topix
|
16
16
|
|
17
17
|
if TYPE_CHECKING:
|
18
18
|
from collections.abc import AsyncIterator
|
@@ -342,3 +342,32 @@ class JQuantsClient(Client):
|
|
342
342
|
return df
|
343
343
|
|
344
344
|
return df.with_columns(pl.col("^.*Date$").str.to_date("%Y-%m-%d", strict=False))
|
345
|
+
|
346
|
+
async def get_topix(
|
347
|
+
self,
|
348
|
+
from_: str | datetime.date | None = None,
|
349
|
+
to: str | datetime.date | None = None,
|
350
|
+
) -> DataFrame:
|
351
|
+
"""日次のTOPIX指数データを取得する。
|
352
|
+
|
353
|
+
Args:
|
354
|
+
from_: 取得期間の開始日。
|
355
|
+
to: 取得期間の終了日。
|
356
|
+
|
357
|
+
Returns:
|
358
|
+
日次のTOPIX指数データを含むPolars DataFrame。
|
359
|
+
|
360
|
+
Raises:
|
361
|
+
HTTPStatusError: APIリクエストが失敗した場合。
|
362
|
+
"""
|
363
|
+
params = get_params(from_=from_, to=to)
|
364
|
+
|
365
|
+
url = "/indices/topix"
|
366
|
+
name = "topix"
|
367
|
+
|
368
|
+
dfs = [df async for df in self.iter_pages(url, params, name)]
|
369
|
+
df = pl.concat(dfs)
|
370
|
+
if df.is_empty():
|
371
|
+
return df
|
372
|
+
|
373
|
+
return topix.clean(df)
|
kabukit/jquants/topix.py
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import TYPE_CHECKING
|
4
|
+
|
5
|
+
import polars as pl
|
6
|
+
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from polars import DataFrame
|
9
|
+
|
10
|
+
|
11
|
+
def clean(df: DataFrame) -> DataFrame:
|
12
|
+
return df.select(
|
13
|
+
pl.col("Date").str.to_date("%Y-%m-%d"),
|
14
|
+
pl.lit("TOPIX").alias("Code"),
|
15
|
+
pl.exclude("Date"),
|
16
|
+
)
|
@@ -21,19 +21,20 @@ kabukit/edinet/client.py,sha256=BlM7pjXpKweOo-ses41JiKinqRn4qerMN5NF7hgYKgg,3275
|
|
21
21
|
kabukit/edinet/concurrent.py,sha256=2YPzIFuuOB8-gL3CnHIlP486QH5d21qjKNKGCFK7Hzk,4707
|
22
22
|
kabukit/edinet/doc.py,sha256=6ZDgmm8DHmEMOA4NjNz-dHLMc7IzzYn-nVyMQGLWb8I,1220
|
23
23
|
kabukit/jquants/__init__.py,sha256=xY0H6x4_51ZBqbrT2TdmGGFbTD-hosZiDzVIz4UXPv0,112
|
24
|
-
kabukit/jquants/client.py,sha256=
|
24
|
+
kabukit/jquants/client.py,sha256=eznqnueUMF2_px5dpCwry53FLyE2nKkI-L8nCu31rhk,12323
|
25
25
|
kabukit/jquants/concurrent.py,sha256=n_HMIQEkj1OqDo75iybzcpzVJkP-pNzjNnv3XTA5sxQ,3331
|
26
26
|
kabukit/jquants/info.py,sha256=AUymo6EtLdJ_L-0yNG1gd7rJ8Jkjw7tvsDM5Vw4QNFA,843
|
27
27
|
kabukit/jquants/prices.py,sha256=oApQpdgzHwPw11XHpdg8ccZS7kybGtV8APZlpD2L3Yw,882
|
28
28
|
kabukit/jquants/schema.py,sha256=aILl9cp9JDOaT2o3UlfavPGQC5s7n0ZkVBGKiTzdogs,9768
|
29
29
|
kabukit/jquants/statements.py,sha256=fW9YGuqK5W64aWdYtVFzgF14L9H68HPdIfYWxSjc9yg,3173
|
30
|
+
kabukit/jquants/topix.py,sha256=oU84WAbmd4U77fuKvj_EUpZv3Pu_Sf0HEW4Y0dB8508,326
|
30
31
|
kabukit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
32
|
kabukit/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
33
|
kabukit/utils/concurrent.py,sha256=m2zVqJUz4xFVpNbEc9YEaj3Jmbl82njupdm4_rBOoYQ,4510
|
33
34
|
kabukit/utils/config.py,sha256=Jp-2TCnIj_QqA71FzYCkHXbvXvhw_1JVl4PR0foA1vM,618
|
34
35
|
kabukit/utils/date.py,sha256=DEC6Ac5LS8eiW6JtrmcD3U1pX4qzXtx4ale0swpO4Ag,937
|
35
36
|
kabukit/utils/params.py,sha256=qcaJbf6CWPUoZAZsYDTaZSnBUWeAersbWnR_iiYW9GM,1108
|
36
|
-
kabukit-0.
|
37
|
-
kabukit-0.
|
38
|
-
kabukit-0.
|
39
|
-
kabukit-0.
|
37
|
+
kabukit-0.6.0.dist-info/WHEEL,sha256=n2u5OFBbdZvCiUKAmfnY1Po2j3FB_NWfuUlt5WiAjrk,79
|
38
|
+
kabukit-0.6.0.dist-info/entry_points.txt,sha256=vvX771TemoM-35vVizW3JJ70HvRXnd2tX4P1Btzyoxs,46
|
39
|
+
kabukit-0.6.0.dist-info/METADATA,sha256=fLwKGZDziB2cNx9-YnP5EVeI9W3oqoZuUPDMVIkF-zg,3207
|
40
|
+
kabukit-0.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|