knify 1.8.49__tar.gz → 1.8.51__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {knify-1.8.49 → knify-1.8.51}/PKG-INFO +1 -1
- {knify-1.8.49 → knify-1.8.51}/knify/excelutil.py +3 -2
- {knify-1.8.49 → knify-1.8.51}/knify/help.py +1 -1
- {knify-1.8.49 → knify-1.8.51}/knify.egg-info/PKG-INFO +1 -1
- {knify-1.8.49 → knify-1.8.51}/LICENSE +0 -0
- {knify-1.8.49 → knify-1.8.51}/README.md +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/__init__.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/dateutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/fileutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/listutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/logger.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/objutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/threadutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify/warnutil.py +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify.egg-info/SOURCES.txt +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify.egg-info/dependency_links.txt +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify.egg-info/requires.txt +0 -0
- {knify-1.8.49 → knify-1.8.51}/knify.egg-info/top_level.txt +0 -0
- {knify-1.8.49 → knify-1.8.51}/setup.cfg +0 -0
- {knify-1.8.49 → knify-1.8.51}/setup.py +0 -0
@@ -31,13 +31,13 @@ class HeaderBuilder:
|
|
31
31
|
return self.data
|
32
32
|
|
33
33
|
|
34
|
-
def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header] | None = None,
|
34
|
+
def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header] | None = None, start_row: int = 1):
|
35
35
|
results = []
|
36
36
|
workbook = load_workbook(filename=file_path)
|
37
37
|
sheet_ = workbook[sheet] if isinstance(sheet, str) else workbook[workbook.sheetnames[sheet]]
|
38
38
|
headers_ = [cell.value for cell in sheet_[1]]
|
39
39
|
for row_idx, row in enumerate(sheet_.rows):
|
40
|
-
if row_idx <
|
40
|
+
if row_idx < start_row:
|
41
41
|
continue
|
42
42
|
result = {}
|
43
43
|
for header_idx, header_ in enumerate(headers_):
|
@@ -55,5 +55,6 @@ def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header
|
|
55
55
|
cell_value = row[header_idx].value
|
56
56
|
cell_value = cell_value if header.transformer is None else header.transformer(row[header_idx].value)
|
57
57
|
result[col_name] = cell_value
|
58
|
+
if len(result.keys()) > 0:
|
58
59
|
results.append(result)
|
59
60
|
return results
|
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
|