contracts-hj3415 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hyungjin Kim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: contracts-hj3415
3
+ Version: 0.1.0
4
+ Summary: A tiny example package
5
+ Keywords: example,demo
6
+ Author-email: Hyungjin Kim <hj3415@gmail.com>
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Typing :: Typed
12
+ License-File: LICENSE
13
+ Requires-Dist: pydantic>=2.7
14
+ Requires-Dist: contract-hj3415>=0.1
15
+ Requires-Dist: pytest>=8 ; extra == "dev"
16
+ Requires-Dist: pytest-cov>=7.0 ; extra == "dev"
17
+ Requires-Dist: ruff>=0.5 ; extra == "dev"
18
+ Requires-Dist: mypy>=1.10 ; extra == "dev"
19
+ Provides-Extra: dev
20
+
21
+
File without changes
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["flit_core>=3.9"]
3
+ build-backend = "flit_core.buildapi"
4
+
5
+ [project]
6
+ name = "contracts-hj3415" # PyPI 이름 (하이픈 허용)
7
+ version = "0.1.0"
8
+ description = "A tiny example package"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { file = "LICENSE" }
12
+ authors = [{name = "Hyungjin Kim", email = "hj3415@gmail.com"}]
13
+ keywords = ["example", "demo"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Typing :: Typed",
18
+ ]
19
+
20
+ dependencies = [
21
+ "pydantic>=2.7",
22
+ "contract-hj3415>=0.1",
23
+ ]
24
+
25
+ # 선택적 의존성 (pip install your-pkg[dev] 형태)
26
+ [project.optional-dependencies]
27
+ dev = ["pytest>=8", "pytest-cov>=7.0", "ruff>=0.5", "mypy>=1.10"]
@@ -0,0 +1,6 @@
1
+ #pytest.ini
2
+ [pytest]
3
+ addopts = -q -s --cov=contract_hj3415 --cov-report=term-missing
4
+ testpaths = tests
5
+ python_files = test_*.py *_test.py
6
+ filterwarnings = ignore::DeprecationWarning
@@ -0,0 +1,2 @@
1
+ pydantic>=2.7
2
+ contract-hj3415>=0.1
@@ -0,0 +1 @@
1
+ # Base DTO, mixins, timestamp helpers
@@ -0,0 +1 @@
1
+ # Literal, Enum 정의 등
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,10 @@
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
@@ -0,0 +1,14 @@
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
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,22 @@
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
@@ -0,0 +1,20 @@
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