hossam 0.4.12__py3-none-any.whl → 0.4.14__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 +46 -7
- hossam/hs_cluster.py +777 -40
- hossam/hs_plot.py +322 -218
- hossam/hs_study.py +76 -0
- {hossam-0.4.12.dist-info → hossam-0.4.14.dist-info}/METADATA +1 -1
- {hossam-0.4.12.dist-info → hossam-0.4.14.dist-info}/RECORD +9 -8
- {hossam-0.4.12.dist-info → hossam-0.4.14.dist-info}/WHEEL +0 -0
- {hossam-0.4.12.dist-info → hossam-0.4.14.dist-info}/licenses/LICENSE +0 -0
- {hossam-0.4.12.dist-info → hossam-0.4.14.dist-info}/top_level.txt +0 -0
hossam/__init__.py
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import importlib.metadata
|
|
2
|
+
import requests
|
|
3
|
+
|
|
1
4
|
# submodules
|
|
2
5
|
from . import hs_classroom
|
|
3
6
|
from . import hs_gis
|
|
@@ -7,6 +10,7 @@ from . import hs_stats
|
|
|
7
10
|
from . import hs_timeserise
|
|
8
11
|
from . import hs_util
|
|
9
12
|
from . import hs_cluster
|
|
13
|
+
from . import hs_study
|
|
10
14
|
from .hs_util import load_info
|
|
11
15
|
from .hs_util import _load_data_remote as load_data
|
|
12
16
|
from .hs_plot import visualize_silhouette
|
|
@@ -14,6 +18,7 @@ from .hs_plot import visualize_silhouette
|
|
|
14
18
|
# py-modules
|
|
15
19
|
import sys
|
|
16
20
|
import warnings
|
|
21
|
+
import pandas as pd
|
|
17
22
|
from matplotlib import pyplot as plt
|
|
18
23
|
from matplotlib import font_manager as fm
|
|
19
24
|
from importlib.resources import files, as_file
|
|
@@ -26,10 +31,28 @@ except Exception:
|
|
|
26
31
|
|
|
27
32
|
my_dpi = hs_plot.config.dpi
|
|
28
33
|
|
|
29
|
-
__all__ = ["my_dpi", "load_data", "load_info", "hs_classroom", "hs_gis", "hs_plot", "hs_prep", "hs_stats", "hs_timeserise", "hs_util", "hs_cluster", "visualize_silhouette"]
|
|
34
|
+
__all__ = ["my_dpi", "load_data", "load_info", "hs_classroom", "hs_gis", "hs_plot", "hs_prep", "hs_stats", "hs_timeserise", "hs_util", "hs_cluster", "hs_study", "visualize_silhouette"]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def check_pypi_latest(package_name: str):
|
|
38
|
+
# 설치된 버전
|
|
39
|
+
installed = importlib.metadata.version(package_name)
|
|
40
|
+
|
|
41
|
+
try:
|
|
42
|
+
# PyPI 최신 버전
|
|
43
|
+
url = f"https://pypi.org/pypi/{package_name}/json"
|
|
44
|
+
resp = requests.get(url, timeout=5)
|
|
45
|
+
resp.raise_for_status()
|
|
46
|
+
latest = resp.json()["info"]["version"]
|
|
47
|
+
except Exception:
|
|
48
|
+
latest = None
|
|
30
49
|
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
return {
|
|
51
|
+
"package": package_name,
|
|
52
|
+
"installed": installed,
|
|
53
|
+
"latest": latest,
|
|
54
|
+
"outdated": installed != latest
|
|
55
|
+
}
|
|
33
56
|
|
|
34
57
|
|
|
35
58
|
def _init_korean_font():
|
|
@@ -59,10 +82,10 @@ def _init_korean_font():
|
|
|
59
82
|
"pdf.fonttype": 42,
|
|
60
83
|
"ps.fonttype": 42,
|
|
61
84
|
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
85
|
+
|
|
86
|
+
print(
|
|
87
|
+
"\n✅ 시각화를 위한 한글 글꼴(NotoSansKR-Regular)이 자동 적용되었습니다."
|
|
88
|
+
)
|
|
66
89
|
return
|
|
67
90
|
except Exception as e:
|
|
68
91
|
warnings.warn(f"\n한글 폰트 초기화: 패키지 폰트 사용 실패 ({e}).")
|
|
@@ -83,7 +106,23 @@ def _init():
|
|
|
83
106
|
for msg in messages:
|
|
84
107
|
print(f"{msg}")
|
|
85
108
|
|
|
109
|
+
version_info = check_pypi_latest("hossam")
|
|
110
|
+
|
|
111
|
+
if version_info["outdated"]:
|
|
112
|
+
print(
|
|
113
|
+
f"\n⚠️ 'hossam' 패키지의 최신 버전이 출시되었습니다! (설치된 버전: {version_info['installed']}, 최신 버전: {version_info['latest']})"
|
|
114
|
+
)
|
|
115
|
+
print(" 최신 버전으로 업데이트하려면 다음 명령어를 실행하세요:")
|
|
116
|
+
print(" pip install --upgrade hossam\n")
|
|
117
|
+
|
|
118
|
+
raise Warning("hossam 패키지가 최신 버전이 아닙니다.")
|
|
119
|
+
|
|
86
120
|
_init_korean_font()
|
|
87
121
|
|
|
122
|
+
# 컬럼 생략 금지
|
|
123
|
+
pd.set_option("display.max_columns", None)
|
|
124
|
+
# 행 최대 출력 수 100개로 수정
|
|
125
|
+
pd.set_option("display.max_rows", 100)
|
|
126
|
+
|
|
88
127
|
|
|
89
128
|
_init()
|