kabukit 0.5.0__tar.gz → 0.5.1__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.
- {kabukit-0.5.0 → kabukit-0.5.1}/PKG-INFO +7 -7
- {kabukit-0.5.0 → kabukit-0.5.1}/pyproject.toml +14 -14
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/prices.py +16 -13
- kabukit-0.5.1/src/kabukit/core/statements.py +41 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/concurrent.py +2 -1
- kabukit-0.5.0/src/kabukit/core/statements.py +0 -24
- {kabukit-0.5.0 → kabukit-0.5.1}/LICENSE +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/README.md +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/analysis/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/analysis/indicators.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/analysis/preprocess.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/analysis/screener.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/analysis/visualization.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/cli/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/cli/app.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/cli/auth.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/cli/get.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/base.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/client.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/info.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/list.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/core/reports.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/edinet/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/edinet/client.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/edinet/concurrent.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/edinet/doc.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/client.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/info.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/prices.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/schema.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/jquants/statements.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/py.typed +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/utils/__init__.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/utils/concurrent.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/utils/config.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/utils/date.py +0 -0
- {kabukit-0.5.0 → kabukit-0.5.1}/src/kabukit/utils/params.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: kabukit
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.1
|
4
4
|
Summary: A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs.
|
5
5
|
Author: daizutabi
|
6
6
|
Author-email: daizutabi <daizutabi@gmail.com>
|
@@ -28,13 +28,13 @@ License: MIT License
|
|
28
28
|
Classifier: Development Status :: 4 - Beta
|
29
29
|
Classifier: Programming Language :: Python
|
30
30
|
Classifier: Programming Language :: Python :: 3.13
|
31
|
-
Requires-Dist: async-typer>=0.1
|
31
|
+
Requires-Dist: async-typer>=0.1.10
|
32
32
|
Requires-Dist: holidays>=0.81
|
33
|
-
Requires-Dist: httpx>=0.28
|
34
|
-
Requires-Dist: platformdirs>=4
|
35
|
-
Requires-Dist: polars>=1
|
36
|
-
Requires-Dist: python-dotenv>=1
|
37
|
-
Requires-Dist: typer>=0.19
|
33
|
+
Requires-Dist: httpx>=0.28.1
|
34
|
+
Requires-Dist: platformdirs>=4.4.0
|
35
|
+
Requires-Dist: polars>=1.34.0
|
36
|
+
Requires-Dist: python-dotenv>=1.1.1
|
37
|
+
Requires-Dist: typer>=0.19.2
|
38
38
|
Requires-Python: >=3.13
|
39
39
|
Project-URL: Documentation, https://daizutabi.github.io/kabukit/
|
40
40
|
Project-URL: Issues, https://github.com/daizutabi/kabukit/issues
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "kabukit"
|
7
|
-
version = "0.5.
|
7
|
+
version = "0.5.1"
|
8
8
|
description = "A Python toolkit for Japanese financial market data, supporting J-Quants and EDINET APIs."
|
9
9
|
readme = "README.md"
|
10
10
|
license = { file = "LICENSE" }
|
@@ -16,13 +16,13 @@ classifiers = [
|
|
16
16
|
]
|
17
17
|
requires-python = ">=3.13"
|
18
18
|
dependencies = [
|
19
|
-
"async-typer>=0.1",
|
19
|
+
"async-typer>=0.1.10",
|
20
20
|
"holidays>=0.81",
|
21
|
-
"httpx>=0.28",
|
22
|
-
"platformdirs>=4",
|
23
|
-
"polars>=1",
|
24
|
-
"python-dotenv>=1",
|
25
|
-
"typer>=0.19",
|
21
|
+
"httpx>=0.28.1",
|
22
|
+
"platformdirs>=4.4.0",
|
23
|
+
"polars>=1.34.0",
|
24
|
+
"python-dotenv>=1.1.1",
|
25
|
+
"typer>=0.19.2",
|
26
26
|
]
|
27
27
|
|
28
28
|
[project.scripts]
|
@@ -35,10 +35,10 @@ Issues = "https://github.com/daizutabi/kabukit/issues"
|
|
35
35
|
|
36
36
|
[dependency-groups]
|
37
37
|
dev = [
|
38
|
-
"altair>=5",
|
39
|
-
"basedpyright>=1.31.
|
40
|
-
"marimo[lsp]>=0.16",
|
41
|
-
"numpy>=2.3.3",
|
38
|
+
"altair>=5.5.0",
|
39
|
+
"basedpyright>=1.31.6",
|
40
|
+
"marimo[lsp]>=0.16.5",
|
41
|
+
"numpy>=2.3.3", # polars 1.33 type hinting workaround,
|
42
42
|
"pytest-asyncio>=1.2.0",
|
43
43
|
"pytest-clarity>=1.0.1",
|
44
44
|
"pytest-cov>=7.0.0",
|
@@ -47,9 +47,9 @@ dev = [
|
|
47
47
|
"pytest-xdist>=3.8.0",
|
48
48
|
"rich>=14.1.0",
|
49
49
|
"tqdm>=4.67.1",
|
50
|
-
"vegafusion-python-embed>=1.6",
|
51
|
-
"vegafusion>=2",
|
52
|
-
"vl-convert-python>=1.8",
|
50
|
+
"vegafusion-python-embed>=1.6.9",
|
51
|
+
"vegafusion>=2.0.3",
|
52
|
+
"vl-convert-python>=1.8.0",
|
53
53
|
]
|
54
54
|
docs = ["mkapi>=4.4", "mkdocs-marimo", "mkdocs-material"]
|
55
55
|
|
@@ -76,29 +76,32 @@ class Prices(Base):
|
|
76
76
|
.over("Code", "ReportDate")
|
77
77
|
.alias("CumulativeRatio"),
|
78
78
|
)
|
79
|
-
.
|
80
|
-
"Date",
|
81
|
-
"Code",
|
79
|
+
.with_columns(
|
82
80
|
(pl.col("IssuedShares", "TreasuryShares") * pl.col("CumulativeRatio"))
|
83
81
|
.round(0)
|
84
82
|
.cast(pl.Int64)
|
85
83
|
.name.prefix("Adjusted"),
|
86
84
|
)
|
85
|
+
.select("Date", "Code", "AdjustedIssuedShares", "AdjustedTreasuryShares")
|
87
86
|
)
|
88
87
|
|
89
88
|
data = self.data.join(adjusted, on=["Date", "Code"], how="left")
|
90
89
|
|
91
90
|
return self.__class__(data)
|
92
91
|
|
93
|
-
|
94
|
-
|
92
|
+
def with_forecast_profit(self, statements: Statements) -> Self:
|
93
|
+
"""時系列の予想純利益を列として追加する。
|
95
94
|
|
96
|
-
|
97
|
-
|
95
|
+
Args:
|
96
|
+
statements (Statements): 財務データを提供する`Statements`オブジェクト。
|
98
97
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
98
|
+
Returns:
|
99
|
+
Self: `ForecastProfit` 列が追加された、新しいPricesオブジェクト。
|
100
|
+
"""
|
101
|
+
data = self.data.join_asof(
|
102
|
+
statements.forecast_profit(),
|
103
|
+
on="Date",
|
104
|
+
by="Code",
|
105
|
+
check_sortedness=False,
|
106
|
+
)
|
107
|
+
return self.__class__(data)
|
@@ -0,0 +1,41 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import TYPE_CHECKING
|
4
|
+
|
5
|
+
import polars as pl
|
6
|
+
|
7
|
+
from .base import Base
|
8
|
+
|
9
|
+
if TYPE_CHECKING:
|
10
|
+
from polars import DataFrame
|
11
|
+
|
12
|
+
|
13
|
+
class Statements(Base):
|
14
|
+
def number_of_shares(self) -> DataFrame:
|
15
|
+
"""発行済株式数を取得する。"""
|
16
|
+
return self.data.filter(
|
17
|
+
pl.col("IssuedShares").is_not_null(),
|
18
|
+
).select(
|
19
|
+
"Date",
|
20
|
+
"Code",
|
21
|
+
"IssuedShares",
|
22
|
+
"TreasuryShares",
|
23
|
+
"AverageOutstandingShares",
|
24
|
+
)
|
25
|
+
|
26
|
+
def forecast_profit(self) -> DataFrame:
|
27
|
+
"""予想純利益を抽出する。
|
28
|
+
|
29
|
+
Returns:
|
30
|
+
DataFrame: Date, Code, ForecastProfit を含むDataFrame
|
31
|
+
"""
|
32
|
+
return (
|
33
|
+
self.data.with_columns(
|
34
|
+
pl.when(pl.col("TypeOfDocument").str.starts_with("FY"))
|
35
|
+
.then(pl.col("NextYearForecastProfit"))
|
36
|
+
.otherwise(pl.col("ForecastProfit"))
|
37
|
+
.alias("ForecastProfit"),
|
38
|
+
)
|
39
|
+
.filter(pl.col("ForecastProfit").is_not_null())
|
40
|
+
.select("Date", "Code", "ForecastProfit")
|
41
|
+
)
|
@@ -41,7 +41,7 @@ async def fetch(
|
|
41
41
|
DataFrame:
|
42
42
|
すべての銘柄の財務情報を含む単一のDataFrame。
|
43
43
|
"""
|
44
|
-
|
44
|
+
data = await concurrent.fetch(
|
45
45
|
JQuantsClient,
|
46
46
|
resource,
|
47
47
|
codes,
|
@@ -49,6 +49,7 @@ async def fetch(
|
|
49
49
|
progress=progress,
|
50
50
|
callback=callback,
|
51
51
|
)
|
52
|
+
return data.sort("Code", "Date")
|
52
53
|
|
53
54
|
|
54
55
|
async def fetch_all(
|
@@ -1,24 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from typing import TYPE_CHECKING
|
4
|
-
|
5
|
-
import polars as pl
|
6
|
-
|
7
|
-
from .base import Base
|
8
|
-
|
9
|
-
if TYPE_CHECKING:
|
10
|
-
from polars import DataFrame
|
11
|
-
|
12
|
-
|
13
|
-
class Statements(Base):
|
14
|
-
def number_of_shares(self) -> DataFrame:
|
15
|
-
"""発行済株式数を取得する。"""
|
16
|
-
return self.data.filter(
|
17
|
-
pl.col("IssuedShares").is_not_null(),
|
18
|
-
).select(
|
19
|
-
"Date",
|
20
|
-
"Code",
|
21
|
-
"IssuedShares",
|
22
|
-
"TreasuryShares",
|
23
|
-
"AverageOutstandingShares",
|
24
|
-
)
|
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
|
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
|