excel-list-transform 0.7.0__tar.gz → 0.7.1__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.
Files changed (38) hide show
  1. {excel_list_transform-0.7.0/excel_list_transform.egg-info → excel_list_transform-0.7.1}/PKG-INFO +4 -4
  2. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1/excel_list_transform.egg-info}/PKG-INFO +4 -4
  3. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/excel_list_transform.egg-info/requires.txt +3 -3
  4. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/pyproject.toml +1 -1
  5. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/setup.py +4 -4
  6. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config.py +13 -0
  7. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config_excel_list_transform.py +2 -15
  8. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config_xls_list_refmt_name.py +1 -1
  9. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config_xls_list_refmt_num.py +4 -4
  10. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/LICENSE.txt +0 -0
  11. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/README.md +0 -0
  12. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/README_pypi.md +0 -0
  13. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/excel_list_transform.egg-info/SOURCES.txt +0 -0
  14. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/excel_list_transform.egg-info/dependency_links.txt +0 -0
  15. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/excel_list_transform.egg-info/top_level.txt +0 -0
  16. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/setup.cfg +0 -0
  17. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/__init__.py +0 -0
  18. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/__main__.py +0 -0
  19. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/check_indata_common.py +0 -0
  20. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/commontypes.py +0 -0
  21. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config_enums.py +0 -0
  22. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/config_factory.py +0 -0
  23. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/file_extension.py +0 -0
  24. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/file_must_exist.py +0 -0
  25. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/generate_cfg.py +0 -0
  26. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/generate_txt.py +0 -0
  27. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/handle_csv.py +0 -0
  28. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/handle_empty_column.py +0 -0
  29. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/handle_excel.py +0 -0
  30. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/num_named_conversion.py +0 -0
  31. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/py.typed +0 -0
  32. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/rewrite_value.py +0 -0
  33. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/str_to_enum.py +0 -0
  34. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/transform_cmd.py +0 -0
  35. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/transform_func.py +0 -0
  36. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/transform_func_common.py +0 -0
  37. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/transform_func_named.py +0 -0
  38. {excel_list_transform-0.7.0 → excel_list_transform-0.7.1}/src/excel_list_transform/transform_func_num.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: excel-list-transform
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Transform a list in excel or CSV
5
5
  Author: Tom Björkholm
6
6
  Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
@@ -12,13 +12,13 @@ Requires-Python: >=3.12.6
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE.txt
14
14
  Requires-Dist: openpyxl>=3.1.5
15
- Requires-Dist: types-openpyxl>=3.1.5.20241025
15
+ Requires-Dist: types-openpyxl>=3.1.5.20241126
16
16
  Requires-Dist: pylightxl>=1.61
17
17
  Requires-Dist: XlsxWriter>=3.2.0
18
18
  Requires-Dist: pip>=24.2
19
- Requires-Dist: setuptools>=75.3.0
19
+ Requires-Dist: setuptools>=75.6.0
20
20
  Requires-Dist: build>=1.2.2
21
- Requires-Dist: wheel>=0.44.0
21
+ Requires-Dist: wheel>=0.45.1
22
22
 
23
23
  # excel-list-transform
24
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: excel-list-transform
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Transform a list in excel or CSV
5
5
  Author: Tom Björkholm
6
6
  Author-email: Tom Björkholm <klausuler_linnet0q@icloud.com>
@@ -12,13 +12,13 @@ Requires-Python: >=3.12.6
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE.txt
14
14
  Requires-Dist: openpyxl>=3.1.5
15
- Requires-Dist: types-openpyxl>=3.1.5.20241025
15
+ Requires-Dist: types-openpyxl>=3.1.5.20241126
16
16
  Requires-Dist: pylightxl>=1.61
17
17
  Requires-Dist: XlsxWriter>=3.2.0
18
18
  Requires-Dist: pip>=24.2
19
- Requires-Dist: setuptools>=75.3.0
19
+ Requires-Dist: setuptools>=75.6.0
20
20
  Requires-Dist: build>=1.2.2
21
- Requires-Dist: wheel>=0.44.0
21
+ Requires-Dist: wheel>=0.45.1
22
22
 
23
23
  # excel-list-transform
24
24
 
@@ -1,8 +1,8 @@
1
1
  openpyxl>=3.1.5
2
- types-openpyxl>=3.1.5.20241025
2
+ types-openpyxl>=3.1.5.20241126
3
3
  pylightxl>=1.61
4
4
  XlsxWriter>=3.2.0
5
5
  pip>=24.2
6
- setuptools>=75.3.0
6
+ setuptools>=75.6.0
7
7
  build>=1.2.2
8
- wheel>=0.44.0
8
+ wheel>=0.45.1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "excel-list-transform"
7
- version = "0.7.0"
7
+ version = "0.7.1"
8
8
  authors = [
9
9
  { name="Tom Björkholm", email="klausuler_linnet0q@icloud.com" },
10
10
  ]
@@ -5,7 +5,7 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='excel-list-transform',
8
- version='0.7.0',
8
+ version='0.7.1',
9
9
  description='Transform a list in excel or CSV.',
10
10
  author='Tom Björkholm',
11
11
  author_email='klausuler_linnet0q@icloud.com',
@@ -15,12 +15,12 @@ setup(
15
15
  package_data={'excel_list_transform': ['src/py.typed']},
16
16
  install_requires=[
17
17
  'openpyxl >= 3.1.5',
18
- 'types-openpyxl >= 3.1.5.20241025',
18
+ 'types-openpyxl >= 3.1.5.20241126',
19
19
  'pylightxl >= 1.61',
20
20
  'XlsxWriter >= 3.2.0',
21
21
  'pip >= 24.2',
22
- 'setuptools >= 75.3.0',
22
+ 'setuptools >= 75.6.0',
23
23
  'build >= 1.2.2',
24
- 'wheel>=0.44.0'
24
+ 'wheel>=0.45.1'
25
25
  ]
26
26
  )
@@ -9,6 +9,7 @@ from copy import deepcopy
9
9
  import json
10
10
  import sys
11
11
  import csv
12
+ from collections import Counter
12
13
  from typing import Any, Optional, Type, TypeVar, Mapping, NamedTuple, Callable
13
14
  from enum import Enum, IntEnum
14
15
  from tempfile import TemporaryFile
@@ -394,3 +395,15 @@ class Config():
394
395
  if not Config.valid_char_encoding(enc=enc):
395
396
  print(f'{enc} is not a recognized encoding', file=sys.stderr)
396
397
  sys.exit(1)
398
+
399
+ @staticmethod
400
+ def check_no_duplicates(expanded_data: list[str] | list[int],
401
+ param_name: str) -> None:
402
+ """Error report duplicate data."""
403
+ dup = [str(k) for k, v in Counter(expanded_data).items() if v > 1]
404
+ if len(dup) == 0:
405
+ return
406
+ msg = f'Duplicates not allowed in {param_name}. Duplicate values: ' # noqa: E713, E501
407
+ msg += ','.join(dup)
408
+ print(msg, file=sys.stderr)
409
+ sys.exit(1)
@@ -8,7 +8,6 @@
8
8
  import sys
9
9
  from copy import deepcopy
10
10
  from enum import Enum
11
- from collections import Counter
12
11
  from typing import Optional, Callable, TypeAlias, TypeVar, NamedTuple, Generic
13
12
  from csv import Dialect
14
13
  from excel_list_transform.config import Config, ParseConverter
@@ -150,18 +149,6 @@ class ConfigExcelListTransform(Config, Generic[Column]): # pylint: disable=too-
150
149
  'in_excel_col_name_strip': False,
151
150
  'in_excel_values_strip': False}
152
151
 
153
- @staticmethod
154
- def _duplicates_not_allowed(expanded_data: list[Column],
155
- param_name: str) -> None:
156
- """Error report duplicate data."""
157
- dup = [str(k) for k, v in Counter(expanded_data).items() if v > 1]
158
- if len(dup) == 0:
159
- return
160
- msg = f'Duplicates not allowed in {param_name}. Duplicate values: ' # noqa: E713, E501
161
- msg += ','.join(dup)
162
- print(msg, file=sys.stderr)
163
- raise KeyError(msg)
164
-
165
152
  @staticmethod
166
153
  def get_cols_single(rule: Rule[Column] | RuleSplit[Column] |
167
154
  RuleRewrite[Column],
@@ -192,7 +179,7 @@ class ConfigExcelListTransform(Config, Generic[Column]): # pylint: disable=too-
192
179
  """Flag as error if column is refered to multiple times."""
193
180
  cols: list[Column] = ConfigExcelListTransform.get_cols_single(rule,
194
181
  tinfo)
195
- ConfigExcelListTransform._duplicates_not_allowed(cols, param_name)
182
+ ConfigExcelListTransform.check_no_duplicates(cols, param_name)
196
183
 
197
184
  @staticmethod
198
185
  def _check_no_duplicate_multi(rule: RuleMerge[Column],
@@ -200,7 +187,7 @@ class ConfigExcelListTransform(Config, Generic[Column]): # pylint: disable=too-
200
187
  """Flag as error if column is refered to multiple times."""
201
188
  cols: list[Column] = ConfigExcelListTransform.get_cols_multi(rule,
202
189
  tinfo)
203
- ConfigExcelListTransform._duplicates_not_allowed(cols, param_name)
190
+ ConfigExcelListTransform.check_no_duplicates(cols, param_name)
204
191
 
205
192
  @staticmethod
206
193
  def _check_increasing_multi(rule: RuleMerge[Column], param_name: str,
@@ -37,4 +37,4 @@ class ConfigXlsListRefmtName(ConfigExcelListTransform[str]): # pylint: disable=
37
37
  colinfo=colinfo, tinfo='a',
38
38
  from_json_text=from_json_text,
39
39
  from_json_filename=from_json_filename)
40
- self._duplicates_not_allowed(self.s8_column_order, 's8_column_order')
40
+ self.check_no_duplicates(self.s8_column_order, 's8_column_order')
@@ -51,12 +51,12 @@ class ConfigXlsListRefmtNum(ConfigExcelListTransform[int]): # pylint: disable=t
51
51
  colinfo=colinfo, tinfo=2,
52
52
  from_json_text=from_json_text,
53
53
  from_json_filename=from_json_filename)
54
- self._duplicates_not_allowed(self.s2_remove_columns,
55
- 's2_remove_columns')
54
+ self.check_no_duplicates(self.s2_remove_columns,
55
+ 's2_remove_columns')
56
56
  self._check_increasing_multi(self.s3_merge_columns,
57
57
  's3_merge_columns', 2)
58
- self._duplicates_not_allowed(self.s4_place_columns_first,
59
- 's4_place_columns_first')
58
+ self.check_no_duplicates(self.s4_place_columns_first,
59
+ 's4_place_columns_first')
60
60
 
61
61
  def sort_sx_hook(self) -> None:
62
62
  """Sort s[0-9]_ as needed as needed (hook)."""