pjdev-sqlmodel 4.3.3__tar.gz → 4.3.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pjdev-sqlmodel
3
- Version: 4.3.3
3
+ Version: 4.3.4
4
4
  Project-URL: Documentation, https://gitlab.purplejay.net/keystone/python
5
5
  Project-URL: Issues, https://gitlab.purplejay.net/keystone/python/issues
6
6
  Project-URL: Source, https://gitlab.purplejay.net/keystone/python
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2024-present Chris O'Neill <chris@purplejay.io>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "4.3.3"
4
+ __version__ = "4.3.4"
@@ -38,12 +38,14 @@ def get_csv_columns(file_path):
38
38
  return header
39
39
 
40
40
 
41
- def get_excel_columns(file_path, header_ndx: int = 1, col_range: Optional[str] = None):
41
+ def get_excel_columns(file_path, header_ndx: int = 1, col_range: Optional[str] = None, sheet_name: str | int = 0):
42
42
  with warnings.catch_warnings():
43
43
  warnings.filterwarnings("ignore")
44
44
  wb = load_workbook(filename=file_path, read_only=True)
45
45
 
46
- sheet = wb.active
46
+
47
+ # TODO: need to ensure that sending an int will work
48
+ sheet = wb[sheet_name] if sheet_name else wb.active
47
49
 
48
50
  if col_range is not None:
49
51
  return [c.value for c in [row for row in sheet[col_range]][0]]
@@ -99,7 +101,7 @@ def load_excel_data(
99
101
  for f in data_files
100
102
  if f.name.endswith(".xlsx")
101
103
  and len(
102
- set(cols).difference(set(get_excel_columns(f, header_ndx + 1, col_range)))
104
+ set(cols).difference(set(get_excel_columns(f, header_ndx + 1, col_range, sheet_name=sheet_name)))
103
105
  )
104
106
  == 0
105
107
  ]
File without changes