DataComparerLibrary 0.857__tar.gz → 0.858__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.
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/PKG-INFO +1 -1
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/pyproject.toml +1 -1
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/field.py +47 -44
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/PKG-INFO +1 -1
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/LICENSE.txt +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/README.rst +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/setup.cfg +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/__init__.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datacomparer.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datasorter.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datetimehandler.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/delimitertranslator.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/fileconverter.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/matchstatus.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/report.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/row.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/tools.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/twodarray.py +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/SOURCES.txt +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/dependency_links.txt +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/requires.txt +0 -0
- {datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: DataComparerLibrary
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.858
|
|
4
4
|
Summary: For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module.
|
|
5
5
|
Author-email: René Philip Zuijderduijn <datacomparerlibrary@outlook.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "DataComparerLibrary"
|
|
8
8
|
description = "For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module."
|
|
9
|
-
version = "0.
|
|
9
|
+
version = "0.858"
|
|
10
10
|
dependencies = ["python-dateutil"]
|
|
11
11
|
authors = [{ name = "René Philip Zuijderduijn", email = "datacomparerlibrary@outlook.com" }]
|
|
12
12
|
readme = "README.rst"
|
|
@@ -112,55 +112,22 @@ class Field:
|
|
|
112
112
|
|
|
113
113
|
def __match_data_with_template(self, other_field_data_including_templates):
|
|
114
114
|
equal = True
|
|
115
|
-
|
|
116
|
-
expected_data_including_date_template = None
|
|
117
|
-
expected_data_with_wildcard = None
|
|
118
|
-
skip_exception_rule_used = False
|
|
119
|
-
|
|
120
|
-
if "{SKIP}" in other_field_data_including_templates.upper() or "{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}" in other_field_data_including_templates.upper():
|
|
121
|
-
# Part(s) of the actual data field will be skipped for verification.
|
|
122
|
-
# Replace {SKIP}, ignoring cases, by wildcard *.
|
|
123
|
-
# compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
|
|
124
|
-
# expected_data_with_wildcard = compiled.sub("*", other_field_data_including_templates)
|
|
125
|
-
compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
|
|
126
|
-
compiled2 = re.compile(re.escape("{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}"), re.IGNORECASE)
|
|
127
|
-
expected_data_with_wildcard = compiled2.sub("*", compiled.sub("*", other_field_data_including_templates))
|
|
128
|
-
#
|
|
129
|
-
if fnmatch.fnmatch(self.field_data, expected_data_with_wildcard):
|
|
130
|
-
skip_exception_rule_used = True
|
|
131
115
|
#
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
expected_data_including_date_template = other_field_data_including_templates
|
|
135
|
-
else:
|
|
136
|
-
expected_data_including_date_template = expected_data_with_wildcard
|
|
116
|
+
expected_data_with_skips_replaced = None
|
|
117
|
+
expected_data_with_skips_replaced = Field.__replace_skips(other_field_data_including_templates)
|
|
137
118
|
#
|
|
138
119
|
if "{NOW()" in other_field_data_including_templates.upper():
|
|
139
|
-
|
|
140
|
-
if all([x not in other_field_data_including_templates.upper() for x in matches]):
|
|
141
|
-
equal = False
|
|
142
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "NOW() has been found in expected data field, but format is incorrect.")
|
|
143
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "Colon character ':', sign '+' or '-'' is missing behind NOW().")
|
|
144
|
-
return False
|
|
120
|
+
expected_data_with_nows_replaced = Field.__replace_now(self, expected_data_with_skips_replaced, other_field_data_including_templates)
|
|
145
121
|
#
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
#
|
|
149
|
-
if not fnmatch.fnmatch(self.field_data, expected_data):
|
|
150
|
-
# No match despite using of wildcard(s).
|
|
151
|
-
equal = False
|
|
152
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "Date template format displayed. See also next message line.")
|
|
153
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, expected_data, "There is a difference between actual and expected data.")
|
|
154
|
-
#
|
|
155
|
-
except Exception as exception_message:
|
|
122
|
+
if not fnmatch.fnmatch(self.field_data, expected_data_with_nows_replaced):
|
|
123
|
+
# No match despite using of wildcard(s).
|
|
156
124
|
equal = False
|
|
157
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "
|
|
158
|
-
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data,
|
|
159
|
-
|
|
125
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "Date template format displayed. See also next message line.")
|
|
126
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, expected_data_with_nows_replaced, "There is a difference between actual and expected data.")
|
|
160
127
|
#
|
|
161
128
|
elif "{NOT(" in other_field_data_including_templates.upper():
|
|
162
129
|
try:
|
|
163
|
-
unwanted_expected_data = Field.__get_unwanted_expected_data(
|
|
130
|
+
unwanted_expected_data = Field.__get_unwanted_expected_data(expected_data_with_skips_replaced)
|
|
164
131
|
#
|
|
165
132
|
if self.field_data == unwanted_expected_data:
|
|
166
133
|
# Unwanted match.
|
|
@@ -173,7 +140,7 @@ class Field:
|
|
|
173
140
|
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, exception_message)
|
|
174
141
|
#
|
|
175
142
|
else:
|
|
176
|
-
if
|
|
143
|
+
if expected_data_with_skips_replaced == other_field_data_including_templates:
|
|
177
144
|
# No exceptions.
|
|
178
145
|
equal = False
|
|
179
146
|
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, other_field_data_including_templates, "There is a difference between actual and expected data. No exception rule has been used.")
|
|
@@ -181,6 +148,44 @@ class Field:
|
|
|
181
148
|
return equal
|
|
182
149
|
|
|
183
150
|
|
|
151
|
+
@staticmethod
|
|
152
|
+
def __replace_skips(field_data):
|
|
153
|
+
field_data_with_skips_replaced_by_wildcard = None
|
|
154
|
+
#
|
|
155
|
+
if "{SKIP}" in field_data.upper() or "{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}" in field_data.upper():
|
|
156
|
+
# Part(s) of the actual data field will be skipped for verification.
|
|
157
|
+
# Replace {SKIP}, ignoring cases, by wildcard *.
|
|
158
|
+
# compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
|
|
159
|
+
# field_data_with_wildcard = compiled.sub("*", field_data)
|
|
160
|
+
compiled = re.compile(re.escape("{SKIP}"), re.IGNORECASE)
|
|
161
|
+
compiled2 = re.compile(re.escape("{DATETIME_FORMAT():YYYYMMDDHHMMSSFF6}"), re.IGNORECASE)
|
|
162
|
+
field_data_with_skips_replaced_by_wildcard = compiled2.sub("*", compiled.sub("*", field_data))
|
|
163
|
+
#
|
|
164
|
+
if field_data_with_skips_replaced_by_wildcard == None:
|
|
165
|
+
# No {SKIP}'s found.
|
|
166
|
+
field_data_with_skips_replaced_by_wildcard = field_data
|
|
167
|
+
return field_data_with_skips_replaced_by_wildcard
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def __replace_now(self, converted_expected_field_data, original_expected_field_data):
|
|
171
|
+
while "{NOW()" in converted_expected_field_data.upper():
|
|
172
|
+
matches = ["{NOW():", "{NOW()+", "{NOW()-"]
|
|
173
|
+
if all([x not in converted_expected_field_data.upper() for x in matches]):
|
|
174
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, original_expected_field_data, "NOW() has been found in expected data field, but format is incorrect.")
|
|
175
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, original_expected_field_data, "Colon character ':', sign '+' or '-'' is missing behind NOW().")
|
|
176
|
+
break
|
|
177
|
+
#
|
|
178
|
+
try:
|
|
179
|
+
converted_expected_field_data = DatetimeHandler.replace_date_template_in_expected_data(self, converted_expected_field_data)
|
|
180
|
+
#
|
|
181
|
+
except Exception as exception_message:
|
|
182
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, original_expected_field_data, "NOW() has been found in expected data field, but format is incorrect.")
|
|
183
|
+
Report.show_differences_comparation_result(self.row_nr, self.column_nr, self.field_data, original_expected_field_data, exception_message)
|
|
184
|
+
break
|
|
185
|
+
#
|
|
186
|
+
return converted_expected_field_data
|
|
187
|
+
|
|
188
|
+
|
|
184
189
|
@staticmethod
|
|
185
190
|
def __get_unwanted_expected_data(expected_data_field_including_date_template):
|
|
186
191
|
position_open_brace = expected_data_field_including_date_template.find("{NOT(")
|
|
@@ -199,5 +204,3 @@ class Field:
|
|
|
199
204
|
if Tools.is_integer(unwanted_expected_data):
|
|
200
205
|
unwanted_expected_data = int(unwanted_expected_data)
|
|
201
206
|
return unwanted_expected_data
|
|
202
|
-
|
|
203
|
-
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: DataComparerLibrary
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.858
|
|
4
4
|
Summary: For comparing csv-files, 2d-array with a csv-file or 2d-arrays. For comparing text-files, text variable with a text-file or text variables. Including a sorting module.
|
|
5
5
|
Author-email: René Philip Zuijderduijn <datacomparerlibrary@outlook.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datacomparer.py
RENAMED
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datasorter.py
RENAMED
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/datetimehandler.py
RENAMED
|
File without changes
|
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/fileconverter.py
RENAMED
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/matchstatus.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary/twodarray.py
RENAMED
|
File without changes
|
{datacomparerlibrary-0.857 → datacomparerlibrary-0.858}/src/DataComparerLibrary.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|