contracts-hj3415 0.1.1__py3-none-any.whl → 0.4.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.
@@ -0,0 +1,27 @@
1
+ # contracts_hj3415/nfs/c101_dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing_extensions import TypedDict
5
+ from typing import Any
6
+ from .nfs_dto import NfsDTO
7
+ from .types import PeriodKey, Num, MetricKey
8
+
9
+ Scalar = str | float | int | None
10
+ ValuesMap = dict[PeriodKey, Num]
11
+
12
+
13
+ class C101Blocks(TypedDict):
14
+ 요약: dict[str, Scalar]
15
+ 시세: dict[str, Scalar]
16
+ 주주현황: list[dict[str, Scalar]]
17
+ 기업개요: dict[str, Scalar]
18
+ 펀더멘털: dict[MetricKey, ValuesMap]
19
+
20
+ 어닝서프라이즈: dict[str, Any]
21
+ 연간컨센서스: dict[MetricKey, ValuesMap]
22
+
23
+ class C101Payload(TypedDict):
24
+ blocks: C101Blocks
25
+
26
+ class C101DTO(NfsDTO):
27
+ payload: C101Payload
@@ -0,0 +1,35 @@
1
+ # contracts_hj3415/nfs/c103_dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing_extensions import TypedDict
5
+ from .nfs_dto import NfsDTO
6
+ from .types import Num, MetricKey, PeriodKey
7
+
8
+
9
+ C103ValuesMap = dict[PeriodKey, Num]
10
+
11
+ class C103Blocks(TypedDict):
12
+ 손익계산서y: dict[MetricKey, C103ValuesMap]
13
+ 손익계산서q: dict[MetricKey, C103ValuesMap]
14
+ 재무상태표y: dict[MetricKey, C103ValuesMap]
15
+ 재무상태표q: dict[MetricKey, C103ValuesMap]
16
+ 현금흐름표y: dict[MetricKey, C103ValuesMap]
17
+ 현금흐름표q: dict[MetricKey, C103ValuesMap]
18
+
19
+
20
+ class C103Labels(TypedDict):
21
+ 손익계산서y: dict[MetricKey, str]
22
+ 손익계산서q: dict[MetricKey, str]
23
+ 재무상태표y: dict[MetricKey, str]
24
+ 재무상태표q: dict[MetricKey, str]
25
+ 현금흐름표y: dict[MetricKey, str]
26
+ 현금흐름표q: dict[MetricKey, str]
27
+
28
+
29
+ class C103Payload(TypedDict):
30
+ blocks: C103Blocks
31
+ labels: C103Labels
32
+
33
+
34
+ class C103DTO(NfsDTO):
35
+ payload: C103Payload
@@ -0,0 +1,44 @@
1
+ # contracts_hj3415/nfs/c104_dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing_extensions import TypedDict
5
+ from .nfs_dto import NfsDTO
6
+ from .types import Num, MetricKey, PeriodKey
7
+
8
+
9
+ C104ValuesMap = dict[PeriodKey, Num]
10
+
11
+ class C104Blocks(TypedDict):
12
+ 수익성y: dict[MetricKey, C104ValuesMap]
13
+ 성장성y: dict[MetricKey, C104ValuesMap]
14
+ 안정성y: dict[MetricKey, C104ValuesMap]
15
+ 활동성y: dict[MetricKey, C104ValuesMap]
16
+ 가치분석y: dict[MetricKey, C104ValuesMap]
17
+ 수익성q: dict[MetricKey, C104ValuesMap]
18
+ 성장성q: dict[MetricKey, C104ValuesMap]
19
+ 안정성q: dict[MetricKey, C104ValuesMap]
20
+ 활동성q: dict[MetricKey, C104ValuesMap]
21
+ 가치분석q: dict[MetricKey, C104ValuesMap]
22
+
23
+
24
+ class C104Labels(TypedDict):
25
+ 수익성y: dict[MetricKey, str]
26
+ 성장성y: dict[MetricKey, str]
27
+ 안정성y: dict[MetricKey, str]
28
+ 활동성y: dict[MetricKey, str]
29
+ 가치분석y: dict[MetricKey, str]
30
+ 수익성q: dict[MetricKey, str]
31
+ 성장성q: dict[MetricKey, str]
32
+ 안정성q: dict[MetricKey, str]
33
+ 활동성q: dict[MetricKey, str]
34
+ 가치분석q: dict[MetricKey, str]
35
+
36
+
37
+
38
+ class C104Payload(TypedDict):
39
+ blocks: C104Blocks
40
+ labels: C104Labels
41
+
42
+
43
+ class C104DTO(NfsDTO):
44
+ payload: C104Payload
@@ -0,0 +1,28 @@
1
+ # contracts_hj3415/nfs/c106_dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing_extensions import TypedDict
5
+ from .nfs_dto import NfsDTO
6
+ from .types import Num, MetricKey, CodeKey
7
+
8
+
9
+ C106ValuesMap = dict[CodeKey, Num]
10
+
11
+
12
+ class C106Blocks(TypedDict):
13
+ y: dict[MetricKey, C106ValuesMap]
14
+ q: dict[MetricKey, C106ValuesMap]
15
+
16
+
17
+ class C106Labels(TypedDict):
18
+ y: dict[MetricKey, str]
19
+ q: dict[MetricKey, str]
20
+
21
+
22
+ class C106Payload(TypedDict):
23
+ blocks: C106Blocks
24
+ labels: C106Labels
25
+
26
+
27
+ class C106DTO(NfsDTO):
28
+ payload: C106Payload
@@ -0,0 +1,21 @@
1
+ # contracts_hj3415/nfs/c108_dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing_extensions import TypedDict
5
+ from .nfs_dto import NfsDTO
6
+ from .types import MetricKey
7
+
8
+
9
+ C108ValuesMap = dict[MetricKey, str|int|None]
10
+
11
+
12
+ class C108Blocks(TypedDict):
13
+ 리포트: list[C108ValuesMap]
14
+
15
+
16
+ class C108Payload(TypedDict):
17
+ blocks: C108Blocks
18
+
19
+
20
+ class C108DTO(NfsDTO):
21
+ payload: C108Payload
@@ -0,0 +1,49 @@
1
+ # contracts_hj3415/nfs/constants.py
2
+ from __future__ import annotations
3
+
4
+
5
+ ENDPOINTS: tuple[str, ...] = ("c101", "c103", "c104", "c106", "c108")
6
+
7
+
8
+ C101_BLOCK_KEYS: tuple[str, ...] = (
9
+ "요약",
10
+ "시세",
11
+ "주주현황",
12
+ "기업개요",
13
+ "펀더멘털",
14
+ "어닝서프라이즈",
15
+ "연간컨센서스",
16
+ )
17
+
18
+
19
+ C103_BLOCK_KEYS: tuple[str, ...] = (
20
+ "손익계산서y",
21
+ "손익계산서q",
22
+ "재무상태표y",
23
+ "재무상태표q",
24
+ "현금흐름표y",
25
+ "현금흐름표q",
26
+ )
27
+
28
+
29
+ C104_BLOCK_KEYS: tuple[str, ...] = (
30
+ "수익성y",
31
+ "성장성y",
32
+ "안정성y",
33
+ "활동성y",
34
+ "가치분석y",
35
+ "수익성q",
36
+ "성장성q",
37
+ "안정성q",
38
+ "활동성q",
39
+ "가치분석q",
40
+ )
41
+
42
+
43
+ C106_BLOCK_KEYS: tuple[str, ...] = (
44
+ "y",
45
+ "q",
46
+ )
47
+
48
+
49
+ C108_BLOCK_KEYS: tuple[str, ...] = ("리포트",)
@@ -0,0 +1,17 @@
1
+ # contracts_hj3415/nfs/nfs_dto.py
2
+ from __future__ import annotations
3
+
4
+ from datetime import datetime
5
+ from pydantic import BaseModel, ConfigDict
6
+ from .types import Endpoints, Payload
7
+
8
+
9
+ class NfsDTO(BaseModel):
10
+ code: str
11
+ asof: datetime
12
+ endpoint: Endpoints
13
+ payload: Payload
14
+
15
+ model_config = ConfigDict(extra="ignore")
16
+
17
+
@@ -0,0 +1,61 @@
1
+ # contracts_hj3415/nfs/types.py
2
+ from __future__ import annotations
3
+
4
+ from typing import Mapping, Any, Literal, TypeAlias
5
+
6
+ C101BlockKeys = Literal[
7
+ "요약", "시세", "주주현황", "기업개요", "펀더멘털", "어닝서프라이즈", "연간컨센서스"
8
+ ]
9
+
10
+ C103BlockKeys = Literal[
11
+ "손익계산서y",
12
+ "손익계산서q",
13
+ "재무상태표y",
14
+ "재무상태표q",
15
+ "현금흐름표y",
16
+ "현금흐름표q",
17
+ ]
18
+
19
+
20
+ C104BlockKeys = Literal[
21
+ "수익성y",
22
+ "성장성y",
23
+ "안정성y",
24
+ "활동성y",
25
+ "가치분석y",
26
+ "수익성q",
27
+ "성장성q",
28
+ "안정성q",
29
+ "활동성q",
30
+ "가치분석q",
31
+ ]
32
+
33
+
34
+ # C106===========================
35
+
36
+ C106BlockKeys = Literal[
37
+ "y",
38
+ "q",
39
+ ]
40
+
41
+
42
+ # C108============================
43
+
44
+ C108BlockKeys = Literal["리포트",]
45
+
46
+
47
+ # General====================
48
+
49
+ MetricKey = str
50
+ PeriodKey = str
51
+ CodeKey = str
52
+ Num = float | int | None
53
+
54
+ Endpoints = Literal["c101", "c103", "c104", "c106", "c108"]
55
+
56
+
57
+ Payload = Mapping[str, Any]
58
+
59
+ BlockKeys: TypeAlias = (
60
+ C101BlockKeys | C103BlockKeys | C104BlockKeys | C106BlockKeys | C108BlockKeys
61
+ )
@@ -0,0 +1,4 @@
1
+ # contracts_hj3415/universe/constants.py
2
+ from __future__ import annotations
3
+
4
+ UNIVERSE_NAMES: tuple[str, ...] = ("krx300",)
@@ -0,0 +1,17 @@
1
+ # contracts_hj3415/universe/dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing import Any, TypedDict
5
+
6
+ class UniverseItemDTO(TypedDict, total=False):
7
+ code: str # required by convention
8
+ name: str
9
+ market: str
10
+ meta: dict[str, Any]
11
+
12
+
13
+ class UniversePayloadDTO(TypedDict):
14
+ universe: str
15
+ asof: str # ISO string 권장 (UTC). datetime을 넘겨도 되지만 계약은 str이 깔끔함
16
+ source: str
17
+ items: list[UniverseItemDTO]
@@ -0,0 +1,6 @@
1
+ # contracts_hj3415/universe/dto.py
2
+ from __future__ import annotations
3
+
4
+ from typing import Literal
5
+
6
+ UniverseNames = Literal["krx300",]
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contracts-hj3415
3
- Version: 0.1.1
4
- Summary: A tiny example package
3
+ Version: 0.4.0
4
+ Summary: DTO pakages for hj3415
5
5
  Keywords: example,demo
6
6
  Author-email: Hyungjin Kim <hj3415@gmail.com>
7
7
  Requires-Python: >=3.11
@@ -11,10 +11,5 @@ Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Typing :: Typed
12
12
  License-File: LICENSE
13
13
  Requires-Dist: pydantic>=2.7
14
- Requires-Dist: pytest>=8 ; extra == "dev"
15
- Requires-Dist: pytest-cov>=7.0 ; extra == "dev"
16
- Requires-Dist: ruff>=0.5 ; extra == "dev"
17
- Requires-Dist: mypy>=1.10 ; extra == "dev"
18
- Provides-Extra: dev
19
14
 
20
15
 
@@ -0,0 +1,18 @@
1
+ contracts_hj3415/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ contracts_hj3415/nfs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ contracts_hj3415/nfs/c101_dto.py,sha256=nKKlMhz3jFPAb5JC8ZrgFjhmt7y8ZtamFmqNep2jy0U,686
4
+ contracts_hj3415/nfs/c103_dto.py,sha256=PSAJ3sx77BqBSOm-D_yVQXxTbYVfQ1-711DuOVxVpHY,988
5
+ contracts_hj3415/nfs/c104_dto.py,sha256=uO0-EGb3O5LiLSJ0oCg8TaHjLnInVFyAZDJkYUq26Is,1265
6
+ contracts_hj3415/nfs/c106_dto.py,sha256=TYTgkAHD5vwUo6jn4f0rXaLojUeO9tQ7ZreBj0Uc_oc,541
7
+ contracts_hj3415/nfs/c108_dto.py,sha256=H5eVFAADOAHL_vS_GHiBcYDoTuMg1WlFNgSYKtC7zls,387
8
+ contracts_hj3415/nfs/constants.py,sha256=qUs4EekAbnBFh0wk4tSlmAgxQG9sak-2YZuAjnNt4ak,850
9
+ contracts_hj3415/nfs/nfs_dto.py,sha256=R9Jy3oU8YCuNaYlwjEmFNE7FNNLST-Y5VlnYbfJyLg4,335
10
+ contracts_hj3415/nfs/types.py,sha256=6tUnaXOg0-_JE9wite5toz5CiGgmJtpqjiFD6qoYt2Y,1116
11
+ contracts_hj3415/universe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ contracts_hj3415/universe/constants.py,sha256=vYAwhTBFSQhxyzIz8EK3gxwUX6cHdDdezE0KygzAQvU,122
13
+ contracts_hj3415/universe/dto.py,sha256=fR17Cgo8XKT26KDzoqGOltDYTNYvcz2JmMBKhAdbp90,478
14
+ contracts_hj3415/universe/types.py,sha256=OkYoMOHbP6UufOdRL3M8c9orNf_2g-E98fMI7ayG6Fg,134
15
+ contracts_hj3415-0.4.0.dist-info/licenses/LICENSE,sha256=QBiVGQuKAESeCfQE344Ik2ex6g2zfYdu9WqrRWydxIs,1068
16
+ contracts_hj3415-0.4.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
17
+ contracts_hj3415-0.4.0.dist-info/METADATA,sha256=nD0xPnBGQi65M19_bAOIZlSDungkYC7yDxHN_FOn8RA,405
18
+ contracts_hj3415-0.4.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- # Base DTO, mixins, timestamp helpers
@@ -1 +0,0 @@
1
- # Literal, Enum 정의 등
@@ -1,25 +0,0 @@
1
- #src/contracts_hj3415/common.py — 공용 타입, 베이스 모델, Enum 등
2
-
3
- from datetime import datetime
4
- from uuid import UUID, uuid4
5
- from enum import Enum
6
- from pydantic import BaseModel, Field
7
-
8
- class IDModel(BaseModel):
9
- id: UUID = Field(default_factory=uuid4)
10
-
11
- class TimestampMixin(BaseModel):
12
- created_at: datetime = Field(default_factory=datetime.utcnow)
13
- updated_at: datetime | None = None
14
-
15
- class UserRole(str, Enum):
16
- ADMIN = "admin"
17
- STAFF = "staff"
18
- CUSTOMER = "customer"
19
-
20
- # 공통 BaseModel
21
- class ContractModel(BaseModel):
22
- class Config:
23
- orm_mode = True
24
- extra = "forbid"
25
- from_attributes = True
@@ -1,10 +0,0 @@
1
- # src/contracts_hj3415/events.py — 메시지 / 이벤트 스키마
2
-
3
- from datetime import datetime
4
- from uuid import UUID
5
- from pydantic import BaseModel
6
-
7
- class UserCreatedEvent(BaseModel):
8
- event: str = "user.created"
9
- user_id: UUID
10
- timestamp: datetime
contracts_hj3415/items.py DELETED
@@ -1,14 +0,0 @@
1
- #src/contracts_hj3415/items.py — 아이템 관련 DTO
2
-
3
- from datetime import datetime
4
- from .common import IDModel, ContractModel
5
-
6
- class ItemBase(ContractModel):
7
- name: str
8
- description: str | None = None
9
-
10
- class ItemCreate(ItemBase):
11
- pass
12
-
13
- class ItemRead(IDModel, ItemBase):
14
- created_at: datetime
File without changes
@@ -1,13 +0,0 @@
1
- # contracts_hj3415/nfs/dim_account.py
2
- from pydantic import BaseModel
3
- from typing import Optional
4
-
5
- class DimAccountDTO(BaseModel):
6
- accode: str
7
- account_name: str
8
- level: Optional[int] = None
9
- parent_accode: Optional[str] = None
10
- group_type: Optional[int] = None
11
- unit_type: Optional[int] = None
12
- acc_kind: Optional[str] = None
13
- precision: Optional[int] = None
File without changes
@@ -1,22 +0,0 @@
1
- # contracts_hj3415/nfs/fact.py
2
- from pydantic import BaseModel, Field
3
- from datetime import date
4
- from typing import Optional
5
-
6
- class FactFinanceDTO(BaseModel):
7
- cmp_cd: str
8
- page: str
9
- rpt: str
10
- frq: str
11
- accode: str
12
- account_name: str
13
- period: date
14
- value: float
15
- basis: Optional[str] = None
16
- is_estimate: bool = False
17
- unit_type: Optional[int] = None
18
- level: Optional[int] = None
19
- parent_accode: Optional[str] = None
20
- group_type: Optional[int] = None
21
- acc_kind: Optional[str] = None
22
- precision: Optional[int] = None
contracts_hj3415/users.py DELETED
@@ -1,20 +0,0 @@
1
- #src/contracts_hj3415/users.py — 사용자 관련 DTO
2
-
3
- from datetime import datetime
4
- from pydantic import BaseModel, EmailStr
5
- from .common import IDModel, ContractModel, UserRole
6
-
7
- class UserBase(ContractModel):
8
- email: EmailStr
9
- nickname: str | None = None
10
- role: UserRole = UserRole.CUSTOMER
11
-
12
- class UserCreate(UserBase):
13
- password: str
14
-
15
- class UserUpdate(BaseModel):
16
- nickname: str | None = None
17
- role: UserRole | None = None
18
-
19
- class UserRead(IDModel, UserBase):
20
- created_at: datetime
@@ -1,17 +0,0 @@
1
- contracts_hj3415/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- contracts_hj3415/common.py,sha256=VDTSWDTYBC2kNX-GsogN3uualTUq5MMJ_rlGI_7RrPM,651
3
- contracts_hj3415/events.py,sha256=vQ14lksEsINW4Ud9sPbLj9ipDhoatWv4wYNU3E3zt9E,262
4
- contracts_hj3415/items.py,sha256=5f6KXoENO6iTPvXobZOZM8jjndBf6tXph0-HEgcMzOI,309
5
- contracts_hj3415/users.py,sha256=PlKWqvJMdjleZRSmvkvZrMpUG_3qmofR791I6i_jFog,506
6
- contracts_hj3415/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- contracts_hj3415/common/base.py,sha256=Iy0_CapYGG9w2FHOVorOyS0Ju8Kk6Yd5HU6nVZZ7SXw,37
8
- contracts_hj3415/common/types.py,sha256=jzcc0XiP8Nd9QzBucWswQwOHP0UcV_TQyC2pffFScMs,26
9
- contracts_hj3415/nfs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- contracts_hj3415/nfs/delta.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- contracts_hj3415/nfs/dim_account.py,sha256=DWjDi5exdcTSVy3r3vIV0jaFIVUOHGUJocXPNHxMnoQ,383
12
- contracts_hj3415/nfs/dim_period.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- contracts_hj3415/nfs/fact.py,sha256=_Bq7jW-l7eDpcs4gS2BYPlTX9MGKXFn-F7HozfVcgek,562
14
- contracts_hj3415-0.1.1.dist-info/licenses/LICENSE,sha256=QBiVGQuKAESeCfQE344Ik2ex6g2zfYdu9WqrRWydxIs,1068
15
- contracts_hj3415-0.1.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
16
- contracts_hj3415-0.1.1.dist-info/METADATA,sha256=EgkvOLZuM0bRdIkDAsvloWh_Sa-M9kUzSzjaPiTaqdA,600
17
- contracts_hj3415-0.1.1.dist-info/RECORD,,
File without changes