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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.55
3
+ Version: 1.8.57
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -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]]
@@ -8,7 +8,7 @@ def get_pip_name():
8
8
 
9
9
 
10
10
  def get_version():
11
- return '1.8.55'
11
+ return '1.8.57'
12
12
 
13
13
 
14
14
  def print_version():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.55
3
+ Version: 1.8.57
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
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