xython 4.7.1__tar.gz → 4.7.2__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 (30) hide show
  1. {xython-4.7.1/src/xython.egg-info → xython-4.7.2}/PKG-INFO +1 -1
  2. {xython-4.7.1 → xython-4.7.2}/pyproject.toml +1 -1
  3. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_excel.py +36 -46
  4. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_util.py +35 -0
  5. {xython-4.7.1 → xython-4.7.2/src/xython.egg-info}/PKG-INFO +1 -1
  6. {xython-4.7.1 → xython-4.7.2}/MANIFEST.in +0 -0
  7. {xython-4.7.1 → xython-4.7.2}/README.md +0 -0
  8. {xython-4.7.1 → xython-4.7.2}/setup.cfg +0 -0
  9. {xython-4.7.1 → xython-4.7.2}/src/xython/__init__.py +0 -0
  10. {xython-4.7.1 → xython-4.7.2}/src/xython/alias_installer.py +0 -0
  11. {xython-4.7.1 → xython-4.7.2}/src/xython/locales_loader.py +0 -0
  12. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_auto.py +0 -0
  13. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_chrome.py +0 -0
  14. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_color.py +0 -0
  15. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_common.py +0 -0
  16. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_db.py +0 -0
  17. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_edge.py +0 -0
  18. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_excel_event.py +0 -0
  19. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_hwp.py +0 -0
  20. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_list.py +0 -0
  21. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_manual.py +0 -0
  22. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_map.py +0 -0
  23. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_outlook.py +0 -0
  24. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_re.py +0 -0
  25. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_time.py +0 -0
  26. {xython-4.7.1 → xython-4.7.2}/src/xython/xy_word.py +0 -0
  27. {xython-4.7.1 → xython-4.7.2}/src/xython.egg-info/SOURCES.txt +0 -0
  28. {xython-4.7.1 → xython-4.7.2}/src/xython.egg-info/dependency_links.txt +0 -0
  29. {xython-4.7.1 → xython-4.7.2}/src/xython.egg-info/requires.txt +0 -0
  30. {xython-4.7.1 → xython-4.7.2}/src/xython.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xython
3
- Version: 4.7.1
3
+ Version: 4.7.2
4
4
  Summary: xython package
5
5
  Author-email: "SJ.Park" <sjpkorea@naver.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xython"
7
- version = "4.7.1"
7
+ version = "4.7.2"
8
8
  description = "xython package"
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  requires-python = ">=3.8"
@@ -908,14 +908,14 @@ class xy_excel:
908
908
  else:
909
909
  sheet.AutoFilterMode = False
910
910
 
911
- def autofilter_with_option(self, sheet_name, xyxy, y_line=3, operator="or",
911
+ def autofilter_with_option(self, sheet_name, xyxy, yline=3, operator="or",
912
912
  input_value1="123", input_value2="있음"):
913
913
  """조건을 지정한 자동필터를 적용한다.
914
914
  operator: and/or(값 두 개 조건), top10/bottom10/top10%/bottom10%,
915
915
  value(값 일치, 빈 값 'empty' / 비어있지 않음 'not empty' 가능, 리스트면 여러 값),
916
916
  cell_color/font_color(색 이름·hex·rgb 모두 가능),
917
917
  icon/dynamic (input_value1에 엑셀 상수를 직접 전달)
918
- y_line: 필터 범위 안에서의 열 번호(1부터)"""
918
+ yline: 필터 범위 안에서의 열 번호(1부터)"""
919
919
  op_no = _FILTER_OPERATORS.get(operator)
920
920
  if op_no is None:
921
921
  raise ValueError(f"지원하지 않는 operator: {operator!r} (가능: {sorted(_FILTER_OPERATORS)})")
@@ -924,7 +924,7 @@ class xy_excel:
924
924
  if not rng.Worksheet.AutoFilterMode: # 기존 필터 조건을 지우지 않도록 켜져 있으면 건드리지 않는다
925
925
  rng.AutoFilter()
926
926
 
927
- kwargs = {"Field": y_line}
927
+ kwargs = {"Field": yline}
928
928
  if op_no in (1, 2): # and / or
929
929
  kwargs.update(Criteria1=input_value1, Criteria2=input_value2, Operator=op_no)
930
930
  elif op_no in (3, 4, 5, 6): # 상위/하위 N개, N%
@@ -1968,7 +1968,7 @@ class xy_excel:
1968
1968
  return None # 열이 전혀 겹치지 않음
1969
1969
  return [xyxy1[0], c1, xyxy1[2], c2]
1970
1970
 
1971
- def concate_xline(self, input_l2d, xy):
1971
+ def concat_xline(self, input_l2d, xy):
1972
1972
  """선택한 영역의 세로 자료들을 다 더해서 제일위의 셀에 다시 넣는것 """
1973
1973
  x_len = len(input_l2d)
1974
1974
  y_len = len(input_l2d[0])
@@ -2176,9 +2176,9 @@ class xy_excel:
2176
2176
  sheet1, [x11, y11, x12, y12], rng1 = self._check_sheet_n_xyxy(sheet_name1, xyxy1)
2177
2177
  sheet2, [x21, y21, x22, y22], rng2 = self._check_sheet_n_xyxy(sheet_name2, xyxy2)
2178
2178
 
2179
- l2d_formular = self.utilx.change_same_len_for_l2d(rng1.Formular)
2179
+ l2d_formula = self.utilx.change_same_len_for_l2d(rng1.formula)
2180
2180
 
2181
- for ix, l1d in enumerate(l2d_formular):
2181
+ for ix, l1d in enumerate(l2d_formula):
2182
2182
  temp = []
2183
2183
  for iy, one in enumerate(l1d):
2184
2184
  if isinstance(one, str) and one.startswith("="):
@@ -2203,7 +2203,7 @@ class xy_excel:
2203
2203
  for ix, l1d in enumerate(l2d_xy):
2204
2204
  self.copy_to_another_sheet(sheet_name,l1d,sheet_name,[l1d[0] +xy_offset[0],l1d[1]+xy_offset[1]])
2205
2205
 
2206
- def copy_n_paste_formular_only(self, copy_sheet, copy_xyxy, paste_sheet, paste_xyxy):
2206
+ def copy_n_paste_formula_only(self, copy_sheet, copy_xyxy, paste_sheet, paste_xyxy):
2207
2207
  """어떤 영역안의 숫기만 다른 영역에 복사 """
2208
2208
  self.copy(copy_sheet, copy_xyxy)
2209
2209
  self.paste_format_only(paste_sheet, paste_xyxy)
@@ -2820,7 +2820,7 @@ class xy_excel:
2820
2820
  for ix, no in enumerate(range(x1, x2 + 1, step_no)):
2821
2821
  sheet.Rows(str(no) + ':' + str(no)).ClearContents()
2822
2822
 
2823
- def delete_value_for_xline_when_same_multi_y_lines(self, sheet_name, xyxy, input_no_list=None):
2823
+ def delete_value_for_xline_when_same_multi_ylines(self, sheet_name, xyxy, input_no_list=None):
2824
2824
  """2차원의 자료에서 여러 y줄의 값이같을때 제일 처음의것만 남기고 나머지는 줄을 전체를 삭제하는것 """
2825
2825
  sheet, [x1, y1, x2, y2], rng = self._check_sheet_n_xyxy(sheet_name, xyxy)
2826
2826
  l2d = self.utilx.change_any_data_to_l2d(rng.Value)
@@ -2925,7 +2925,7 @@ class xy_excel:
2925
2925
  result.append(l1d)
2926
2926
  return result
2927
2927
 
2928
- def delete_xline_value_when_same_multi_y_lines(self, sheet_name, xyxy, input_no_list):
2928
+ def delete_xline_value_when_same_multi_ylines(self, sheet_name, xyxy, input_no_list):
2929
2929
  sheet, [x1, y1, x2, y2], rng = self._check_sheet_n_xyxy(sheet_name, xyxy)
2930
2930
  l2d = self.read(sheet_name, xyxy)
2931
2931
  unique_l2d = self.get_unique_columns_basic(l2d, input_no_list)
@@ -2939,7 +2939,7 @@ class xy_excel:
2939
2939
  sheet.Rows(str(ix + x1) + ':' + str(ix + x1)).ClearContents()
2940
2940
  found_count = found_count + 1
2941
2941
 
2942
- def delete_xline_when_same_multi_y_line_value(self, sheet_name, xyxy, input_no_list=None):
2942
+ def delete_xline_when_same_multi_yline_value(self, sheet_name, xyxy, input_no_list=None):
2943
2943
  """2차원의 자료에서 여러 y줄의 값이 제일위의것과 같은 줄을 전체를 삭제하는것 """
2944
2944
  sheet, [x1, y1, x2, y2], rng = self._check_sheet_n_xyxy(sheet_name, xyxy)
2945
2945
  l2d = self.utilx.change_any_data_to_l2d(rng.Value)
@@ -2952,7 +2952,7 @@ class xy_excel:
2952
2952
  if top_line == changed_l1d:
2953
2953
  sheet.Rows(str(ix + x1) + ':' + str(ix + x1)).ClearContents()
2954
2954
 
2955
- def delete_xline_when_same_multi_y_lines(self, sheet_name='', xyxy='', input_no_list=None):
2955
+ def delete_xline_when_same_multi_ylines(self, sheet_name='', xyxy='', input_no_list=None):
2956
2956
  """
2957
2957
  여러줄의 값이 같은것만 삭제하는것
2958
2958
  [1, 3, 5]값이 다 같은 것만 삭제하는것
@@ -3432,7 +3432,7 @@ class xy_excel:
3432
3432
  except Exception:
3433
3433
  return []
3434
3434
 
3435
- def get_address_for_formular_cell_in_area(self, sheet_name, xyxy):
3435
+ def get_address_for_formula_cell_in_area(self, sheet_name, xyxy):
3436
3436
  #수식이 있는 셀들만 주소를 갖고오는것
3437
3437
 
3438
3438
  result=[]
@@ -4873,13 +4873,13 @@ class xy_excel:
4873
4873
  sheet, [x1, y1, x2, y2], rng = self._check_sheet_n_xyxy(sheet_name, [x1, y1, x2, y2])
4874
4874
  rng.Insert()
4875
4875
 
4876
- @alias('set_interactive_off')
4877
- def interactive_off(self):
4876
+ @alias('interactive_off')
4877
+ def set_interactive_off(self):
4878
4878
  """자료가 변경이되면 차트등이 연결되서 실행되는것을 interactive라고 한다 """
4879
4879
  self.xlapp.Interactive = False
4880
4880
 
4881
- @alias('set_interactive_on')
4882
- def interactive_on(self):
4881
+ @alias('interactive_on')
4882
+ def set_interactive_on(self):
4883
4883
  """자료가 변경이되면 차트등이 연결되서 실행되는것을 interactive라고 한다 """
4884
4884
  self.xlapp.Interactive = True
4885
4885
 
@@ -5126,7 +5126,7 @@ class xy_excel:
5126
5126
  result = self.utilx.change_l2d_to_text_with_chain_word(l2d, chain_char)
5127
5127
  return result
5128
5128
 
5129
- def make_print_page(self, sheet_name, input_l2d, line_list, start_xy, size_xy, y_line=2, position=3):
5129
+ def make_print_page(self, sheet_name, input_l2d, line_list, start_xy, size_xy, yline=2, position=3):
5130
5130
  """
5131
5131
  input_l2d, 2차원의 기본자료들
5132
5132
  2차원의 자료에서 출력하는 자료들만 순서대로 골라서 새로 만드는 것
@@ -5137,7 +5137,7 @@ class xy_excel:
5137
5137
  new_start_x = start_xy[0]
5138
5138
  new_start_y = start_xy[1]
5139
5139
  for index, l1d in enumerate(changed_input_l2d):
5140
- mok, namuji = divmod(index, y_line)
5140
+ mok, namuji = divmod(index, yline)
5141
5141
  new_start_x = new_start_x + mok * size_xy[0]
5142
5142
  new_start_y = new_start_y + namuji * size_xy[1]
5143
5143
  for index_2, one_value in enumerate(l1d):
@@ -6664,7 +6664,7 @@ class xy_excel:
6664
6664
  my_bar.BarColor.Color = self.colorx.to_rgbint(input_color)
6665
6665
  my_bar.BarBorder.Color.TintAndShade = 0
6666
6666
 
6667
- def paint_differ_value_in_two_range(self, input_l2d_1, input_l2d_2, colored_tf=False):
6667
+ def paint_different_value_in_two_range(self, input_l2d_1, input_l2d_2, colored_tf=False):
6668
6668
  """두개의 리스트가 다른 부분을 찾는데, 기준은 앞의것을 기준으로 한다 """
6669
6669
  sheet = self._check_sheet_name('')
6670
6670
  rgbint = self.colorx.change_any_color_to_rgbint("red++")
@@ -6695,7 +6695,7 @@ class xy_excel:
6695
6695
  self.paint_cell(sheet_name1, [x + x11, y + y11], "yel")
6696
6696
  self.paint_cell(sheet_name2, [x + x21, y + y21], "yel")
6697
6697
 
6698
- def paint_for_differ_value_in_two_range(self, sheet_name, xyxy, input_l2d_1, input_l2d_2, colored_tf=False):
6698
+ def paint_for_different_value_in_two_range(self, sheet_name, xyxy, input_l2d_1, input_l2d_2, colored_tf=False):
6699
6699
  """두개의 리스트가 다른 부분을 찾는데, 기준은 앞의것을 기준으로 한다 """
6700
6700
  sheet = self._check_sheet_name(sheet_name)
6701
6701
  sheet = self._check_sheet_name('')
@@ -6889,8 +6889,8 @@ class xy_excel:
6889
6889
  sheet.Cells(x1,y1).Select()
6890
6890
  sheet.Paste()
6891
6891
 
6892
- @alias('set_pattern')
6893
- def pattern(self, sheet_name='', xyxy='', input_list=[]):
6892
+ @alias('pattern')
6893
+ def set_pattern(self, sheet_name='', xyxy='', input_list=[]):
6894
6894
  """
6895
6895
  셀에 색상과 특정한 패턴을 집어 넣어서 다른것들과 구분할수가 있다
6896
6896
 
@@ -7017,14 +7017,14 @@ class xy_excel:
7017
7017
  elif position == "right":
7018
7018
  sheet.PageSetup.RightHeader = input_value
7019
7019
 
7020
- def print_label_style(self, sheet_name, xyxy, input_l2d, line_list, start_xy, size_xy, y_line, position):
7020
+ def print_label_style(self, sheet_name, xyxy, input_l2d, line_list, start_xy, size_xy, yline, position):
7021
7021
  sheet = self._check_sheet_name(sheet_name)
7022
7022
  input_l2d = self.utilx.change_any_data_to_l2d(input_l2d)
7023
7023
  line_list = self._check_input_data(line_list)
7024
7024
 
7025
7025
  changed_input_l2d = self.get_ylines_at_l2d(input_l2d, line_list)
7026
7026
  for index, l1d in enumerate(changed_input_l2d):
7027
- new_start_x, new_start_y = self.utilx.new_xy(index, start_xy, size_xy, y_line)
7027
+ new_start_x, new_start_y = self.utilx.new_xy(index, start_xy, size_xy, yline)
7028
7028
  for index_2, one_value in enumerate(l1d):
7029
7029
  sheet.Cells(new_start_x + position[index_2][0], new_start_y + position[index_2][1]).Value = \
7030
7030
  l1d[index_2]
@@ -7465,7 +7465,7 @@ class xy_excel:
7465
7465
  one_dic["value2"] = one_cell.Value2
7466
7466
  one_dic["text"] = one_cell.Text
7467
7467
  one_dic["formula"] = one_cell.Formula
7468
- one_dic["formular1c1"] = one_cell.FormulaR1C1
7468
+ one_dic["formula1c1"] = one_cell.FormulaR1C1
7469
7469
  one_dic["numberformat"] = one_cell.NumberFormat
7470
7470
  temp.append(one_dic)
7471
7471
  result.append(temp)
@@ -7768,8 +7768,8 @@ class xy_excel:
7768
7768
  [x1, y1, x2, y2] = self.change_address_to_xyxy(xyxy)
7769
7769
  self.l1d_xyxy_n_value.append([[x1, y1, x2, y2], input_value])
7770
7770
 
7771
- @alias('set_maxmized_for_screen')
7772
- def screen_maxmized(self):
7771
+ @alias('set_maximized_for_screen')
7772
+ def screen_maximized(self):
7773
7773
  """엑셀화일을 최대화합니다 """
7774
7774
  self.xlapp.WindowState = -4137
7775
7775
 
@@ -7795,19 +7795,6 @@ class xy_excel:
7795
7795
  self.xlapp.ScreenUpdating = False
7796
7796
  self.xlapp.Calculation = xlCalculationManual
7797
7797
 
7798
- def scrollbar_for_sheet(self, sheet_name='', xyxy=''):
7799
- """엑셀의 시트에 스크롤바의 형태를 설정하는 것 """
7800
- sheet = self._check_sheet_name(sheet_name)
7801
- pxywh = self.get_cxy_for_cell(sheet_name, xyxy)
7802
- scrollbar = sheet.Shapes.AddFormControl(Type=8, Left=pxywh[0], Top=pxywh[1], Width=pxywh[2],
7803
- Height=pxywh[3])
7804
- scrollbar.Name = "abc_1"
7805
- scrollbar.ControlFormat.Value = 4
7806
- scrollbar.ControlFormat.Min = 0
7807
- scrollbar.ControlFormat.Max = 359
7808
- scrollbar.ControlFormat.SmallChange = 1
7809
- scrollbar.ControlFormat.LargeChange = 10
7810
- scrollbar.ControlFormat.LinkedCell = "$A$1"
7811
7798
 
7812
7799
  def search_nth_continious_value(self, input_value, line_no):
7813
7800
  """넘어온 자료중 line_no번째의 연속된 자료가 같은 갯수를 세어서 리스트형태로 돌려주는것 """
@@ -7858,7 +7845,7 @@ class xy_excel:
7858
7845
  @alias("select_from_selection_to_bottom", range_type="bottom")
7859
7846
  @alias("select_currentregion", range_type="currentregion")
7860
7847
  @alias("select_cell", range_type="cell")
7861
- def select_with_optionp(self, sheet_name='', xyxy='', range_type = None):
7848
+ def select_with_option(self, sheet_name='', xyxy='', range_type = None):
7862
7849
  sheet, [x1, y1, x2, y2], rng = self._check_sheet_n_xyxy(sheet_name, xyxy)
7863
7850
  if range_type == "cell":
7864
7851
  sheet.Cells(x1, y1).Select()
@@ -8171,11 +8158,14 @@ class xy_excel:
8171
8158
  self.rng = result[2]
8172
8159
  return self.rng
8173
8160
 
8174
- def set_scrollbar(self, sheet_name):
8175
- """시트의 스크롤바 위치를 지정한다. """
8161
+ @alias('scrollbar_for_sheet')
8162
+ @alias('set_scrollbar', xyxy='')
8163
+ def set_scrollbar_for_sheet(self, sheet_name='', xyxy=''):
8164
+ """엑셀의 시트에 스크롤바의 형태를 설정하는 것 """
8176
8165
  sheet = self._check_sheet_name(sheet_name)
8177
- pxywh = self.get_cxy_for_cell('')
8178
- scrollbar = sheet.Shapes.AddFormControl(Type=8, Left=pxywh[0], Top=pxywh[1], Width=pxywh[2], Height=pxywh[3])
8166
+ pxywh = self.get_cxy_for_cell(sheet_name, xyxy)
8167
+ scrollbar = sheet.Shapes.AddFormControl(Type=8, Left=pxywh[0], Top=pxywh[1], Width=pxywh[2],
8168
+ Height=pxywh[3])
8179
8169
  scrollbar.Name = "abc_1"
8180
8170
  scrollbar.ControlFormat.Value = 4
8181
8171
  scrollbar.ControlFormat.Min = 0
@@ -8425,7 +8415,7 @@ class xy_excel:
8425
8415
  result = check_dic[shape_no]
8426
8416
  return result
8427
8417
 
8428
- def show_excel_data_at_webbrower_with_datatables(self, xyxy, input_filename):
8418
+ def show_excel_data_at_webbrowser_with_datatables(self, xyxy, input_filename):
8429
8419
  """엑셀자료의 형태는 [x좌표, y좌표, 설명, 분류] 또는 [한글주소, "", 설명, 분류] 또는 """
8430
8420
  if not input_filename.endswith(".html"): input_filename = input_filename + ".html"
8431
8421
 
@@ -8214,3 +8214,38 @@ class xy_util():
8214
8214
 
8215
8215
  return results
8216
8216
 
8217
+ def filter_lid_with_option(self, input_l1d, starts_with=None, ends_with=None,
8218
+ contains=None, exclude=True):
8219
+ """
8220
+ 1차원 리스트에서 문자열 패턴에 따라 항목을 포함/제외합니다.
8221
+
8222
+ input_l1d : 필터링할 1차원 리스트
8223
+ starts_with : str or tuple or None 이 문자(들)로 시작하는 항목을 대상
8224
+ ends_with : str or tuple or None 이 문자(들)로 끝나는 항목을 대상
8225
+ contains : str or tuple or None 이 문자(들)를 포함하는 항목을 대상
8226
+ exclude : bool True면 매칭 항목 제외, False면 매칭 항목만 포함
8227
+ """
8228
+ if starts_with is None and ends_with is None and contains is None:
8229
+ return list(input_l1d)
8230
+
8231
+ def contains_any(item, target):
8232
+ if isinstance(target, str):
8233
+ return target in item
8234
+ # tuple/list 등 반복 가능
8235
+ return any(t in item for t in target)
8236
+
8237
+ def is_match(item):
8238
+ if not isinstance(item, str):
8239
+ return False
8240
+ if starts_with is not None and item.startswith(starts_with):
8241
+ return True
8242
+ if ends_with is not None and item.endswith(ends_with):
8243
+ return True
8244
+ if contains is not None and contains_any(item, contains):
8245
+ return True
8246
+ return False
8247
+
8248
+ if exclude:
8249
+ return [x for x in input_l1d if not is_match(x)]
8250
+ else:
8251
+ return [x for x in input_l1d if is_match(x)]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xython
3
- Version: 4.7.1
3
+ Version: 4.7.2
4
4
  Summary: xython package
5
5
  Author-email: "SJ.Park" <sjpkorea@naver.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes