excel-list-transform 0.7.6__tar.gz → 0.7.7__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 (39) hide show
  1. {excel_list_transform-0.7.6/excel_list_transform.egg-info → excel_list_transform-0.7.7}/PKG-INFO +7 -6
  2. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/README.md +3 -3
  3. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/README_pypi.md +4 -3
  4. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7/excel_list_transform.egg-info}/PKG-INFO +7 -6
  5. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/excel_list_transform.egg-info/requires.txt +1 -1
  6. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/pyproject.toml +2 -2
  7. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/setup.py +3 -3
  8. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/generate_cfg.py +41 -106
  9. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/LICENSE.txt +0 -0
  10. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/excel_list_transform.egg-info/SOURCES.txt +0 -0
  11. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/excel_list_transform.egg-info/dependency_links.txt +0 -0
  12. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/excel_list_transform.egg-info/top_level.txt +0 -0
  13. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/setup.cfg +0 -0
  14. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/__init__.py +0 -0
  15. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/__main__.py +0 -0
  16. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/check_indata_common.py +0 -0
  17. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/commontypes.py +0 -0
  18. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config.py +0 -0
  19. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config_enums.py +0 -0
  20. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config_excel_list_transform.py +0 -0
  21. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config_factory.py +0 -0
  22. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config_xls_list_refmt_name.py +0 -0
  23. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/config_xls_list_refmt_num.py +0 -0
  24. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/file_extension.py +0 -0
  25. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/file_must_exist.py +0 -0
  26. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/generate_txt.py +0 -0
  27. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/handle_csv.py +0 -0
  28. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/handle_empty_column.py +0 -0
  29. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/handle_excel.py +0 -0
  30. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/num_named_conversion.py +0 -0
  31. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/py.typed +0 -0
  32. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/recode.py +0 -0
  33. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/rewrite_value.py +0 -0
  34. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/str_to_enum.py +0 -0
  35. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/transform_cmd.py +0 -0
  36. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/transform_func.py +0 -0
  37. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/transform_func_common.py +0 -0
  38. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/transform_func_named.py +0 -0
  39. {excel_list_transform-0.7.6 → excel_list_transform-0.7.7}/src/excel_list_transform/transform_func_num.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: excel-list-transform
3
- Version: 0.7.6
3
+ Version: 0.7.7
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>
@@ -8,7 +8,7 @@ Project-URL: Source code, https://bitbucket.org/tom-bjorkholm/excel-list-transfo
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.13.2
11
+ Requires-Python: >=3.13.3
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE.txt
14
14
  Requires-Dist: openpyxl>=3.1.5
@@ -16,7 +16,7 @@ Requires-Dist: types-openpyxl>=3.1.5.20250306
16
16
  Requires-Dist: pylightxl>=1.61
17
17
  Requires-Dist: XlsxWriter>=3.2.2
18
18
  Requires-Dist: pip>=25.0.1
19
- Requires-Dist: setuptools>=77.0.3
19
+ Requires-Dist: setuptools>=78.1.0
20
20
  Requires-Dist: build>=1.2.2.post1
21
21
  Requires-Dist: wheel>=0.45.1
22
22
  Dynamic: author
@@ -48,19 +48,19 @@ How this is done is governed by a configuration file. The application can create
48
48
 
49
49
  ## Installing it
50
50
 
51
- If you want to use it, install it using pip. A precondition is that you have Python 3.12.6 or newer installed on you computer. (Python version 3.10.5 or newer for version 0.5.)
51
+ If you want to use it, install it using pip. A precondition is that you have Python installed on you computer. See version table below for information on needed Python version.
52
52
  Python can be downloaded from [https://www.python.org/downloads/](https://www.python.org/downloads/).
53
53
 
54
54
  ### Installing on mac and Linux
55
55
 
56
56
  ````sh
57
- pip3 install excel-list-transform
57
+ pip3 install --upgrade excel-list-transform
58
58
  ````
59
59
 
60
60
  ### Installing on Microsoft Windows
61
61
 
62
62
  ````sh
63
- pip install excel-list-transform
63
+ pip install --upgrade excel-list-transform
64
64
  ````
65
65
 
66
66
  ## Version history
@@ -75,6 +75,7 @@ pip install excel-list-transform
75
75
  | 0.7.3 | 06 Jan 2025 | 3.12.6 or newer | Example config for Sailwave to RRS |
76
76
  | 0.7.5 | 21 Mar 2025 | 3.12.6 or newer | Example config for Sailarena to RRS |
77
77
  | 0.7.6 | 21 Mar 2025 | 3.13.2 or newer | Adapted to Python 3.13.2 |
78
+ | 0.7.7 | 09 Apr 2025 | 3.13.3 or newer | refactor phone number rewrite cfg |
78
79
 
79
80
  ## Running the application
80
81
 
@@ -11,13 +11,13 @@ If you want to use it install it using pip from [https://pypi.org/project/excel-
11
11
  ### Installing on mac and Linux
12
12
 
13
13
  ````
14
- pip3 install excel-list-transform
14
+ pip3 install --upgrade excel-list-transform
15
15
  ````
16
16
 
17
17
  ### Installing on Microsoft Windows
18
18
 
19
19
  ````
20
- pip install excel-list-transform
20
+ pip install --upgrade excel-list-transform
21
21
  ````
22
22
 
23
23
  ### Information for use
@@ -50,7 +50,7 @@ For running the script and running the test suite you need a mac or a Linux comp
50
50
 
51
51
  #### Python version
52
52
 
53
- The tests and the script for running the tests, coverage, mypy etc. requires Python version 3.12.6 or newer.
53
+ Please see README_pypi.md for information on needed python version.
54
54
 
55
55
  #### Zsh
56
56
 
@@ -22,19 +22,19 @@ How this is done is governed by a configuration file. The application can create
22
22
 
23
23
  ## Installing it
24
24
 
25
- If you want to use it, install it using pip. A precondition is that you have Python 3.12.6 or newer installed on you computer. (Python version 3.10.5 or newer for version 0.5.)
25
+ If you want to use it, install it using pip. A precondition is that you have Python installed on you computer. See version table below for information on needed Python version.
26
26
  Python can be downloaded from [https://www.python.org/downloads/](https://www.python.org/downloads/).
27
27
 
28
28
  ### Installing on mac and Linux
29
29
 
30
30
  ````sh
31
- pip3 install excel-list-transform
31
+ pip3 install --upgrade excel-list-transform
32
32
  ````
33
33
 
34
34
  ### Installing on Microsoft Windows
35
35
 
36
36
  ````sh
37
- pip install excel-list-transform
37
+ pip install --upgrade excel-list-transform
38
38
  ````
39
39
 
40
40
  ## Version history
@@ -49,6 +49,7 @@ pip install excel-list-transform
49
49
  | 0.7.3 | 06 Jan 2025 | 3.12.6 or newer | Example config for Sailwave to RRS |
50
50
  | 0.7.5 | 21 Mar 2025 | 3.12.6 or newer | Example config for Sailarena to RRS |
51
51
  | 0.7.6 | 21 Mar 2025 | 3.13.2 or newer | Adapted to Python 3.13.2 |
52
+ | 0.7.7 | 09 Apr 2025 | 3.13.3 or newer | refactor phone number rewrite cfg |
52
53
 
53
54
  ## Running the application
54
55
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: excel-list-transform
3
- Version: 0.7.6
3
+ Version: 0.7.7
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>
@@ -8,7 +8,7 @@ Project-URL: Source code, https://bitbucket.org/tom-bjorkholm/excel-list-transfo
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.13.2
11
+ Requires-Python: >=3.13.3
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE.txt
14
14
  Requires-Dist: openpyxl>=3.1.5
@@ -16,7 +16,7 @@ Requires-Dist: types-openpyxl>=3.1.5.20250306
16
16
  Requires-Dist: pylightxl>=1.61
17
17
  Requires-Dist: XlsxWriter>=3.2.2
18
18
  Requires-Dist: pip>=25.0.1
19
- Requires-Dist: setuptools>=77.0.3
19
+ Requires-Dist: setuptools>=78.1.0
20
20
  Requires-Dist: build>=1.2.2.post1
21
21
  Requires-Dist: wheel>=0.45.1
22
22
  Dynamic: author
@@ -48,19 +48,19 @@ How this is done is governed by a configuration file. The application can create
48
48
 
49
49
  ## Installing it
50
50
 
51
- If you want to use it, install it using pip. A precondition is that you have Python 3.12.6 or newer installed on you computer. (Python version 3.10.5 or newer for version 0.5.)
51
+ If you want to use it, install it using pip. A precondition is that you have Python installed on you computer. See version table below for information on needed Python version.
52
52
  Python can be downloaded from [https://www.python.org/downloads/](https://www.python.org/downloads/).
53
53
 
54
54
  ### Installing on mac and Linux
55
55
 
56
56
  ````sh
57
- pip3 install excel-list-transform
57
+ pip3 install --upgrade excel-list-transform
58
58
  ````
59
59
 
60
60
  ### Installing on Microsoft Windows
61
61
 
62
62
  ````sh
63
- pip install excel-list-transform
63
+ pip install --upgrade excel-list-transform
64
64
  ````
65
65
 
66
66
  ## Version history
@@ -75,6 +75,7 @@ pip install excel-list-transform
75
75
  | 0.7.3 | 06 Jan 2025 | 3.12.6 or newer | Example config for Sailwave to RRS |
76
76
  | 0.7.5 | 21 Mar 2025 | 3.12.6 or newer | Example config for Sailarena to RRS |
77
77
  | 0.7.6 | 21 Mar 2025 | 3.13.2 or newer | Adapted to Python 3.13.2 |
78
+ | 0.7.7 | 09 Apr 2025 | 3.13.3 or newer | refactor phone number rewrite cfg |
78
79
 
79
80
  ## Running the application
80
81
 
@@ -3,6 +3,6 @@ types-openpyxl>=3.1.5.20250306
3
3
  pylightxl>=1.61
4
4
  XlsxWriter>=3.2.2
5
5
  pip>=25.0.1
6
- setuptools>=77.0.3
6
+ setuptools>=78.1.0
7
7
  build>=1.2.2.post1
8
8
  wheel>=0.45.1
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "excel-list-transform"
7
- version = "0.7.6"
7
+ version = "0.7.7"
8
8
  authors = [
9
9
  { name="Tom Björkholm", email="klausuler_linnet0q@icloud.com" },
10
10
  ]
11
11
  description = "Transform a list in excel or CSV"
12
12
  readme = "README_pypi.md"
13
- requires-python = ">=3.13.2"
13
+ requires-python = ">=3.13.3"
14
14
  classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
16
  "License :: OSI Approved :: MIT License",
@@ -5,11 +5,11 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='excel-list-transform',
8
- version='0.7.6',
8
+ version='0.7.7',
9
9
  description='Transform a list in excel or CSV.',
10
10
  author='Tom Björkholm',
11
11
  author_email='klausuler_linnet0q@icloud.com',
12
- python_requires='>=3.13.2',
12
+ python_requires='>=3.13.3',
13
13
  packages=['excel_list_transform'],
14
14
  package_dir={'excel_list_transform': 'src/excel_list_transform'},
15
15
  package_data={'excel_list_transform': ['src/py.typed']},
@@ -19,7 +19,7 @@ setup(
19
19
  'pylightxl >= 1.61',
20
20
  'XlsxWriter >= 3.2.2',
21
21
  'pip >= 25.0.1',
22
- 'setuptools >= 77.0.3',
22
+ 'setuptools >= 78.1.0',
23
23
  'build >= 1.2.2.post1',
24
24
  'wheel>=0.45.1'
25
25
  ]
@@ -4,12 +4,14 @@
4
4
  # Copyright (c) 2024 Tom Björkholm
5
5
  # MIT License
6
6
 
7
-
7
+ from copy import deepcopy
8
8
  from excel_list_transform.file_extension import fix_file_extension
9
9
  from excel_list_transform.config_enums import ColumnRef, FileType, \
10
10
  RewriteKind, CaseSensitivity, ExcelLib, SplitWhere
11
11
  from excel_list_transform.config_factory import config_factory_from_enum
12
12
  from excel_list_transform.generate_txt import generate_syntax_txt
13
+ from excel_list_transform.config_excel_list_transform import \
14
+ Column, SingleRuleRewrite, RuleRewrite
13
15
  from excel_list_transform.config_xls_list_refmt_name import \
14
16
  ConfigXlsListRefmtName
15
17
  from excel_list_transform.config_xls_list_refmt_num import \
@@ -88,6 +90,36 @@ format of the phone number and save to excel.
88
90
  ''' + syntax_phone_fix
89
91
 
90
92
 
93
+ def rewrite_phone_46_cfg(cfg: ConfigXlsListRefmtName | ConfigXlsListRefmtNum,
94
+ column: Column, append: bool) -> None:
95
+ """Add configuration to rewrite +46 phone numbers."""
96
+ assert (isinstance(cfg, ConfigXlsListRefmtName) and
97
+ isinstance(column, str)) or \
98
+ (isinstance(cfg, ConfigXlsListRefmtNum) and
99
+ isinstance(column, int))
100
+ assert isinstance(append, bool)
101
+ rules: RuleRewrite[Column] = [
102
+ {'kind': RewriteKind.STRIP,
103
+ 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
104
+ {'kind': RewriteKind.REMOVECHARS,
105
+ 'chars': [' ', '-', '(', ')'], 'case': CaseSensitivity.MATCH_CASE},
106
+ {'kind': RewriteKind.REGEX_SUBSTITUTE,
107
+ 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
108
+ {'kind': RewriteKind.REGEX_SUBSTITUTE,
109
+ 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
110
+ {'kind': RewriteKind.REGEX_SUBSTITUTE,
111
+ 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
112
+ {'kind': RewriteKind.REGEX_SUBSTITUTE,
113
+ 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}
114
+ ]
115
+ if not append:
116
+ cfg.s7_rewrite_columns.clear()
117
+ for rule in rules:
118
+ newrule: SingleRuleRewrite[Column] = deepcopy(rule)
119
+ newrule['column'] = column
120
+ cfg.s7_rewrite_columns.append(newrule)
121
+
122
+
91
123
  def generate_syntax_sa2r_name(filename: str, colref: ColumnRef) -> None:
92
124
  """Generate config example for sa_to_rrs."""
93
125
  assert colref == ColumnRef.BY_NAME
@@ -105,19 +137,7 @@ def generate_syntax_sa2r_name(filename: str, colref: ColumnRef) -> None:
105
137
  cfg.s3_merge_columns = []
106
138
  cfg.s5_rename_columns = []
107
139
  cfg.s6_insert_columns = []
108
- cfg.s7_rewrite_columns = [
109
- {'column': 'Phone', 'kind': RewriteKind.STRIP,
110
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
111
- {'column': 'Phone', 'kind': RewriteKind.REMOVECHARS,
112
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
113
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
114
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
115
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
116
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
117
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
118
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
119
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
120
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
140
+ rewrite_phone_46_cfg(cfg=cfg, column='Phone', append=False)
121
141
  cfg.s8_column_order = ['Class', 'Division', 'Nationality',
122
142
  'Sail Number', 'Boat Name', 'First Name',
123
143
  'Last Name', 'Club Name', 'Email', 'Phone',
@@ -139,19 +159,7 @@ def generate_syntax_sw2r_name(filename: str, colref: ColumnRef) -> None:
139
159
  cfg.s3_merge_columns = []
140
160
  cfg.s5_rename_columns = [{'column': 'Name', 'name': 'First Name'}]
141
161
  cfg.s6_insert_columns = [{'column': 'WhatsApp', 'value': None}]
142
- cfg.s7_rewrite_columns = [
143
- {'column': 'Phone', 'kind': RewriteKind.STRIP,
144
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
145
- {'column': 'Phone', 'kind': RewriteKind.REMOVECHARS,
146
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
147
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
148
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
149
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
150
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
151
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
152
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
153
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
154
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
162
+ rewrite_phone_46_cfg(cfg=cfg, column='Phone', append=False)
155
163
  cfg.s8_column_order = ['Class', 'Division', 'Nationality',
156
164
  'Sail Number', 'Boat Name', 'First Name',
157
165
  'Last Name', 'Club Name', 'Email', 'Phone',
@@ -182,19 +190,7 @@ def generate_syntax_sa2r_num(filename: str, colref: ColumnRef) -> None:
182
190
  cfg.s4_place_columns_first = []
183
191
  cfg.s5_rename_columns = []
184
192
  cfg.s6_insert_columns = []
185
- cfg.s7_rewrite_columns = [
186
- {'column': 9, 'kind': RewriteKind.STRIP,
187
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
188
- {'column': 9, 'kind': RewriteKind.REMOVECHARS,
189
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
190
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
191
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
192
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
193
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
194
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
195
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
196
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
197
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
193
+ rewrite_phone_46_cfg(cfg=cfg, column=9, append=False)
198
194
  cfg.write(to_json_filename=filename)
199
195
 
200
196
 
@@ -216,19 +212,7 @@ def generate_syntax_sw2r_num(filename: str, colref: ColumnRef) -> None:
216
212
  {'column': 6, 'name': 'Last Name'}]
217
213
  cfg.s6_insert_columns = [{'column': 10, 'name': 'WhatsApp',
218
214
  'value': None}]
219
- cfg.s7_rewrite_columns = [
220
- {'column': 9, 'kind': RewriteKind.STRIP,
221
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
222
- {'column': 9, 'kind': RewriteKind.REMOVECHARS,
223
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
224
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
225
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
226
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
227
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
228
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
229
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
230
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
231
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
215
+ rewrite_phone_46_cfg(cfg=cfg, column=9, append=False)
232
216
  cfg.write(to_json_filename=filename)
233
217
 
234
218
 
@@ -258,19 +242,7 @@ def generate_syntax_o2r_name(filename: str, colref: ColumnRef) -> None:
258
242
  {'column': 'Division', 'value': None},
259
243
  {'column': 'Boat Name', 'value': None},
260
244
  {'column': 'WhatsApp', 'value': None}]
261
- cfg.s7_rewrite_columns = [
262
- {'column': 'Phone', 'kind': RewriteKind.STRIP,
263
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
264
- {'column': 'Phone', 'kind': RewriteKind.REMOVECHARS,
265
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
266
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
267
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
268
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
269
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
270
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
271
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
272
- {'column': 'Phone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
273
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
245
+ rewrite_phone_46_cfg(cfg=cfg, column='Phone', append=False)
274
246
  cfg.s8_column_order = ['Class', 'Division', 'Nationality',
275
247
  'Sail Number', 'Boat Name', 'First Name',
276
248
  'Last Name', 'Club Name', 'Email', 'Phone',
@@ -305,19 +277,7 @@ def generate_syntax_o2r_num(filename: str, colref: ColumnRef) -> None:
305
277
  {'column': 1, 'name': 'Division', 'value': None},
306
278
  {'column': 4, 'name': 'Boat Name', 'value': None},
307
279
  {'column': 10, 'name': 'WhatsApp', 'value': None}]
308
- cfg.s7_rewrite_columns = [
309
- {'column': 9, 'kind': RewriteKind.STRIP,
310
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
311
- {'column': 9, 'kind': RewriteKind.REMOVECHARS,
312
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
313
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
314
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
315
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
316
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
317
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
318
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
319
- {'column': 9, 'kind': RewriteKind.REGEX_SUBSTITUTE,
320
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
280
+ rewrite_phone_46_cfg(cfg=cfg, column=9, append=False)
321
281
  cfg.write(to_json_filename=filename)
322
282
 
323
283
 
@@ -353,20 +313,7 @@ def generate_syntax_o2s_name(filename: str, colref: ColumnRef) -> None:
353
313
  cfg.s6_insert_columns = [
354
314
  {'column': 'Division', 'value': None},
355
315
  {'column': 'Boat', 'value': None}]
356
- cfg.s7_rewrite_columns = [
357
- {'column': 'HelmPhone', 'kind': RewriteKind.STRIP,
358
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
359
- {'column': 'HelmPhone', 'kind': RewriteKind.REMOVECHARS,
360
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
361
- {'column': 'HelmPhone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
362
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
363
- {'column': 'HelmPhone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
364
- 'from': '^\\+4607', 'to': '+467',
365
- 'case': CaseSensitivity.MATCH_CASE},
366
- {'column': 'HelmPhone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
367
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
368
- {'column': 'HelmPhone', 'kind': RewriteKind.REGEX_SUBSTITUTE,
369
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
316
+ rewrite_phone_46_cfg(cfg=cfg, column='HelmPhone', append=False)
370
317
  cfg.s8_column_order = ['Class', 'Division', 'Nat', 'SailNo', 'Boat',
371
318
  'HelmName', 'Club', 'HelmEmail', 'HelmPhone']
372
319
  cfg.write(to_json_filename=filename)
@@ -397,19 +344,7 @@ def generate_syntax_o2s_num(filename: str, colref: ColumnRef) -> None:
397
344
  cfg.s6_insert_columns = [
398
345
  {'column': 1, 'name': 'Division', 'value': None},
399
346
  {'column': 4, 'name': 'Boat', 'value': None}]
400
- cfg.s7_rewrite_columns = [
401
- {'column': 8, 'kind': RewriteKind.STRIP,
402
- 'chars': '', 'case': CaseSensitivity.IGNORE_CASE},
403
- {'column': 8, 'kind': RewriteKind.REMOVECHARS,
404
- 'chars': [' ', '-'], 'case': CaseSensitivity.MATCH_CASE},
405
- {'column': 8, 'kind': RewriteKind.REGEX_SUBSTITUTE,
406
- 'from': '^07', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
407
- {'column': 8, 'kind': RewriteKind.REGEX_SUBSTITUTE,
408
- 'from': '^\\+4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
409
- {'column': 8, 'kind': RewriteKind.REGEX_SUBSTITUTE,
410
- 'from': '^467', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE},
411
- {'column': 8, 'kind': RewriteKind.REGEX_SUBSTITUTE,
412
- 'from': '^4607', 'to': '+467', 'case': CaseSensitivity.MATCH_CASE}]
347
+ rewrite_phone_46_cfg(cfg=cfg, column=8, append=False)
413
348
  cfg.write(to_json_filename=filename)
414
349
 
415
350