DataComparerLibrary 0.800__tar.gz → 0.810__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.800 → DataComparerLibrary-0.810}/PKG-INFO +4 -2
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/README.rst +3 -1
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary/datacomparer.py +21 -34
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary/version.py +1 -1
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/PKG-INFO +4 -2
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/LICENSE.txt +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/pyproject.toml +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/setup.cfg +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/setup.py +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary/__init__.py +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/SOURCES.txt +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/dependency_links.txt +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/top_level.txt +0 -0
- {DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/test/test1.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DataComparerLibrary
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.810
|
|
4
4
|
Summary: For comparing csv-files or 2d-array with csv-file.
|
|
5
5
|
Home-page:
|
|
6
6
|
Author: René Philip Zuijderduijn
|
|
@@ -62,7 +62,7 @@ current date. At "Examples comparing Actual Data with Expected Data" you can fin
|
|
|
62
62
|
|
|
63
63
|
Delimiter
|
|
64
64
|
Default delimiter is ",". You can use the option "delimiter_actual_data" and "delimiter_expected_data" to set another
|
|
65
|
-
delimiter like ";" or "tab".
|
|
65
|
+
delimiter like ";" or "\t" for tab. It is also possible to use a multi-character delimiter like "@#@".
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
Installation
|
|
@@ -90,6 +90,7 @@ Below there are some examples how to call the methods of the DataComparerLibrary
|
|
|
90
90
|
a = DataComparer
|
|
91
91
|
a.compare_data_files(self, actual_file, expected_file)
|
|
92
92
|
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data=';', delimiter_expected_data=';')
|
|
93
|
+
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data='@#@', delimiter_expected_data='@#@')
|
|
93
94
|
a.compare_data_2d_array_with_file(self, actual_2d_matrix_data_input, expected_file, delimiter_expected_data='\t')
|
|
94
95
|
a.compare_data_file_with_2d_array(self, actual_file, expected_2d_matrix_data_input, delimiter_actual_data=';')
|
|
95
96
|
a.compare_data_2d_arrays(self, actual_2d_matrix_data_input, expected_2d_matrix_data_input)
|
|
@@ -112,6 +113,7 @@ Below there are some examples how to call the keywords of the DataComparerLibrar
|
|
|
112
113
|
Examples
|
|
113
114
|
Run Keyword And Continue On Failure DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
114
115
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=; delimiter_expected_data=;
|
|
116
|
+
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=@#@ delimiter_expected_data=@#@
|
|
115
117
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
116
118
|
DataComparerLibrary.Compare Data 2d Array With File ${actual_2d_matrix_data_input} C:\\Users\\expected.csv delimiter_expected_data=\t
|
|
117
119
|
DataComparerLibrary.Compare Data File With 2d Array C:\\Users\\actual.csv ${expected_2d_matrix_data_input} delimiter_actual_data=;
|
|
@@ -43,7 +43,7 @@ current date. At "Examples comparing Actual Data with Expected Data" you can fin
|
|
|
43
43
|
|
|
44
44
|
Delimiter
|
|
45
45
|
Default delimiter is ",". You can use the option "delimiter_actual_data" and "delimiter_expected_data" to set another
|
|
46
|
-
delimiter like ";" or "tab".
|
|
46
|
+
delimiter like ";" or "\t" for tab. It is also possible to use a multi-character delimiter like "@#@".
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
Installation
|
|
@@ -71,6 +71,7 @@ Below there are some examples how to call the methods of the DataComparerLibrary
|
|
|
71
71
|
a = DataComparer
|
|
72
72
|
a.compare_data_files(self, actual_file, expected_file)
|
|
73
73
|
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data=';', delimiter_expected_data=';')
|
|
74
|
+
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data='@#@', delimiter_expected_data='@#@')
|
|
74
75
|
a.compare_data_2d_array_with_file(self, actual_2d_matrix_data_input, expected_file, delimiter_expected_data='\t')
|
|
75
76
|
a.compare_data_file_with_2d_array(self, actual_file, expected_2d_matrix_data_input, delimiter_actual_data=';')
|
|
76
77
|
a.compare_data_2d_arrays(self, actual_2d_matrix_data_input, expected_2d_matrix_data_input)
|
|
@@ -93,6 +94,7 @@ Below there are some examples how to call the keywords of the DataComparerLibrar
|
|
|
93
94
|
Examples
|
|
94
95
|
Run Keyword And Continue On Failure DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
95
96
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=; delimiter_expected_data=;
|
|
97
|
+
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=@#@ delimiter_expected_data=@#@
|
|
96
98
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
97
99
|
DataComparerLibrary.Compare Data 2d Array With File ${actual_2d_matrix_data_input} C:\\Users\\expected.csv delimiter_expected_data=\t
|
|
98
100
|
DataComparerLibrary.Compare Data File With 2d Array C:\\Users\\actual.csv ${expected_2d_matrix_data_input} delimiter_actual_data=;
|
{DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary/datacomparer.py
RENAMED
|
@@ -16,7 +16,7 @@ class DataComparer:
|
|
|
16
16
|
# Actual csv file versus expected csv file.
|
|
17
17
|
# Array with SQL-output expected csv file.
|
|
18
18
|
|
|
19
|
-
def compare_data_2d_array_with_file(self, actual_data, expected_file, delimiter_expected_data=
|
|
19
|
+
def compare_data_2d_array_with_file(self, actual_data, expected_file, delimiter_expected_data=",", quotechar_expected_data='"'):
|
|
20
20
|
if 'actual_data' not in locals():
|
|
21
21
|
raise Exception("Input Actual data unknown.")
|
|
22
22
|
#
|
|
@@ -25,15 +25,12 @@ class DataComparer:
|
|
|
25
25
|
#
|
|
26
26
|
print("expected_file: ", expected_file)
|
|
27
27
|
#
|
|
28
|
-
if delimiter_expected_data is None:
|
|
29
|
-
delimiter_expected_data = ","
|
|
30
|
-
#
|
|
31
|
-
if quotechar_expected_data is None:
|
|
32
|
-
quotechar_expected_data = '"'
|
|
33
|
-
#
|
|
34
28
|
with open(expected_file, mode='rt', encoding='utf-8') as expected_file:
|
|
35
29
|
time.sleep(1)
|
|
36
|
-
|
|
30
|
+
if len(delimiter_expected_data) == 1:
|
|
31
|
+
expected_data = list(csv.reader(expected_file, delimiter=delimiter_expected_data, quotechar=quotechar_expected_data))
|
|
32
|
+
else:
|
|
33
|
+
expected_data = list(csv.reader((line.replace(delimiter_expected_data, chr(255)) for line in expected_file), delimiter=chr(255), quotechar=quotechar_expected_data))
|
|
37
34
|
#
|
|
38
35
|
if actual_data == [] and expected_data == []:
|
|
39
36
|
raise Exception("Actual and Expected data are not present. Actual data input 2d-array and Expected data input file are empty.")
|
|
@@ -47,7 +44,7 @@ class DataComparer:
|
|
|
47
44
|
DataComparer.__compare_data(self, actual_data, expected_data)
|
|
48
45
|
|
|
49
46
|
|
|
50
|
-
def compare_data_file_with_2d_array(self, actual_file, expected_data, delimiter_actual_data=
|
|
47
|
+
def compare_data_file_with_2d_array(self, actual_file, expected_data, delimiter_actual_data=",", quotechar_actual_data='"'):
|
|
51
48
|
if not os.path.exists(actual_file):
|
|
52
49
|
raise Exception("Input file doesn't exists: ", actual_file)
|
|
53
50
|
#
|
|
@@ -56,15 +53,12 @@ class DataComparer:
|
|
|
56
53
|
#
|
|
57
54
|
print("actual_file: ", actual_file)
|
|
58
55
|
#
|
|
59
|
-
if delimiter_actual_data is None:
|
|
60
|
-
delimiter_actual_data = ","
|
|
61
|
-
#
|
|
62
|
-
if quotechar_actual_data is None:
|
|
63
|
-
quotechar_actual_data = '"'
|
|
64
|
-
#
|
|
65
56
|
with open(actual_file, mode='rt', encoding='utf-8') as actual_file:
|
|
66
57
|
time.sleep(1)
|
|
67
|
-
|
|
58
|
+
if len(delimiter_actual_data) == 1:
|
|
59
|
+
actual_data = list(csv.reader(actual_file, delimiter=delimiter_actual_data, quotechar=quotechar_actual_data))
|
|
60
|
+
else:
|
|
61
|
+
actual_data = list(csv.reader((line.replace(delimiter_actual_data, chr(255)) for line in actual_file), delimiter=chr(255), quotechar=quotechar_actual_data))
|
|
68
62
|
#
|
|
69
63
|
if actual_data == [] and expected_data == []:
|
|
70
64
|
raise Exception("Actual and Expected data are not present. Actual data input file and Expected data input 2d-array are empty.")
|
|
@@ -97,7 +91,7 @@ class DataComparer:
|
|
|
97
91
|
DataComparer.__compare_data(self, actual_data, expected_data)
|
|
98
92
|
|
|
99
93
|
|
|
100
|
-
def compare_data_files(self, actual_file, expected_file, delimiter_actual_data=
|
|
94
|
+
def compare_data_files(self, actual_file, expected_file, delimiter_actual_data=",", delimiter_expected_data=",", quotechar_actual_data='"', quotechar_expected_data='"'):
|
|
101
95
|
for file in (actual_file, expected_file):
|
|
102
96
|
if not os.path.exists(file):
|
|
103
97
|
raise Exception("Input file doesn't exists: ", file)
|
|
@@ -105,22 +99,17 @@ class DataComparer:
|
|
|
105
99
|
print("actual_file: ", actual_file)
|
|
106
100
|
print("expected_file: ", expected_file)
|
|
107
101
|
#
|
|
108
|
-
if delimiter_actual_data is None:
|
|
109
|
-
delimiter_actual_data = ","
|
|
110
|
-
#
|
|
111
|
-
if delimiter_expected_data is None:
|
|
112
|
-
delimiter_expected_data = ","
|
|
113
|
-
#
|
|
114
|
-
if quotechar_actual_data is None:
|
|
115
|
-
quotechar_actual_data = '"'
|
|
116
|
-
#
|
|
117
|
-
if quotechar_expected_data is None:
|
|
118
|
-
quotechar_expected_data = '"'
|
|
119
|
-
#
|
|
120
102
|
with open(actual_file, mode='rt', encoding='utf-8') as actual_file, open(expected_file, mode='rt', encoding='utf-8') as expected_file:
|
|
121
103
|
time.sleep(1)
|
|
122
|
-
|
|
123
|
-
|
|
104
|
+
if len(delimiter_actual_data) == 1:
|
|
105
|
+
actual_data = list(csv.reader(actual_file, delimiter=delimiter_actual_data, quotechar=quotechar_actual_data))
|
|
106
|
+
else:
|
|
107
|
+
actual_data = list(csv.reader((line.replace(delimiter_actual_data, chr(255)) for line in actual_file), delimiter=chr(255), quotechar=quotechar_actual_data))
|
|
108
|
+
#
|
|
109
|
+
if len(delimiter_expected_data) == 1:
|
|
110
|
+
expected_data = list(csv.reader(expected_file, delimiter=delimiter_expected_data, quotechar=quotechar_expected_data))
|
|
111
|
+
else:
|
|
112
|
+
expected_data = list(csv.reader((line.replace(delimiter_expected_data, chr(255)) for line in expected_file), delimiter=chr(255), quotechar=quotechar_expected_data))
|
|
124
113
|
#
|
|
125
114
|
if actual_data == [] and expected_data == []:
|
|
126
115
|
raise Exception("Actual and Expected data are not present. Input files are empty.")
|
|
@@ -361,7 +350,6 @@ class DataComparer:
|
|
|
361
350
|
if param:
|
|
362
351
|
period_name = name
|
|
363
352
|
period_count = param
|
|
364
|
-
#period_names = ["years", "months", "days"]
|
|
365
353
|
#
|
|
366
354
|
if period_name in period_names:
|
|
367
355
|
kwargs[period_name] = int(period_count)
|
|
@@ -387,7 +375,6 @@ class DataComparer:
|
|
|
387
375
|
print()
|
|
388
376
|
print()
|
|
389
377
|
|
|
378
|
+
|
|
390
379
|
def __print_comparation_result(self, row_number, column_number, actual_data, expected_data, error_message):
|
|
391
380
|
print("Row: ", row_number + 1, " Column: ", column_number + 1, " => Actual data: ", actual_data, " Expected data: ", expected_data, " Remark / Error message: ", error_message)
|
|
392
|
-
|
|
393
|
-
|
{DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DataComparerLibrary
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.810
|
|
4
4
|
Summary: For comparing csv-files or 2d-array with csv-file.
|
|
5
5
|
Home-page:
|
|
6
6
|
Author: René Philip Zuijderduijn
|
|
@@ -62,7 +62,7 @@ current date. At "Examples comparing Actual Data with Expected Data" you can fin
|
|
|
62
62
|
|
|
63
63
|
Delimiter
|
|
64
64
|
Default delimiter is ",". You can use the option "delimiter_actual_data" and "delimiter_expected_data" to set another
|
|
65
|
-
delimiter like ";" or "tab".
|
|
65
|
+
delimiter like ";" or "\t" for tab. It is also possible to use a multi-character delimiter like "@#@".
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
Installation
|
|
@@ -90,6 +90,7 @@ Below there are some examples how to call the methods of the DataComparerLibrary
|
|
|
90
90
|
a = DataComparer
|
|
91
91
|
a.compare_data_files(self, actual_file, expected_file)
|
|
92
92
|
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data=';', delimiter_expected_data=';')
|
|
93
|
+
a.compare_data_files(self, actual_file, expected_file, delimiter_actual_data='@#@', delimiter_expected_data='@#@')
|
|
93
94
|
a.compare_data_2d_array_with_file(self, actual_2d_matrix_data_input, expected_file, delimiter_expected_data='\t')
|
|
94
95
|
a.compare_data_file_with_2d_array(self, actual_file, expected_2d_matrix_data_input, delimiter_actual_data=';')
|
|
95
96
|
a.compare_data_2d_arrays(self, actual_2d_matrix_data_input, expected_2d_matrix_data_input)
|
|
@@ -112,6 +113,7 @@ Below there are some examples how to call the keywords of the DataComparerLibrar
|
|
|
112
113
|
Examples
|
|
113
114
|
Run Keyword And Continue On Failure DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
114
115
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=; delimiter_expected_data=;
|
|
116
|
+
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv delimiter_actual_data=@#@ delimiter_expected_data=@#@
|
|
115
117
|
DataComparerLibrary.Compare Data Files C:\\Users\\actual.csv C:\\Users\\expected.csv
|
|
116
118
|
DataComparerLibrary.Compare Data 2d Array With File ${actual_2d_matrix_data_input} C:\\Users\\expected.csv delimiter_expected_data=\t
|
|
117
119
|
DataComparerLibrary.Compare Data File With 2d Array C:\\Users\\actual.csv ${expected_2d_matrix_data_input} delimiter_actual_data=;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{DataComparerLibrary-0.800 → DataComparerLibrary-0.810}/src/DataComparerLibrary.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|