xython 4.5.1__tar.gz → 4.5.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.
Files changed (29) hide show
  1. {xython-4.5.1 → xython-4.5.3}/MANIFEST.in +1 -0
  2. {xython-4.5.1/src/xython.egg-info → xython-4.5.3}/PKG-INFO +3 -2
  3. {xython-4.5.1 → xython-4.5.3}/pyproject.toml +3 -3
  4. {xython-4.5.1 → xython-4.5.3}/src/xython/__init__.py +1 -1
  5. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_auto.py +3 -3
  6. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_chrome.py +14 -15
  7. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_color.py +10 -12
  8. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_common.py +1 -0
  9. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_db.py +17 -17
  10. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_edge.py +98 -46
  11. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_excel.py +255 -236
  12. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_map.py +3 -3
  13. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_outlook.py +32 -25
  14. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_re.py +4 -3
  15. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_time.py +8 -8
  16. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_util.py +32 -31
  17. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_word.py +44 -44
  18. {xython-4.5.1 → xython-4.5.3/src/xython.egg-info}/PKG-INFO +3 -2
  19. {xython-4.5.1 → xython-4.5.3}/README.md +0 -0
  20. {xython-4.5.1 → xython-4.5.3}/requirements.txt +0 -0
  21. {xython-4.5.1 → xython-4.5.3}/setup.cfg +0 -0
  22. {xython-4.5.1 → xython-4.5.3}/src/xython/_easy_start.py +0 -0
  23. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_excel_event.py +0 -0
  24. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_hwp.py +0 -0
  25. {xython-4.5.1 → xython-4.5.3}/src/xython/xy_list.py +0 -0
  26. {xython-4.5.1 → xython-4.5.3}/src/xython.egg-info/SOURCES.txt +0 -0
  27. {xython-4.5.1 → xython-4.5.3}/src/xython.egg-info/dependency_links.txt +0 -0
  28. {xython-4.5.1 → xython-4.5.3}/src/xython.egg-info/requires.txt +0 -0
  29. {xython-4.5.1 → xython-4.5.3}/src/xython.egg-info/top_level.txt +0 -0
@@ -22,3 +22,4 @@ include src/xython/xy_re.py
22
22
  include src/xython/xy_time.py
23
23
  include src/xython/xy_util.py
24
24
  include src/xython/xy_word.py
25
+ include src/xython/_easy_start.py
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xython
3
- Version: 4.5.1
3
+ Version: 4.5.3
4
4
  Summary: xython package
5
5
  Author-email: "SJ.Park" <sjpkorea@naver.com>
6
6
  License: MIT
7
- Project-URL: Homepage, https://www.xython.co.kr
7
+ Project-URL: Homepage, https://blog.naver.com/xython
8
+ Project-URL: Documentation, https://sjpkorea.github.io/xython.github.io/
8
9
  Requires-Python: >=3.8
9
10
  Description-Content-Type: text/markdown
10
11
  Requires-Dist: korean_lunar_calendar
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xython"
7
- version = "4.5.1"
7
+ version = "4.5.3"
8
8
  description = "xython package"
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.8"
@@ -26,8 +26,8 @@ dependencies = [
26
26
  ]
27
27
 
28
28
  [project.urls]
29
- Homepage = "https://www.xython.co.kr"
30
-
29
+ Homepage = "https://blog.naver.com/xython"
30
+ Documentation = "https://sjpkorea.github.io/xython.github.io/"
31
31
  [tool.setuptools.packages.find]
32
32
  where = ["src"]
33
33
 
@@ -1,7 +1,7 @@
1
1
  # __init__.py
2
2
  # Copyright (C) 2026 (sjpkorea@naver.com) and contributors
3
3
 
4
-
4
+ #https://blog.naver.com/xython
5
5
  import inspect
6
6
  import os
7
7
  import sys
@@ -186,7 +186,7 @@ class xy_auto:
186
186
  """
187
187
  def __init__(self):
188
188
  self.varx = xy_common.xy_common().varx
189
- self.xycolor = xy_color.xy_color()
189
+ self.colorx = xy_color.xy_color()
190
190
 
191
191
  def activate_edge_tab_by_title(self, keyword):
192
192
  """엣지 웹브라우저의 탭을 선택하는 것"""
@@ -493,8 +493,8 @@ class xy_auto:
493
493
  handle = user32.GetDesktopWindow()
494
494
  hdc = user32.GetDC(handle)
495
495
  null_brush = gdi32.GetStockObject(5)
496
- hex_color = self.xycolor.change_xcolor_to_rgb(xcolor)
497
- red_pen = gdi32.CreatePen(0, 2, self.xycolor.change_rgb_to_hex_rgb(hex_color[0], hex_color[1], hex_color[2]))
496
+ hex_color = self.colorx.change_xcolor_to_rgb(xcolor)
497
+ red_pen = gdi32.CreatePen(0, 2, self.colorx.change_rgb_to_hex_rgb(hex_color[0], hex_color[1], hex_color[2]))
498
498
  old_brush = gdi32.SelectObject(hdc, null_brush)
499
499
  old_pen = gdi32.SelectObject(hdc, red_pen)
500
500
  gdi32.Rectangle(hdc, int(left), int(top), int(right), int(bottom))
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  import copy
2
3
  from html.parser import HTMLParser
3
4
  from xython import xy_util, xy_excel, xy_re
@@ -67,9 +68,7 @@ class xy_chrome:
67
68
  auto_connect: True = 자동으로 연결/실행, False = 수동
68
69
  """
69
70
  # 공통 변수 설정
70
- self.xyutil = xy_util.xy_util()
71
- self.xyre = xy_re.xy_re()
72
-
71
+ self.utilx = xy_util.xy_util()
73
72
  self.chrome_paths = self._find_chrome_paths()
74
73
 
75
74
  self.port = port
@@ -1123,7 +1122,7 @@ class xy_chrome:
1123
1122
  print(f"[테이블 추출] URL: {url}")
1124
1123
  print(f" → 총 {len(tables_3d)}개 테이블 발견")
1125
1124
  for i, table in enumerate(tables_3d):
1126
- print(f" 테이블[{i}]: {len(table)}행 × {max(len(r) for r in table) if table else 0}열")
1125
+ print(f" 테이블[{i}]: {len(table)}행 x {max(len(r) for r in table) if table else 0}열")
1127
1126
 
1128
1127
  return tables_3d
1129
1128
 
@@ -1299,7 +1298,7 @@ class xy_chrome:
1299
1298
  html_code = self.get_html_code("https://info.bptc.co.kr/content/od/frame/yard_new_empty_frame_od_kr.jsp?p_id=EMPT_NE_KR&snb_num=8&snb_div=service&pop_ok=Y")
1300
1299
  l3d = self.html_tables_to_list(html_code)
1301
1300
  result = self.make_list_for_1(l3d)
1302
- self.xyutil.print_one_by_one(result)
1301
+ self.utilx.print_one_by_one(result)
1303
1302
  return result
1304
1303
 
1305
1304
  def port_2(self):
@@ -1312,7 +1311,7 @@ class xy_chrome:
1312
1311
  con_type = l1d[0][2:]
1313
1312
  for index, value in enumerate(l1d[1:]):
1314
1313
  result.append([port, con_type, con_size, l2d[0][index + 1], value])
1315
- self.xyutil.print_one_by_one(result)
1314
+ self.utilx.print_one_by_one(result)
1316
1315
  return result
1317
1316
 
1318
1317
  def port_3(self):
@@ -1326,7 +1325,7 @@ class xy_chrome:
1326
1325
  con_size = l2d[0][index + 1][:2]
1327
1326
  con_type = l2d[0][index + 1][2:]
1328
1327
  result.append([port, con_type, con_size, l1d[0], value])
1329
- self.xyutil.print_one_by_one(result)
1328
+ self.utilx.print_one_by_one(result)
1330
1329
  return result
1331
1330
 
1332
1331
  def port_4(self):
@@ -1340,7 +1339,7 @@ class xy_chrome:
1340
1339
  con_size = l2d[0][index + 1][:2]
1341
1340
  con_type = l2d[0][index + 1][2:]
1342
1341
  result.append([port, con_type, con_size, l1d[0], value])
1343
- self.xyutil.print_one_by_one(result)
1342
+ self.utilx.print_one_by_one(result)
1344
1343
  return result
1345
1344
 
1346
1345
  def port_5(self):
@@ -1355,7 +1354,7 @@ class xy_chrome:
1355
1354
  con_size = l2d[0][index + 1][:2]
1356
1355
  con_type = l2d[0][index + 1][2:]
1357
1356
  result.append([port, con_type, con_size, l1d[0], value])
1358
- self.xyutil.print_one_by_one(result)
1357
+ self.utilx.print_one_by_one(result)
1359
1358
  return result
1360
1359
 
1361
1360
  def port_6(self):
@@ -1370,14 +1369,14 @@ class xy_chrome:
1370
1369
  con_size = l2d[0][index + 1]
1371
1370
  con_type = ""
1372
1371
  result.append([port, con_type, con_size, l1d[0], value])
1373
- self.xyutil.print_one_by_one(result)
1372
+ self.utilx.print_one_by_one(result)
1374
1373
  return result
1375
1374
 
1376
1375
  def port_7(self):
1377
1376
  html_code = self.get_html_code("https://snct.sun-kwang.co.kr/infoservice/webpage/main/mainPage_iframe.jsp?type=IFRAME_EMPTY_ALL")
1378
1377
  l2d = self.html_tables_to_list(html_code)[-1]
1379
1378
  result = self.make_list_7(l2d)
1380
- self.xyutil.print_one_by_one(result)
1379
+ self.utilx.print_one_by_one(result)
1381
1380
  return result
1382
1381
 
1383
1382
  def port_9(self):
@@ -1404,7 +1403,7 @@ class xy_chrome:
1404
1403
  l2d.append(str(one_line).split("\t"))
1405
1404
  for no in range(1, len(l2d[0])):
1406
1405
  result.append(["style10", l2d[2][no], l2d[1][no], l2d[0][no], l2d[3][no]])
1407
- self.xyutil.print_one_by_one(result)
1406
+ self.utilx.print_one_by_one(result)
1408
1407
  return result
1409
1408
 
1410
1409
  def port_11(self):
@@ -1425,7 +1424,7 @@ class xy_chrome:
1425
1424
  con_type = l1d[0][2:]
1426
1425
  for index, value in enumerate(l1d[1:]):
1427
1426
  result.append(["style11", con_type, con_size, l2d[0][index + 1], value])
1428
- self.xyutil.print_one_by_one(result)
1427
+ self.utilx.print_one_by_one(result)
1429
1428
  return result
1430
1429
 
1431
1430
  def port_12(self):
@@ -1451,7 +1450,7 @@ class xy_chrome:
1451
1450
  for index, value in enumerate(l1d):
1452
1451
  result.append(["style12", "", l2d[0][index] if index < len(l2d[0]) else "", l1d[0], value])
1453
1452
 
1454
- self.xyutil.print_one_by_one(result)
1453
+ self.utilx.print_one_by_one(result)
1455
1454
  return result
1456
1455
 
1457
1456
  def port_13(self):
@@ -1474,7 +1473,7 @@ class xy_chrome:
1474
1473
  # [FIX] 기존: ["style13", "DRY", l2d[1][index], l1d[0], value]
1475
1474
  # 수정: con_size, con_type 을 정상 사용, 선사는 l2d[1][index+1]
1476
1475
  result.append(["style13", con_type, con_size, l2d[1][index + 1] if (index + 1) < len(l2d[1]) else "", value])
1477
- self.xyutil.print_one_by_one(result)
1476
+ self.utilx.print_one_by_one(result)
1478
1477
  return result
1479
1478
 
1480
1479
  def port_15(self):
@@ -1,7 +1,12 @@
1
+ # -*- coding: utf-8 -*-
1
2
  import re, math # 내장모듈
2
3
  import win32api, win32gui
3
4
  from xython import xy_re, xy_common # xython 모듈
4
5
 
6
+ from unittest.mock import patch
7
+ with patch("ctypes.windll.user32.SetProcessDPIAware", autospec=True):
8
+ import pyautogui
9
+
5
10
 
6
11
  class xy_color:
7
12
  """
@@ -140,7 +145,7 @@ class xy_color:
140
145
  hsl값을 미세조정하는 부분
141
146
 
142
147
  pm100 : ++, --, 70등의 값이 들어오면 변화를 시켜주는 것
143
- 숫자일 때: 50 기준으로 ±변화 (30이면 -20, 70이면 +20)
148
+ 숫자일 때: 50 기준으로 +-변화 (30이면 -20, 70이면 +20)
144
149
  """
145
150
  if type(pm100) == type(123):
146
151
  l_value = pm100 - 50 # 50 기준 차이 (음수 가능 → 어둡게도 동작)
@@ -162,7 +167,7 @@ class xy_color:
162
167
  hsl값을 미세조정하는 부분
163
168
 
164
169
  pm100 : ++, --, 70등의 값이 들어오면 변화를 시켜주는 것
165
- 숫자일 때: 50 기준으로 ±변화 (30이면 -20, 70이면 +20)
170
+ 숫자일 때: 50 기준으로 +-변화 (30이면 -20, 70이면 +20)
166
171
  """
167
172
  if type(pm100) == type(123):
168
173
  l_value = pm100 - 50 # 50 기준 차이 (음수 가능 → 어둡게도 동작)
@@ -996,7 +1001,7 @@ class xy_color:
996
1001
 
997
1002
  def get_analogous_colors(self, input_xcolor, angle=30, count=2):
998
1003
  """
999
- 유사색 생성 (색상환에서 ±angle도 이내의 색)
1004
+ 유사색 생성 (색상환에서 +-angle도 이내의 색)
1000
1005
  count=2이면 양쪽 1개씩, count=4이면 양쪽 2개씩
1001
1006
  반환: [[r,g,b], ...]
1002
1007
  """
@@ -1291,7 +1296,7 @@ class xy_color:
1291
1296
 
1292
1297
  def get_split_complementary_colors(self, input_xcolor, angle=150):
1293
1298
  """
1294
- 분리 보색 배색 (보색에서 ±30도 위치의 두 색)
1299
+ 분리 보색 배색 (보색에서 +-30도 위치의 두 색)
1295
1300
  반환: [원색rgb, 분리보색1rgb, 분리보색2rgb]
1296
1301
  """
1297
1302
  hsl = self.to_hsl(input_xcolor)
@@ -1616,7 +1621,7 @@ class xy_color:
1616
1621
  def hsl_to_rgb_by_pm100(self, input_hsl, pm100):
1617
1622
  """
1618
1623
  pm100 : ++, --, 70등의 값이 들어오면 변화를 시켜주는 것
1619
- 숫자일 때: 50 기준으로 ±변화 (30이면 -20, 70이면 +20)
1624
+ 숫자일 때: 50 기준으로 +-변화 (30이면 -20, 70이면 +20)
1620
1625
 
1621
1626
  :param input_hsl: [h,s,l]값
1622
1627
  :param pm100:
@@ -1994,8 +1999,6 @@ class xy_color:
1994
1999
  result = '#{:02x}{:02x}{:02x}'.format(r, g, b)
1995
2000
  return result
1996
2001
 
1997
- def rgb_to_hex(self, input_rgb, option="#"):
1998
- return self.rgb_to_hex(input_rgb, option)
1999
2002
 
2000
2003
  def rgb_to_hex_rgb(self, r, g, b):
2001
2004
  """
@@ -2279,11 +2282,6 @@ class xy_color:
2279
2282
  result = self.rgb_to_close_56color_no(rgb_value)
2280
2283
  return result
2281
2284
 
2282
- def to_hex(self, input_xcolor):
2283
- """
2284
- 사용의 편의성을 위해 만듦
2285
- """
2286
- return self.to_hex(input_xcolor)
2287
2285
 
2288
2286
  def to_hex(self, input_xcolor):
2289
2287
  """
@@ -1,3 +1,4 @@
1
+ # -*- coding: utf-8 -*-
1
2
  import datetime
2
3
 
3
4
  class xy_common:
@@ -15,8 +15,8 @@ class xy_db:
15
15
 
16
16
  def __init__(self, db_name=""):
17
17
  self.db_name = db_name
18
- self.xyutil = xy_util.xy_util()
19
- self.xyexcel = xy_excel.xy_excel()
18
+ self.utilx = xy_util.xy_util()
19
+ self.excel = xy_excel.xy_excel()
20
20
 
21
21
  self.table_name = ""
22
22
  self.con = "" # sqlite db에 연결되는 것
@@ -289,8 +289,8 @@ class xy_db:
289
289
  :return:
290
290
  """
291
291
 
292
- input_l2d = self.xyutil.check_data_types_for_l2d(input_l2d) # 2차원이 아닐때 2차원으로 만들러 주는것
293
- listdb = self.xyutil.change_xylist_to_yxlist(input_l2d)
292
+ input_l2d = self.utilx.check_data_types_for_l2d(input_l2d) # 2차원이 아닐때 2차원으로 만들러 주는것
293
+ listdb = self.utilx.change_xylist_to_yxlist(input_l2d)
294
294
  return listdb
295
295
 
296
296
  def change_list_to_listdb(self, input_list):
@@ -340,8 +340,8 @@ class xy_db:
340
340
  temp = []
341
341
  result = {}
342
342
  if type(listdb) == type([]):
343
- listdb = self.xyutil.check_data_types_for_l2d(listdb) # 2차원이 아닐때 2차원으로 만들러 주는것
344
- listdb = self.xyutil.change_l2d_to_l2d_as_same_len(listdb) # 길이가 다를때 제일 긴것으로 똑같이 만들어 주는것
343
+ listdb = self.utilx.check_data_types_for_l2d(listdb) # 2차원이 아닐때 2차원으로 만들러 주는것
344
+ listdb = self.utilx.change_l2d_to_l2d_as_same_len(listdb) # 길이가 다를때 제일 긴것으로 똑같이 만들어 주는것
345
345
  # 별도로 column의 제목이 없다면, 1번부터 시작하는 번호를 넣어준다
346
346
  if col_list == "":
347
347
  for index, l1d in enumerate(listdb):
@@ -634,7 +634,7 @@ class xy_db:
634
634
  :param path: 경로
635
635
  :return:
636
636
  """
637
- db_name_all = self.xyutil.get_all_filename_in_folder(path)
637
+ db_name_all = self.utilx.get_all_filename_in_folder(path)
638
638
  if db_name in db_name_all:
639
639
  result = db_name
640
640
  else:
@@ -1305,19 +1305,19 @@ class xy_db:
1305
1305
  x_len = 10
1306
1306
  y_len = 12
1307
1307
 
1308
- self.xyexcel.new_sheet()
1308
+ self.excel.new_sheet()
1309
1309
  for index in range(1, y_len + 1):
1310
1310
  y_title_list.append("title_" + str(index))
1311
1311
 
1312
- self.xyexcel.write_l1d_from_cell("", [1, 2], y_title_list)
1312
+ self.excel.write_l1d_from_cell("", [1, 2], y_title_list)
1313
1313
  for no1 in range(1, x_len + 1):
1314
1314
  for no2 in range(1, y_len + 1):
1315
- self.xyexcel.write_value_in_cell("", [no1 + 1, no2 + 1], no1 * 10 + no2)
1315
+ self.excel.write_value_in_cell("", [no1 + 1, no2 + 1], no1 * 10 + no2)
1316
1316
 
1317
1317
  x_title_list = []
1318
1318
  for index in range(1, x_len + 1):
1319
1319
  x_title_list.append("줄_" + str(index))
1320
- self.xyexcel.write_l1d_from_cell_as_yline("", [2, 1], x_title_list)
1320
+ self.excel.write_l1d_from_cell_as_yline("", [2, 1], x_title_list)
1321
1321
 
1322
1322
  def make_cursor_for_sqlite_db(self, db_name=""):
1323
1323
  """
@@ -1431,7 +1431,7 @@ class xy_db:
1431
1431
  """
1432
1432
  result = []
1433
1433
  line_len = len(input_l2d)
1434
- y_len = self.xyutil.get_max_len_for_l2d(input_l2d)
1434
+ y_len = self.utilx.get_max_len_for_l2d(input_l2d)
1435
1435
  title_list = []
1436
1436
  type_list = []
1437
1437
  for no in range(1, y_len + 1):
@@ -1474,7 +1474,7 @@ class xy_db:
1474
1474
  :param col_list: y컬럼 이름들
1475
1475
  :return:
1476
1476
  """
1477
- sql_columns = self.xyutil.change_l1d_to_text_with_chain_word(col_list, ", ")
1477
+ sql_columns = self.utilx.change_l1d_to_text_with_chain_word(col_list, ", ")
1478
1478
  sql_values = "?," * len(col_list)
1479
1479
  result = "insert into %s (%s) values (%s)" % (table_name, sql_columns, sql_values[:-1])
1480
1480
  return result
@@ -1992,7 +1992,7 @@ class xy_db:
1992
1992
  if y_title_s == "":
1993
1993
  sql_columns = "*"
1994
1994
  else:
1995
- sql_columns = self.xyutil.change_l1d_to_text_with_chain_word(y_title_s, ", ")
1995
+ sql_columns = self.utilx.change_l1d_to_text_with_chain_word(y_title_s, ", ")
1996
1996
  if condition == "all":
1997
1997
  lim_no = 100
1998
1998
  else:
@@ -2168,7 +2168,7 @@ class xy_db:
2168
2168
  def split_l2d_as_data_x_title_yline_title(self, input_l2d, x_title_len, y_title_len):
2169
2169
  """
2170
2170
  2줄이상의 제목이 들어갈수있을것같아, 2차원의 자료로 만들었다
2171
- l2d = self.xyutil.check_l2d(input_l2d)
2171
+ l2d = self.utilx.check_l2d(input_l2d)
2172
2172
 
2173
2173
  :param input_l2d:
2174
2174
  :param x_title_len:
@@ -2232,8 +2232,8 @@ class xy_db:
2232
2232
  """
2233
2233
  col_list = input_df.columns.values.tolist()
2234
2234
  value_list = input_df.values.tolist()
2235
- self.xyexcel.write_l1d_from_cell_as_yline("", xy, col_list)
2236
- self.xyexcel.write_value_in_range_as_speedy("", [xy[0] + 1, xy[1]], value_list)
2235
+ self.excel.write_l1d_from_cell_as_yline("", xy, col_list)
2236
+ self.excel.write_value_in_range_as_speedy("", [xy[0] + 1, xy[1]], value_list)
2237
2237
 
2238
2238
  def write_dataframe_to_sqlite(self, db_name, table_name, input_df):
2239
2239
  """