hossam 0.3.19__py3-none-any.whl → 0.4__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.
- hossam/__init__.py +19 -22
- hossam/data_loader.py +16 -10
- hossam/hs_classroom.py +69 -44
- hossam/hs_gis.py +10 -6
- hossam/hs_plot.py +153 -150
- hossam/hs_prep.py +95 -85
- hossam/hs_stats.py +426 -548
- hossam/hs_timeserise.py +161 -152
- hossam/hs_util.py +44 -17
- {hossam-0.3.19.dist-info → hossam-0.4.dist-info}/METADATA +6 -107
- hossam-0.4.dist-info/RECORD +16 -0
- hossam/mcp/__init__.py +0 -12
- hossam/mcp/hs_classroom.py +0 -22
- hossam/mcp/hs_gis.py +0 -30
- hossam/mcp/hs_plot.py +0 -53
- hossam/mcp/hs_prep.py +0 -61
- hossam/mcp/hs_stats.py +0 -25
- hossam/mcp/hs_timeserise.py +0 -22
- hossam/mcp/hs_util.py +0 -30
- hossam/mcp/loader.py +0 -29
- hossam/mcp/server.py +0 -675
- hossam-0.3.19.dist-info/RECORD +0 -27
- hossam-0.3.19.dist-info/entry_points.txt +0 -2
- {hossam-0.3.19.dist-info → hossam-0.4.dist-info}/WHEEL +0 -0
- {hossam-0.3.19.dist-info → hossam-0.4.dist-info}/licenses/LICENSE +0 -0
- {hossam-0.3.19.dist-info → hossam-0.4.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hossam
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4
|
|
4
4
|
Summary: Hossam Data Helper
|
|
5
5
|
Author-email: Lee Kwang-Ho <leekh4232@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -35,6 +35,10 @@ Requires-Dist: pmdarima
|
|
|
35
35
|
Requires-Dist: prophet
|
|
36
36
|
Requires-Dist: plotly
|
|
37
37
|
Requires-Dist: jenkspy
|
|
38
|
+
Requires-Dist: flask
|
|
39
|
+
Requires-Dist: xgboost
|
|
40
|
+
Requires-Dist: lightgbm
|
|
41
|
+
Requires-Dist: catboost
|
|
38
42
|
Dynamic: license-file
|
|
39
43
|
|
|
40
44
|
---
|
|
@@ -61,7 +65,6 @@ title: 🎓 Hossam Data Helper
|
|
|
61
65
|
- 🤖 **MCP 서버**: VSCode/Copilot과 통합 가능한 Model Context Protocol 지원
|
|
62
66
|
- 📈 **교육용 최적화**: 데이터 분석 교육에 특화된 설계
|
|
63
67
|
|
|
64
|
-
---
|
|
65
68
|
|
|
66
69
|
## 📦 설치
|
|
67
70
|
|
|
@@ -71,72 +74,6 @@ pip install hossam
|
|
|
71
74
|
|
|
72
75
|
**요구사항**: Python 3.8 이상
|
|
73
76
|
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## 🚀 빠른 시작
|
|
77
|
-
|
|
78
|
-
### 샘플 데이터 로드
|
|
79
|
-
|
|
80
|
-
```python
|
|
81
|
-
from hossam import load_data, load_info
|
|
82
|
-
|
|
83
|
-
# 사용 가능한 데이터셋 확인
|
|
84
|
-
datasets = load_info()
|
|
85
|
-
|
|
86
|
-
# 데이터 로드
|
|
87
|
-
df = load_data('AD_SALES')
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### 간단한 시각화
|
|
91
|
-
|
|
92
|
-
```python
|
|
93
|
-
from hossam import hs_plot
|
|
94
|
-
import pandas as pd
|
|
95
|
-
import numpy as np
|
|
96
|
-
|
|
97
|
-
df = pd.DataFrame({
|
|
98
|
-
'x': np.random.randn(100),
|
|
99
|
-
'y': np.random.randn(100),
|
|
100
|
-
'category': np.random.choice(['A', 'B', 'C'], 100)
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
# 산점도
|
|
104
|
-
hs_plot.scatterplot(df=df, xname='x', yname='y', hue='category')
|
|
105
|
-
|
|
106
|
-
# 박스플롯
|
|
107
|
-
hs_plot.boxplot(df=df, xname='category', yname='x')
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## 🤖 MCP Server
|
|
113
|
-
|
|
114
|
-
Hossam은 **Model Context Protocol(MCP)** 기반 서버로도 작동하며, VSCode Copilot/Cline과 통합하여 데이터 분석 코드를 자동 생성할 수 있습니다.
|
|
115
|
-
|
|
116
|
-
### 빠른 시작
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# 서버 시작
|
|
120
|
-
hossam-mcp
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### VSCode + Copilot 연동
|
|
124
|
-
|
|
125
|
-
VSCode에서 Copilot과 함께 사용하려면 `.vscode/settings.json` 설정이 필요합니다.
|
|
126
|
-
|
|
127
|
-
**Copilot Chat에서 사용:**
|
|
128
|
-
```
|
|
129
|
-
@hossam 이 DataFrame의 결측치를 분석하고 처리하는 코드 작성해줘
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**설정 가이드:**
|
|
133
|
-
- [`.vscode/settings.json` 완성형 샘플](https://py.hossam.kr/guides/vscode-settings-sample/) ⭐
|
|
134
|
-
- [VSCode + Copilot 연동 상세](https://py.hossam.kr/guides/vscode-copilot-integration/)
|
|
135
|
-
- [MCP 서버 사용법](https://py.hossam.kr/guides/mcp/)
|
|
136
|
-
- [Copilot Chat 프롬프트 예시](https://py.hossam.kr/guides/copilot-prompts/)
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
77
|
## 📚 전체 문서
|
|
141
78
|
|
|
142
79
|
**완전한 API 문서와 가이드는 [py.hossam.kr](https://py.hossam.kr)에서 확인하세요.**
|
|
@@ -152,49 +89,11 @@ VSCode에서 Copilot과 함께 사용하려면 `.vscode/settings.json` 설정이
|
|
|
152
89
|
|
|
153
90
|
자세한 사용법은 [API 문서](https://py.hossam.kr/api/hossam/)를 참고하세요.
|
|
154
91
|
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## 🎓 예제
|
|
158
|
-
|
|
159
|
-
### 결측치 분석
|
|
160
|
-
|
|
161
|
-
```python
|
|
162
|
-
from hossam import hs_prep
|
|
163
|
-
|
|
164
|
-
# 결측치 정보 확인
|
|
165
|
-
hs_prep.hs_missing_values(df)
|
|
166
|
-
|
|
167
|
-
# 결측치 시각화
|
|
168
|
-
hs_prep.hs_missing_values_barplot(df)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 회귀 분석
|
|
172
|
-
|
|
173
|
-
```python
|
|
174
|
-
from hossam import hs_stats
|
|
175
|
-
|
|
176
|
-
# 단순 선형 회귀
|
|
177
|
-
result = hs_stats.hs_simple_regression(df, xname='x', yname='y', plot=True)
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### 상관분석 히트맵
|
|
181
|
-
|
|
182
|
-
```python
|
|
183
|
-
from hossam import hs_plot
|
|
184
|
-
|
|
185
|
-
hs_plot.heatmap(df=df, annot=True, cmap='coolwarm')
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
더 많은 예제는 [문서 사이트](https://py.hossam.kr)를 참고하세요.
|
|
189
|
-
|
|
190
|
-
---
|
|
191
92
|
|
|
192
93
|
## 📄 라이선스
|
|
193
94
|
|
|
194
95
|
이 프로젝트는 MIT 라이선스를 따릅니다. 자유롭게 사용, 수정, 배포할 수 있습니다.
|
|
195
96
|
|
|
196
|
-
---
|
|
197
|
-
|
|
198
97
|
## 🔗 링크
|
|
199
98
|
|
|
200
99
|
- **문서**: [py.hossam.kr](https://py.hossam.kr)
|
|
@@ -203,4 +102,4 @@ hs_plot.heatmap(df=df, annot=True, cmap='coolwarm')
|
|
|
203
102
|
|
|
204
103
|
---
|
|
205
104
|
|
|
206
|
-
|
|
105
|
+
{% include 'HOSSAM_API.md' %}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
hossam/NotoSansKR-Regular.ttf,sha256=0SCufUQwcVWrWTu75j4Lt_V2bgBJIBXl1p8iAJJYkVY,6185516
|
|
2
|
+
hossam/__init__.py,sha256=bPX6EGjmuuznCyyEpNUuGnuvvXJiWNLGaS3ylBOiYk8,2840
|
|
3
|
+
hossam/data_loader.py,sha256=oUIsqbHQoRiHA_1tdElDaYo1ipmUB5fYSXYMB5gLOl0,6395
|
|
4
|
+
hossam/hs_classroom.py,sha256=rgayol3U5PSo4rLfdbClfiAtG21bFrASaSW56PUsjus,27144
|
|
5
|
+
hossam/hs_gis.py,sha256=DLogaf5nxJBbG-d8QoH2g8UfZ1omMtmEXDYgNg8jtT0,11410
|
|
6
|
+
hossam/hs_plot.py,sha256=-ByDla2La34l6zI_T_e-FHAT3d8hLVo5J-pLBP8PixE,78285
|
|
7
|
+
hossam/hs_prep.py,sha256=2ptFFxV4G1IFmy-B89TqXaPkA8jROZutr2XIkaXNHW4,36006
|
|
8
|
+
hossam/hs_stats.py,sha256=qAor-RE5qNsytoZW1mriK3yql9PVif5bBGyG64YC2PM,110780
|
|
9
|
+
hossam/hs_timeserise.py,sha256=gSj3cPgOGLOZEXhfW1anXbwpoJja847ZY9F8l9piJPE,42601
|
|
10
|
+
hossam/hs_util.py,sha256=8byLj_VR93vS__lyf0xgQKArgMy9qFm2VvZVSCxfQX0,8444
|
|
11
|
+
hossam/leekh.png,sha256=1PB5NQ24SDoHA5KMiBBsWpSa3iniFcwFTuGwuOsTHfI,6395
|
|
12
|
+
hossam-0.4.dist-info/licenses/LICENSE,sha256=nIqzhlcFY_2D6QtFsYjwU7BWkafo-rUJOQpDZ-DsauI,941
|
|
13
|
+
hossam-0.4.dist-info/METADATA,sha256=dSAoIrIDgbbKrZegpFB7BiVcXeIzDJ8vwWAEQK_LxhY,3674
|
|
14
|
+
hossam-0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
+
hossam-0.4.dist-info/top_level.txt,sha256=_-7bwjhthHplWhywEaHIJX2yL11CQCaLjCNSBlk6wiQ,7
|
|
16
|
+
hossam-0.4.dist-info/RECORD,,
|
hossam/mcp/__init__.py
DELETED
hossam/mcp/hs_classroom.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_classroom"""
|
|
3
|
-
def register(mcp):
|
|
4
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
5
|
-
import inspect as _inspect
|
|
6
|
-
import functools as _functools
|
|
7
|
-
import hossam.hs_classroom as _mod
|
|
8
|
-
|
|
9
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
10
|
-
if _name.startswith("_"):
|
|
11
|
-
continue
|
|
12
|
-
_tool_name = f"hs_classroom_{_name}"
|
|
13
|
-
if mcp.get_tool_info(_tool_name):
|
|
14
|
-
continue
|
|
15
|
-
|
|
16
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
17
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
18
|
-
@_functools.wraps(fn)
|
|
19
|
-
def _tool(**kwargs):
|
|
20
|
-
return fn(**kwargs)
|
|
21
|
-
|
|
22
|
-
_make_tool()
|
hossam/mcp/hs_gis.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_gis"""
|
|
3
|
-
def register(mcp):
|
|
4
|
-
from hossam.hs_gis import save_shape as _save_shape
|
|
5
|
-
|
|
6
|
-
@mcp.tool("hs_gis_save_shape")
|
|
7
|
-
def hs_save_shape(gdf_or_df, path: str, crs: str | None = None, lat_col: str = "latitude", lon_col: str = "longitude"):
|
|
8
|
-
"""GeoDataFrame 또는 DataFrame을 Shapefile/GeoPackage로 저장합니다."""
|
|
9
|
-
_save_shape(gdf_or_df, path=path, crs=crs, lat_col=lat_col, lon_col=lon_col)
|
|
10
|
-
return {"saved": True, "path": path}
|
|
11
|
-
|
|
12
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
13
|
-
import inspect as _inspect
|
|
14
|
-
import functools as _functools
|
|
15
|
-
import hossam.hs_gis as _mod
|
|
16
|
-
|
|
17
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
18
|
-
if _name.startswith("_"):
|
|
19
|
-
continue
|
|
20
|
-
_tool_name = f"hs_gis_{_name}"
|
|
21
|
-
if mcp.get_tool_info(_tool_name):
|
|
22
|
-
continue
|
|
23
|
-
|
|
24
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
25
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
26
|
-
@_functools.wraps(fn)
|
|
27
|
-
def _tool(**kwargs):
|
|
28
|
-
return fn(**kwargs)
|
|
29
|
-
|
|
30
|
-
_make_tool()
|
hossam/mcp/hs_plot.py
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_plot
|
|
3
|
-
|
|
4
|
-
시각화 함수는 파일 저장 경로(`save_path`)를 활용하는 사용을 권장합니다.
|
|
5
|
-
"""
|
|
6
|
-
from typing import Any
|
|
7
|
-
from pandas import DataFrame
|
|
8
|
-
|
|
9
|
-
from hossam.hs_plot import (
|
|
10
|
-
lineplot as _lineplot,
|
|
11
|
-
boxplot as _boxplot,
|
|
12
|
-
kdeplot as _kdeplot,
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def register(mcp):
|
|
17
|
-
# @mcp.tool("hs_lineplot")
|
|
18
|
-
# def hs_lineplot(df: DataFrame, xname: str | None = None, yname: str | None = None, hue: str | None = None, save_path: str | None = None, **params: Any):
|
|
19
|
-
# """선 그래프를 그립니다. 원격 환경에서는 `save_path`로 저장하여 활용하세요."""
|
|
20
|
-
# _lineplot(df=df, xname=xname, yname=yname, hue=hue, save_path=save_path, **params)
|
|
21
|
-
# return {"saved": bool(save_path), "path": save_path}
|
|
22
|
-
|
|
23
|
-
# @mcp.tool("hs_boxplot")
|
|
24
|
-
# def hs_boxplot(df: DataFrame, xname: str | None = None, yname: str | None = None, orient: str = "v", save_path: str | None = None, **params: Any):
|
|
25
|
-
# """상자그림(boxplot)을 그립니다. `save_path` 지정 시 파일로 저장합니다."""
|
|
26
|
-
# _boxplot(df=df, xname=xname, yname=yname, orient=orient, save_path=save_path, **params)
|
|
27
|
-
# return {"saved": bool(save_path), "path": save_path}
|
|
28
|
-
|
|
29
|
-
# @mcp.tool("hs_kdeplot")
|
|
30
|
-
# def hs_kdeplot(df: DataFrame, xname: str | None = None, yname: str | None = None, hue: str | None = None, fill: bool = False, quartile_split: bool = False, save_path: str | None = None, **params: Any):
|
|
31
|
-
# """KDE(커널 밀도) 그래프를 그립니다. 1D KDE는 `quartile_split`로 사분위별 분할 가능."""
|
|
32
|
-
# _kdeplot(df=df, xname=xname, yname=yname, hue=hue, fill=fill, quartile_split=quartile_split, save_path=save_path, **params)
|
|
33
|
-
# return {"saved": bool(save_path), "path": save_path}
|
|
34
|
-
|
|
35
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
36
|
-
import inspect as _inspect
|
|
37
|
-
import functools as _functools
|
|
38
|
-
import hossam.hs_plot as _mod
|
|
39
|
-
|
|
40
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
41
|
-
if _name.startswith("_"):
|
|
42
|
-
continue
|
|
43
|
-
_tool_name = f"hs_plot_{_name}"
|
|
44
|
-
if mcp.get_tool_info(_tool_name):
|
|
45
|
-
continue
|
|
46
|
-
|
|
47
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
48
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
49
|
-
@_functools.wraps(fn)
|
|
50
|
-
def _tool(**kwargs):
|
|
51
|
-
return fn(**kwargs)
|
|
52
|
-
|
|
53
|
-
_make_tool()
|
hossam/mcp/hs_prep.py
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_prep"""
|
|
3
|
-
from typing import List
|
|
4
|
-
from pandas import DataFrame
|
|
5
|
-
|
|
6
|
-
from hossam.hs_prep import (
|
|
7
|
-
standard_scaler as _standard_scaler,
|
|
8
|
-
minmax_scaler as _minmax_scaler,
|
|
9
|
-
set_category as _set_category,
|
|
10
|
-
get_dummies as _get_dummies,
|
|
11
|
-
replace_outliner as _replace_outliner,
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def register(mcp):
|
|
16
|
-
# @mcp.tool("hs_standard_scaler")
|
|
17
|
-
# def hs_standard_scaler(data: DataFrame | list | dict, yname: str | None = None, save_path: str | None = None, load_path: str | None = None):
|
|
18
|
-
# """연속형 변수에 대해 Z-Score(Standard) 스케일링을 수행합니다."""
|
|
19
|
-
# return _standard_scaler(data, yname=yname, save_path=save_path, load_path=load_path)
|
|
20
|
-
|
|
21
|
-
# @mcp.tool("hs_minmax_scaler")
|
|
22
|
-
# def hs_minmax_scaler(data: DataFrame | list | dict, yname: str | None = None, save_path: str | None = None, load_path: str | None = None):
|
|
23
|
-
# """연속형 변수를 0~1로 정규화(MinMax Scaling)합니다."""
|
|
24
|
-
# return _minmax_scaler(data, yname=yname, save_path=save_path, load_path=load_path)
|
|
25
|
-
|
|
26
|
-
# @mcp.tool("hs_set_category")
|
|
27
|
-
# def hs_set_category(df: DataFrame, fields: List[str]):
|
|
28
|
-
# """지정된 컬럼을 pandas Categorical로 설정합니다."""
|
|
29
|
-
# return _set_category(df, *fields)
|
|
30
|
-
|
|
31
|
-
# @mcp.tool("hs_get_dummies")
|
|
32
|
-
# def hs_get_dummies(df: DataFrame, fields: List[str] | None = None, drop_first: bool = True, dtype: str = "int"):
|
|
33
|
-
# """명목형 변수를 더미 변수(원-핫)로 변환합니다."""
|
|
34
|
-
# fields = fields or []
|
|
35
|
-
# return _get_dummies(df, *fields, drop_first=drop_first, dtype=dtype)
|
|
36
|
-
|
|
37
|
-
# @mcp.tool("hs_replace_outliner")
|
|
38
|
-
# def hs_replace_outliner(df: DataFrame, method: str = "nan", fields: List[str] | None = None):
|
|
39
|
-
# """IQR 기준 이상치를 지정된 방식으로 대체합니다."""
|
|
40
|
-
# fields = fields or []
|
|
41
|
-
# return _replace_outliner(df, method=method, *fields)
|
|
42
|
-
|
|
43
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
44
|
-
import inspect as _inspect
|
|
45
|
-
import functools as _functools
|
|
46
|
-
import hossam.hs_prep as _mod
|
|
47
|
-
|
|
48
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
49
|
-
if _name.startswith("_"):
|
|
50
|
-
continue
|
|
51
|
-
_tool_name = f"hs_prep_{_name}"
|
|
52
|
-
if mcp.get_tool_info(_tool_name):
|
|
53
|
-
continue
|
|
54
|
-
|
|
55
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
56
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
57
|
-
@_functools.wraps(fn)
|
|
58
|
-
def _tool(**kwargs):
|
|
59
|
-
return fn(**kwargs)
|
|
60
|
-
|
|
61
|
-
_make_tool()
|
hossam/mcp/hs_stats.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_stats
|
|
3
|
-
|
|
4
|
-
공개 API만 thin wrapper로 노출합니다.
|
|
5
|
-
"""
|
|
6
|
-
def register(mcp):
|
|
7
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
8
|
-
import inspect as _inspect
|
|
9
|
-
import functools as _functools
|
|
10
|
-
import hossam.hs_stats as _mod
|
|
11
|
-
|
|
12
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
13
|
-
if _name.startswith("_"):
|
|
14
|
-
continue
|
|
15
|
-
_tool_name = f"hs_stats_{_name}"
|
|
16
|
-
if mcp.get_tool_info(_tool_name):
|
|
17
|
-
continue
|
|
18
|
-
|
|
19
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
20
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
21
|
-
@_functools.wraps(fn)
|
|
22
|
-
def _tool(**kwargs):
|
|
23
|
-
return fn(**kwargs)
|
|
24
|
-
|
|
25
|
-
_make_tool()
|
hossam/mcp/hs_timeserise.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_timeserise"""
|
|
3
|
-
def register(mcp):
|
|
4
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
5
|
-
import inspect as _inspect
|
|
6
|
-
import functools as _functools
|
|
7
|
-
import hossam.hs_timeserise as _mod
|
|
8
|
-
|
|
9
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
10
|
-
if _name.startswith("_"):
|
|
11
|
-
continue
|
|
12
|
-
_tool_name = f"hs_timeserise_{_name}"
|
|
13
|
-
if mcp.get_tool_info(_tool_name):
|
|
14
|
-
continue
|
|
15
|
-
|
|
16
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
17
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
18
|
-
@_functools.wraps(fn)
|
|
19
|
-
def _tool(**kwargs):
|
|
20
|
-
return fn(**kwargs)
|
|
21
|
-
|
|
22
|
-
_make_tool()
|
hossam/mcp/hs_util.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP wrappers for hossam.hs_util"""
|
|
3
|
-
def register(mcp):
|
|
4
|
-
# @mcp.tool("hs_pretty_table")
|
|
5
|
-
# def hs_pretty_table(df, tablefmt: str = "simple", headers: str | list = "keys"):
|
|
6
|
-
# """DataFrame을 단순 표 형태로 출력합니다. 원격 환경에서는 표 문자열을 반환합니다."""
|
|
7
|
-
# # pretty_table은 print만 수행하므로, 문자열을 반환하도록 보정
|
|
8
|
-
# from tabulate import tabulate
|
|
9
|
-
# s = tabulate(df, headers=headers, tablefmt=tablefmt, showindex=True, numalign="right")
|
|
10
|
-
# return s
|
|
11
|
-
|
|
12
|
-
# 자동 등록: 언더바로 시작하지 않는 모든 공개 함수 노출(중복 방지)
|
|
13
|
-
import inspect as _inspect
|
|
14
|
-
import functools as _functools
|
|
15
|
-
import hossam.hs_util as _mod
|
|
16
|
-
|
|
17
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
18
|
-
if _name.startswith("_"):
|
|
19
|
-
continue
|
|
20
|
-
_tool_name = f"hs_util_{_name}"
|
|
21
|
-
if mcp.get_tool_info(_tool_name):
|
|
22
|
-
continue
|
|
23
|
-
|
|
24
|
-
def _make_tool(fn=_fn, tool_name=_tool_name):
|
|
25
|
-
@mcp.tool(tool_name, description=fn.__doc__)
|
|
26
|
-
@_functools.wraps(fn)
|
|
27
|
-
def _tool(**kwargs):
|
|
28
|
-
return fn(**kwargs)
|
|
29
|
-
|
|
30
|
-
_make_tool()
|
hossam/mcp/loader.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""MCP auto-wrappers for hossam.data_loader
|
|
3
|
-
|
|
4
|
-
공개 함수(언더바 미사용) 전체를 MCP tool로 자동 등록합니다.
|
|
5
|
-
단, load_data는 hs_util.load_data로 대체되므로 제외합니다.
|
|
6
|
-
"""
|
|
7
|
-
import inspect as _inspect
|
|
8
|
-
import hossam.data_loader as _mod
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def register(mcp):
|
|
12
|
-
# load_data는 제외 (hs_util.load_data를 사용)
|
|
13
|
-
excluded_functions = ["load_data"]
|
|
14
|
-
|
|
15
|
-
for _name, _fn in _inspect.getmembers(_mod, _inspect.isfunction):
|
|
16
|
-
if _name.startswith("_"):
|
|
17
|
-
continue
|
|
18
|
-
if _name in excluded_functions:
|
|
19
|
-
continue
|
|
20
|
-
_tool_name = f"hs_data_{_name}"
|
|
21
|
-
if mcp.get_tool_info(_tool_name):
|
|
22
|
-
continue
|
|
23
|
-
|
|
24
|
-
def _make_tool(fn=_fn, name=_name):
|
|
25
|
-
@mcp.tool(name)
|
|
26
|
-
def _tool(**kwargs):
|
|
27
|
-
return fn(**kwargs)
|
|
28
|
-
|
|
29
|
-
_make_tool()
|