knify 1.8.55__tar.gz → 1.8.57__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {knify-1.8.55 → knify-1.8.57}/PKG-INFO +1 -1
- {knify-1.8.55 → knify-1.8.57}/knify/excelutil.py +9 -2
- {knify-1.8.55 → knify-1.8.57}/knify/help.py +1 -1
- {knify-1.8.55 → knify-1.8.57}/knify.egg-info/PKG-INFO +1 -1
- {knify-1.8.55 → knify-1.8.57}/LICENSE +0 -0
- {knify-1.8.55 → knify-1.8.57}/README.md +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/__init__.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/dateutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/fileutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/listutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/logger.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/objutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/threadutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify/warnutil.py +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify.egg-info/SOURCES.txt +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify.egg-info/dependency_links.txt +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify.egg-info/requires.txt +0 -0
- {knify-1.8.55 → knify-1.8.57}/knify.egg-info/top_level.txt +0 -0
- {knify-1.8.55 → knify-1.8.57}/setup.cfg +0 -0
- {knify-1.8.55 → knify-1.8.57}/setup.py +0 -0
@@ -46,11 +46,12 @@ class HeaderBuilder:
|
|
46
46
|
return self.headers
|
47
47
|
|
48
48
|
|
49
|
-
def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header] | None = None, start_row: int = 1
|
49
|
+
def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header] | None = None, start_row: int = 1,
|
50
|
+
header_row: int = 0) -> list[object]:
|
50
51
|
results = []
|
51
52
|
workbook = load_workbook(filename=file_path)
|
52
53
|
sheet_ = workbook[sheet] if isinstance(sheet, str) else workbook[workbook.sheetnames[sheet]]
|
53
|
-
headers_ = [cell.value for cell in sheet_[1]]
|
54
|
+
headers_ = [cell.value for cell in sheet_[header_row + 1]]
|
54
55
|
for row_idx, row in enumerate(sheet_.rows):
|
55
56
|
if row_idx < start_row:
|
56
57
|
continue
|
@@ -72,3 +73,9 @@ def read_excel(file_path: str, sheet: str | int | None = 0, headers: list[Header
|
|
72
73
|
if objutil.has_keys(result):
|
73
74
|
results.append(result)
|
74
75
|
return results
|
76
|
+
|
77
|
+
|
78
|
+
def read_headers(file_path: str, sheet: str | int | None = 0, header_row: int = 0):
|
79
|
+
workbook = load_workbook(filename=file_path)
|
80
|
+
sheet_ = workbook[sheet] if isinstance(sheet, str) else workbook[workbook.sheetnames[sheet]]
|
81
|
+
return [cell.value for cell in sheet_[header_row + 1]]
|
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
|