krx-hj3415 2.2.2__tar.gz → 2.2.3__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.
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/PKG-INFO +1 -1
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/pyproject.toml +1 -1
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/usecases/sync_universe.py +17 -5
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/LICENSE +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/README.md +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/__init__.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/cli.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/domain/__init__.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/domain/diff.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/domain/types.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/domain/universe.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/provider/__init__.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/provider/krx300_samsungfund_excel.py +0 -0
- {krx_hj3415-2.2.2 → krx_hj3415-2.2.3}/src/krx_hj3415/usecases/__init__.py +0 -0
|
@@ -48,7 +48,9 @@ async def refresh_krx300(*, max_days: int = 15) -> tuple[datetime, list[CodeItem
|
|
|
48
48
|
return fetch_krx300_items(max_days=max_days)
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
def to_universe_item_dtos(
|
|
51
|
+
def to_universe_item_dtos(
|
|
52
|
+
items: Iterable[Any], *, market: str = "KRX"
|
|
53
|
+
) -> list[UniverseItemDTO]:
|
|
52
54
|
out: list[UniverseItemDTO] = []
|
|
53
55
|
for it in items:
|
|
54
56
|
if it is None:
|
|
@@ -89,7 +91,9 @@ async def run_sync(
|
|
|
89
91
|
asof, new_items = await refresh_krx300(max_days=max_days)
|
|
90
92
|
|
|
91
93
|
# --- 2) load old ---
|
|
92
|
-
old_payload_dto = await get_universe_latest(
|
|
94
|
+
old_payload_dto = await get_universe_latest(
|
|
95
|
+
db, universe=cast(UniverseNames, universe.value)
|
|
96
|
+
)
|
|
93
97
|
old_items = _payload_dto_to_items(old_payload_dto)
|
|
94
98
|
|
|
95
99
|
# --- 3) diff ---
|
|
@@ -99,11 +103,19 @@ async def run_sync(
|
|
|
99
103
|
|
|
100
104
|
# --- 4) save ---
|
|
101
105
|
await upsert_universe_latest(
|
|
102
|
-
db,
|
|
106
|
+
db,
|
|
107
|
+
universe=cast(UniverseNames, universe.value),
|
|
108
|
+
items=to_universe_item_dtos(new_items, market="KRX"),
|
|
109
|
+
asof=asof,
|
|
110
|
+
source="samsungfund",
|
|
103
111
|
)
|
|
104
112
|
if snapshot:
|
|
105
113
|
await insert_universe_snapshot(
|
|
106
|
-
db,
|
|
114
|
+
db,
|
|
115
|
+
universe=cast(UniverseNames, universe.value),
|
|
116
|
+
items=to_universe_item_dtos(new_items, market="KRX"),
|
|
117
|
+
asof=asof,
|
|
118
|
+
source="samsungfund",
|
|
107
119
|
)
|
|
108
120
|
|
|
109
121
|
return d
|
|
@@ -121,4 +133,4 @@ async def apply_removed(
|
|
|
121
133
|
if not codes:
|
|
122
134
|
return {"latest_deleted": 0, "snapshots_deleted": 0}
|
|
123
135
|
|
|
124
|
-
return await delete_codes_from_nfs(db, codes=codes, endpoint=None)
|
|
136
|
+
return await delete_codes_from_nfs(db, codes=codes, endpoint=None)
|
|
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
|