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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: knify
3
- Version: 1.8.49
3
+ Version: 1.8.51
4
4
  Summary: Development tools for python
5
5
  Home-page: https://github.com/qicongsheng/knify
6
6
  Author: qicongsheng
@@ -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, skip_rows: int = 0):
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 < skip_rows:
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
@@ -8,7 +8,7 @@ def get_pip_name():
8
8
 
9
9
 
10
10
  def get_version():
11
- return '1.8.49'
11
+ return '1.8.51'
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.49
3
+ Version: 1.8.51
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